Commit Graph

269 Commits

Author SHA1 Message Date
Tom Hacohen 9c264fa028 Eo: Fix issue of too many unrefs in some cases.
This problem was that because the refcount is now shared between the
parent and the programmer in some cases we would get a double unref. An
example way of triggering it is creating a button and putting it in a
box. The box has a callback registered that when the button is deleted
it would delete itself too. The problem is that the delete callback is
called the button is removed from the box thus causing the box to unref
it again (because of the parent), although the refcount was already
accounted for.

There is another more convoluted scenario that I have yet to fix.

Thanks to raster for reporting.
2016-05-24 19:27:47 +01:00
Tom Hacohen 4bae0f135a Eo: use internal unref function intsead of public one.
This is a micro optimisation that doesn't really matetr, but since
we already have the actual eo object, we may as well use it.
2016-05-24 19:27:47 +01:00
Cedric Bail 75a53ece10 eo: for consistency use object like all our API. 2016-05-18 08:18:04 -07:00
Carsten Haitzler 43661180f7 efl - key/data/value/obj attach to eo objects - make these properties
the key data now is a property so they come out in bindings really
nicely like:

  obj.key_data["blah"] = x;

  x = obj.key_data["blah"];

etc.
2016-05-18 02:02:45 +09:00
Daniel Kolesa 7782c0bcb9 eolian: add event_prefix and have classes follow that or eo_prefix by default
Previously events used to use class name as a prefix and ignored eo_prefix
when specified. This is no longer the case. Events follow eo_prefix by default
now. In order to get around this for classes where this is undesirable, a new
field event_prefix was added which takes priority over eo_prefix. If neither
is specified, class name is used like previously.

@feature
2016-05-17 17:50:43 +01:00
Tom Hacohen 546ff7bbba Eo: Remove eo_del() and make eo_unref() the replacement.
We used to have eo_del() as the mirrored action to eo_add(). No longer,
now you just always eo_unref() to delete an object. This change makes it
so the reference of the parent is shared with the reference the
programmer has. So eo_parent_set(obj, NULL) can free an object, and so
does eo_unref() (even if there is a parent).

This means Eo no longer complains if you have a parent during deletion.
2016-05-17 16:23:23 +01:00
Tom Hacohen e9c4e7bf76 Eo name: Rename Eo.Base.id to Eo.Base.name.
This is there to reduce confusion with Eo_Id and also the name
is just better.
2016-05-17 16:00:13 +01:00
Tom Hacohen 9ef65788f4 Eo: Rename an internal function to reduce confusion.
@raster added eo_id_get() which was confusing because we already had
_eo_id_get() that was used internally.
2016-05-17 10:29:16 +01:00
Tom Hacohen 79575d8943 Eo children: Make children tracking an inlist instead of a list.
This saves us a pointer in every eo object and a pointer indirection
when accessing children.
2016-05-17 10:26:54 +01:00
Tom Hacohen fa9145d469 Eo name find: Fix possible out of bounds write in eo name find.
CID1354840
2016-05-16 17:41:59 +01:00
Tom Hacohen 537b138a23 Eo composite: change composite objects to not be tied to parent
This commit breaks behaviour!
Re-parenting no longer detaches composite objects, so watch out.

Now you can have an object be a composite object of an object although
it's not its child. This allows widgets to do things like having an
object as the child of a child object while still making it a composite
object to the main object.

With this change, composite objects don't keep a reference to the child,
but instead composite "bonds" are implicitly removed when either the
parent or the child are destructed.
2016-05-05 16:45:12 +01:00
Marcel Hollerbach c66695bedb eo: replace loop_get with object_find
Summary:
object_find is more generic, so other mechanisms can also reuse the
code.
The object itself has to support the function, so there is no need for
eo_isa which would have a negative performance impact.
The base class implementation calls interface_get on the parent, so a
override of the function can just call the super function to continue in
the recursion.

Test Plan: just run the eo test suite

Reviewers: raster, tasn, jpeg

Reviewed By: tasn, jpeg

Subscribers: felipealmeida, netstar, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D3909
2016-05-04 10:43:55 +02:00
Tom Hacohen 42346e22f4 Eo keyed data: Refactor the code so it's mostly shared.
The code was redundant though essentially the same. This refactoring
removes a lot of this code and made everything shared.
2016-04-29 13:53:02 +01:00
Tom Hacohen 0730152deb Eo keyed data: Unify node cleanup code. 2016-04-29 13:53:02 +01:00
Tom Hacohen 9195d008da Eo keyed data: No need to register to see if a subobject was deleted.
This is completely unnecessary. We are holding a reference to the
object, it can't get deleted under our feet.
2016-04-29 13:13:02 +01:00
Tom Hacohen 393ca3c3f9 Eo keyed data: Clean up code and fix a bug with 'Value'.
This code is an absolute mess. This is the first step towards fixing that.
This cleanup let me find a bug that would have printed errors when using
Eina_Value so I fixed that too.
2016-04-29 13:08:14 +01:00
Tom Hacohen 106951a61d Eo: Make eo_del() an eo function.
This was done following a feature request by @raster. There was no real
reason for it not to be an eo function and this gives us more
flexibility.

The reason why this done was to provide a way for classes to do special
things when an object deletion was requested, for example in the case of
Evas, hide the object.
2016-04-26 16:29:18 +01:00
Carsten Haitzler 6a84ffbe5b eo base - optimize memory by extending extension memory
so geneirc data, wrefs, comments and id's are not that common so put
them all into their own memory segment that's allocated separately to
the core object so we only use this memory when needed. we already had
an extension section anyway so it's not new - just using it now for
more of the rarer bits of data. 2 more pointers gone from most objects
anyway and now extension code handling is a bit cleaner.
2016-04-24 14:40:46 +09:00
Carsten Haitzler 5e09d1307b eo base - remove the duplicated key dels and just do eo_key_del() now
this rationalizes all the duplicated key dels (key_data, key_obj and
key_value).
2016-04-21 18:02:31 +09:00
Carsten Haitzler 26b5eb8a26 eo base - add loop_get for base class
base class objects will ask their parent object to get the loop. this
means it recurses all objects regardless of type until it finds an
object that returns a proper loop object - eg a loop object returns
itself, a window, gfx/ui object returns the mainloop object etc. etc.

@feature
2016-04-21 15:19:36 +09:00
Cedric BAIL 1fd049510f eo: add support for restartable event inside nested call.
The idea is that when you are processing those events from within
they won't call twice any of the event until all of them are processed
at least once (Or one of them did return EINA_FALSE).
2016-04-20 15:50:46 -07:00
Carsten Haitzler bc4d43a1cc eo base: names - add finding functions to fund by name
this finds child objects by walking the child tree searching children
by using the search string which can be name, class:name and both
class and name can also be a glob.

@feature
2016-04-20 18:29:41 +09:00
Carsten Haitzler 45456d9e82 eo base - add value keys in addition to object and void ptr data keys
eina value would allow any value to be attached to an eo object and
also be freed nicely too. this would allow any generic data to go
there without overloading a void * that us c coders love to abuse.

@feature
2016-04-19 18:36:57 +09:00
Carsten Haitzler 1b266ff1e4 eo base - clean up base data struct formatting
just a cleanup of the struct formatting/spacing
2016-04-19 17:40:11 +09:00
Carsten Haitzler 96142eef96 eo - add object comments - esp useful for erigo and gui builders
also useful for debugging and more. this also makes both name/id and
comment an extension blob of ram so objects dont keep growing
boundlessly in memory usage/size

@feature
2016-04-19 17:21:21 +09:00
Carsten Haitzler 86e7d642d5 eo - add object names/ids esp useful for erigo as it wants object names
also evas objects have names too, so add this as this was discussed
and now the feature is in. there is nothing to find objects by name
yet. that's more api's and features to add after this.

@feature
2016-04-19 16:34:53 +09:00
Carsten Haitzler ff253bff08 eo - key obj reference - don't unref on del event callback
object is being deleted by cb - don't unref as we are already at 0.
2016-04-14 10:35:18 +09:00
Carsten Haitzler 8be56c9498 eo - add object sotrage in generic values with ref/unref
this adds eo_key_obj_set/get/del() like with data but for object
handles so the obj is ref'd as long as the key and parent obj exists
and then unreffed on deletion. it also tracks deletion of reffed
objects like weak refs and then removes the key automatically.

@feature
2016-04-13 01:06:40 +09:00
Tom Hacohen f14305024e Eo event: rename Eo_Event->event_info to Eo_Event->info.
The previous naming was redundant and too long.
2016-04-12 15:23:55 +01:00
Tom Hacohen 912f03d6e2 Eo legacy events: remove pointless string copies.
This was there because the old code modified the string. It is no
longer needed now that we just stringshare it.
2016-03-04 14:17:55 +00:00
Daniel Zaoui 66256028d5 Eo: set object as const for key_data_get
Due to Eo4 changes, const is now important for this function.
2016-03-04 13:55:07 +02:00
Tom Hacohen 23a6b12183 Fix migration script mistakes and compilation warnings.
Mostly unused vars following the removal of eo_do_ret().
However, there are some cases where the migration script got some things
wrong, and I had to manually fix them.
2016-03-03 09:58:08 +00:00
Tom Hacohen f21ade6123 Automatic migration to Eo4.
I just ran my script (email to follow) to migrate all of the EFL
automatically. This commit is *only* the automatic conversion, so it can
be easily reverted and re-run.
2016-03-03 09:58:08 +00:00
Tom Hacohen e71e6561ee Eo callbacks: Migrate all of the EFL to the new event cb signatures. 2016-02-29 11:33:27 +00:00
Tom Hacohen 56ea371dfb Eo events: Change event callback signature.
Change the Eo event callback signature to what suggested by Marcel
Hollerbach in the ML (Thread: EFL interface change - Animator).

This changes the signature of callbacks from
Eina_Bool cb(void *data, Eo *obj const Eo_Event_Description *desc, void *event_info)
to
Eina_Bool cb(void *data, const Eo_Event *event)

Where Eo_Event is a structure that holds these parameters.

This makes it less annoying to not use parameters (you end up using
EINA_UNUSED less), and allows for future extensions to callback
parameters.

@feature
2016-02-29 11:33:24 +00:00
Cedric BAIL f1bf1e58df eo: return a value when adding or removing callback to help the caller manage state. 2016-02-02 10:47:25 -08:00
Jean-Philippe Andre 9d76a44b78 Eo: Replace deprecated EO_EV_ by EO_BASE_EVENT_ 2016-01-21 13:10:05 +09:00
Jean-Philippe Andre 22324f21b3 EFL: Mark EOLIAN functions as static when possible
This affects mostly evas filters.
2016-01-13 15:34:20 +09:00
Jean-Philippe Andre 13d9f7ebcd Eo: Print object class name during Eo.Base ctor/dtor
Printing class_name(MY_CLASS) is useless information.
Printing the object's real class name is much more useful.
2016-01-05 14:54:04 +09:00
Chris Michael c94289d0b2 eo: Fix resource leak
Coverity CID1339783 says that we have a potential resource leak here.
'cb' gets allocated via calloc, but is not freed if we end up
returning here

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2015-12-28 10:09:36 -05:00
Tom Hacohen e992a3a1e0 Revert "Eo: Optimise event callback call"
This reverts commit 4b116627c2.

This can't be done, because the freeze state can change from within the
callbacks so you need to check if events are frozen every time.
2015-11-09 14:06:39 +00:00
Jérémy Zurcher 4b116627c2 Eo: Optimise event callback call
check if the event is frozen before walking the event list
2015-11-09 15:03:03 +01:00
Tom Hacohen f7196513d0 Eo callback call: Remove redundant safety checks.
This is already being checked by eo_do, no need to duplicate this here.
2015-11-09 11:43:04 +00:00
Tom Hacohen 5661f96c05 Eo callback call: Remove redundant refcounting.
We already get refcounting from eo_do, no need to have more refcounting here.
2015-11-09 11:43:04 +00:00
Tom Hacohen 0908422084 Eo callback call: Simplify callback desc matching code.
As part of this change, we also error on adding invalid callbacks.
2015-11-09 11:43:04 +00:00
Tom Hacohen 9d68b14313 Eo callbacks: simplify callback call code a bit.
We don't need this check because it's already checked in the match function.
2015-11-09 11:43:04 +00:00
Tom Hacohen 8e2e7bd61e Eo events: Add a struct member marking if it's a legacy event or not.
My previous patch to this piece of code
(37f84b7e96), caused a significant
performance regression. This is such a hot path, that even accessing the
strings when we don't have to slows things down drastically. It makes
more sense to just store it in the structure.

This commit breaks ABI (though most people probably won't even need to
recompile anything else because of the memory layout).
It was discussed on IRC and was decided this is a big enough issue to
warrant a fix during the freeze.

@fix
2015-10-16 11:55:07 +01:00
Tom Hacohen d889da6b12 Eo legacy events: Fix broken callback comparison
Commit 37f84b7e96 introduced a few changes
to the callback matching mechanism that made it so sometimes callbacks
would be triggered for the wrong events. The problem was there because
of the support for legacy events that forces to do string comparison
instead of the usual pointer comparison. We should only do string
comparison when we are certain one of the callbacks is a legacy
generated one.

Regression tests will follow tomorrow. Way too late here for that.

Thanks to cedric for reporting.
2015-09-29 01:01:05 +01:00
Tom Hacohen 37f84b7e96 Eo: Drop doc field from ops and events.
This hasn't been used for a while. Since we are going to break Eo a bit anyway
it's a good opportunity to drop this.

This may cause a slight performance issues with legacy events, such as
smart callbacks. This shouldn't really be a problem as we've migrated away from
them. If it does, we need to migrate the remaining parts. Only relevant
for callbacks that are added before the classes are created, which
shouldn't be possible except for smart, only for old evas callbacks.
2015-09-28 15:09:16 +01:00
Daniel Zaoui 08e4f0ce8d Eo: fix double callback deletion
Scenario:
- Same signal/function/data registered twice on e.g mouse_down
- On mouse_down, register mouse_move and mouse_up
- On mouse_up, unregister mouse_move

Result: mouse_move still invoked after mouse_up

Reason:
- When the mouse_move callback deletion is required, the cb is
flagged as deleted but is not freed as walking_list blocks.
- When the second (and same) has to be deleted, it will try to delete
the first again because the delete_me flag is not checked.

This patch fixes it by checking the delete_me flag when determining the
candidate.

@fix
2015-09-26 22:37:03 +03:00
Tom Hacohen d6b18c1e25 Eo base: print an error when an object with a parent is destructed.
This should not happen. Objects with parents must have their parents
unset before they reach refcount == 0. That's because the parent is the
one holding the refcount. This means that if we get to the destructor
(object is deleted) while a parent is still set, we have an error
scenario.
2015-08-26 14:17:28 +01:00
Tom Hacohen acc158a2bf Revert "Revert "Eo base: Change parent_set to be an assignment of ref.""
Had to revert it until I pushed the changes to elm, which I had issues
with. Now the patch can safely go back in.

This reverts commit 37abea3831.
2015-08-26 10:47:06 +01:00
Tom Hacohen 37abea3831 Revert "Eo base: Change parent_set to be an assignment of ref."
Damn, this breaks some things. Reverting until fixed.

This reverts commit 9c78ee0bf4.
2015-08-26 10:33:24 +01:00
Tom Hacohen 9c78ee0bf4 Eo base: Change parent_set to be an assignment of ref.
After this change, parent_set assigns a ref, so for example:
  obj = eo_add(CLASS, parent); /* Ref is 1 */
  eo_do(obj, eo_parent_set(parent2)); /* Ref is 1 */
  eo_ref(obj); /* Ref is 2 */
  eo_do(obj, eo_parent_set(NULL)); /* Ref is 1, giving the ref to NULL */
  eo_do(obj, eo_parent_set(parent)); /* Ref is 1 */

This is following a discussion on the ML about commit
8689d54471.

@feature
2015-08-26 10:11:18 +01:00
Tom Hacohen 93ade6f4ce Eo base: clean up parent removal in destructor.
This cleans up the changes in 8689d54471.
This commit reduces code duplication, and fixes broken handling of
overridden parent_set().
2015-08-21 17:23:13 +01:00
Carsten Haitzler a6c184502e eo - use ren not xref for children to not waste memory
optimization

xrefs keep lists of objects references. children are already in a list.
why keep both? lots of extra memory used for no value when debug is on
(pretty much most of the time).
2015-08-20 19:41:47 +09:00
Carsten Haitzler 8689d54471 eo - destruction - ensure child is removed from parent child list
this follows on from cbc1a217bf as this
code was correct, but was then causing bugs due to children staying in
their parent lists. this should never have happened and this is really
bad. this fixes this and ensures children on destruction are gone from
their parent lists.

@fix
2015-08-20 12:53:53 +09:00
Carsten Haitzler cbc1a217bf eo - fix bug vector when unparenting of an eo obj may affect others
it is possible that a destructor/parent_set override or function could
go modifying the children list of objects in a parent, this the
EINA_LIST_FREE may actually miss objects in the process since within
the "free" func the list may have been altered etc.

@fix
2015-08-18 17:23:16 +09:00
Tom Hacohen 52d998f475 Eo base: Remove the free_func parameter from key_data_set.
This was not really useful and against the Eolian guidelines.
While I promised I won't break things until the 27th, I was ill
(still am), so I'm giving myself a 1 day pass. :P
2015-05-28 17:47:59 +01:00
Tom Hacohen 92fb2917cb Eo: Remove eo_error_set() and clean up finalizer()
This is another cleanup in perparation for the Eo stable release.
This is no longer needed thanks to the proper error reporting with
eo_constructor()'s new return value.

The finalizer change cleans it up a bit so it catches more cases/issues.
This also means that the finalizer cleans up the object in all cases,
and not only some.

@feature.
2015-05-20 16:25:38 +01:00
Tom Hacohen 6efbfe227a Eo: Add a return value to eo_constructor().
From now on, constructors should return a value, usually the object
being worked on, or NULL (if the constructor failed). This can also
be used for implementing singletons, by just always returning the same
object from the constructor.

This is one of the final steps towards stabilizing Eo.

@feature
2015-05-20 13:03:24 +01:00
Tom Hacohen e27f40111d Eo: Mark composite APIs as beta.
Until now we used @protected, but now we can finally properly use @beta.
2015-05-08 16:18:36 +01:00
Tom Hacohen 1506ec30ba Eo base: mark composite API as not ready. 2015-05-06 15:46:18 +01:00
Tom Hacohen a791d97bfc Eo: Remove GCCism and make it more portable.
This affects eo_do() and eo_add() that used to use the ({}) GCCism.
Following a discussion with Peter de Ridder after my talk at FOSDEM,
we've decided to reopen the GCCism (works with other gcc compatible
compilers like clang and intelc) discussion, and after a bit of back and
forth it was decided to make things more portable, at the cost of ease
of use.

For example:
if (eo_do(obj, visible_get()))
is no longer allowed, the portable alternative
Eina_Bool tmp;
if (eo_do_ret(obj, tmp, visible_get()))
is to be used instead.

However:
eo_do(obj, a = a_get(), b = b_get(), bool_set(!bool_get))
are still allowed and OK.

eo_do(obj, if (a_get()) return;);
is no longer allowed, but:
eo_do(obj, if (a_get()) something());
is still allowed.

For clarity, this commit only incorporates the Eo changes, and not the
EFL changes to make the efl conform with this change.

Thanks again to Peter de Ridder for triggering this important discussion
which led to this change.
2015-02-23 17:16:02 +00:00
Tom Hacohen 01a487d881 Eo composite: Fix composite object functions to be eo functions.
For some reason, they were normal functions instead of eo functions,
which makes them harder to bind, less safe, and just wrong.
This commit fixes that.
2014-10-21 12:37:00 +01:00
Tom Hacohen 2a0937b889 Eo base: Add a property to indicate if the object is finalized;
This enables checking if an object is being created, or has already been
finalized. This is useful in functions that you want to allow
only during the creation phase (i.e inside the eo_add()).
2014-08-29 10:26:23 +01:00
Tom Hacohen ab38ffd6ed Eo base: Fix marking of eolian functions with EOLIAN. 2014-07-24 15:35:00 +01:00
Tom Hacohen 490eebabea Eo base: Mark class methods.
Use the new @class attribute to mark class methods.
2014-07-24 15:35:00 +01:00
Cedric BAIL 3dcc172f57 eo: make parent_set a O(1) operation instead of O(n).
This does impact performance quite significantly when you have a lot
of children.
2014-07-06 13:15:21 +02:00
Tom Hacohen 6eb3bda426 Eo base: Start generating eo_base from the .eo file. 2014-06-03 11:28:02 +01:00
Tom Hacohen d9263e6571 Eo base: rename event_freeze_get to event_freeze_count_get.
This is needed because of a possible clash between the method event_freeze
and the property event_freeze with bindings.
2014-06-02 12:50:23 +01:00
Tom Hacohen f92e5d50f9 Eo: Add eo_finalize. A func that's called at the end of eo_add.
This function lets you hook at the end of eo_add and override it for a
class. This is essentially the first step towards killing custom
constructors. Instead of having a custom constructor, you should just
do:
eo_add(CLASS, parent, a_set(3), b_set("eou"));
eo_constructor is called at the beginning for pre-init things.
eo_finalize is called at the end, for actually finalizing and doing
things. This cleans up the API and possibly saves a lot of things that
would have been stupid and slow in the past, like loading an elm widget
with an existing theme, and then changing the theme.

** This breaks Eo ABI, please recompile elementary and everything else that
creates eo objects.

@feature
2014-05-30 11:22:36 +01:00
Tom Hacohen 1e1104584f Eo legacy events: Add missing addition to hash table.
This rendered the whole thing useless.

Found thanks to coverity.
CID 1216616
CID 1216617
2014-05-29 09:24:28 +01:00
Tom Hacohen 50a6e371a1 Eo: Support mixing legacy and non-legacy callbacks. 2014-05-28 12:28:18 +01:00
Tom Hacohen c58b3401c3 Eo/evas events: Move legacy events dynamic generator to eo. 2014-05-28 12:28:17 +01:00
Tom Hacohen cdea54dd40 Eo callbacks: Fix a possible issue of corrupted callback list.
This happens when we delete more than one callback at the beginning
of the list (i.e 2 or more) in one go.
2014-05-16 14:33:36 +01:00
Tom Hacohen ecc445b47c Eo: Don't write to pointer after free.
Fixes coverity: CID 1039898.
2014-05-16 14:33:36 +01:00
Tom Hacohen 9b265b0065 Revert "Eo: Fix deref after free."
Coverity found the issue, but it's an issue we've already fixed in the
past. I don't know how it got lost, but it seems like someone did a bad
merge. Probably when migrating to Eo2.

This reverts commit 831c20464d.
2014-05-16 14:33:00 +01:00
Tom Hacohen 831c20464d Eo: Fix deref after free.
In some rare cases it was possible for a pointer to be referenced after
it was already freed. This is now fixed thanks to coverity.

@fix

CID 1039898
2014-05-16 14:28:57 +01:00
Tom Hacohen 1fe084b78c Eo: Made some functions class functions again.
This broke in the transition to Eo2.
2014-05-01 13:58:27 +01:00
Lukasz Stanislawski 80b1ca8e43 eo: fix broken children iterator, remove redundant fields.
@fix

Summary: Tests added.

Reviewers: raster, JackDanielZ, tasn

CC: cedric

Differential Revision: https://phab.enlightenment.org/D763

Signed-off-by: Cedric Bail <cedric.bail@free.fr>
2014-04-17 19:36:12 +02:00
Tom Hacohen 8c025ee4d9 Eo: Renamed eo files from eo2* to eo*. 2014-04-10 04:20:21 +01:00
Tom Hacohen 3c46e7dab8 Eo2: Removed a lot of Eo1 code. 2014-04-10 04:20:21 +01:00
Jérémy Zurcher 2490a1bef2 eo2: better op_descs integration
struct _Eo_Class_Description swallows
Eo2_Op_Description *descs2;
2014-04-10 04:20:15 +01:00
Jérémy Zurcher f05f51dd60 eo2: _Eo_Class_Description swallows op_descs
remove OpDescs argument from macros,
eo2_get_op_id() uses binary search
2014-04-10 04:20:15 +01:00
Tom Hacohen c5af1a7305 Eo: Add an error message when old parent is wrong.
This is an addition to raster's fix in
55d8156414
(eo - base class protection against NULL old_parent_pd)
2013-11-26 10:10:24 +00:00
Carsten Haitzler 55d8156414 eo - base class protection against NULL old_parent_pd
bug T569 still shows that we have cases where, during e shutdown, we
still get eo_data_scope_get() return NULL for a parent object.
whatever this is, segfaulting is much worse than protecting and
marching on. so protect
2013-11-26 17:03:50 +09:00
Tom Hacohen cad3cf30a4 Eo: Check parent is valid in eo_parent_set.
This is an extension to raster's 0355a6a296
(eo - fix _parent_set in base clase when old_parent_pd is NULL).
I also added an error message in case this check fails.
2013-11-20 12:23:18 +00:00
Carsten Haitzler 0355a6a296 eo - fix _parent_set in base clase when old_parent_pd is NULL
this should fix T538
2013-11-20 20:25:33 +09:00
Tom Hacohen a52751d065 Eo: Fixed potential infinite loop with child deletion.
It looks like it should get into a loop for every object that has
children.
2013-11-08 12:11:27 +00:00
Tom Hacohen c7addf4083 Changed Eo class names to be consistent.
All the class names are now of the format: Lib_Type_Subtype_Extra.
2013-11-07 11:17:52 +00:00
Carsten Haitzler 69e27abdc3 eina - and e3fl in general - stop using eina_error_get/set - useless really 2013-10-11 16:50:40 +09:00
Cedric Bail 435caae51a eo: use Eina_Spinlock instead of Eina_Lock.
This is an ABI/API break for Eo, you will need to rebuild everything that use Eo.
2013-10-11 11:08:17 +09:00
Tom Hacohen 104a57b58a Eo callbacks: Fix a possible issue of corrupted callback list.
This happens when we delete more than one callback at the beginning
of the list (i.e 2 or more) in one go.
2013-09-30 14:16:46 +01:00
Tom Hacohen f5d4a807c8 Eo: Don't write to pointer after free.
Fixes coverity: CID 1039898.
2013-09-30 14:15:37 +01:00
Daniel Zaoui 334ac705f3 Eo: fix when detaching the composite of its parent ... that has to exist 2013-09-29 08:50:32 +03:00
Tom Hacohen 832fc5b5ce Manually revert "eo: replace Eo_Class with Eo"
This reverts commit ee1b0833ed

I did it manually because the code changed too much.

We actually want this type, it makes things more clear and easier to
understand.
2013-09-27 16:40:32 +01:00
Tom Hacohen 2a82ff95e4 Eo: unify the class func and normal func prototypes.
Conflicts:
	src/lib/eo/eo.c
2013-09-27 14:01:47 +01:00
Jérémy Zurcher 41bd91379e eo: _Eo -> _Eo_Object
Conflicts:
	src/lib/eo/eo.c
2013-09-27 14:01:46 +01:00
Jérémy Zurcher ee1b0833ed eo: replace Eo_Class with Eo 2013-09-27 14:01:46 +01:00
Cedric Bail 936a8072f2 eo: make eo_parent_get/set part of eo_base_class. 2013-09-25 13:34:18 +09:00
Cedric Bail cecd19803e eo: let's handle memory allocation gracefully. 2013-07-16 20:03:48 +09:00
Cedric Bail 166e89baac Revert "eo: try to fix callback array to work on other system."
This reverts commit e89f32d28d.
2013-07-16 15:18:16 +09:00
Cedric Bail ebb36c98a8 eo: micro optimization speed up callback call by 3%. 2013-07-16 13:45:36 +09:00
Cedric Bail e89f32d28d eo: try to fix callback array to work on other system. 2013-07-16 13:41:27 +09:00
Cedric Bail cb5dbb55c3 eo: reporting error here just make the caller code more complex for nothing valuable. 2013-07-05 10:18:19 +09:00
Cedric Bail cc012b754c eo: little micro optimization. 2013-07-01 18:35:55 +09:00
Cedric Bail dcf65a8eec eo: add a new macro to make the code easier to read and use it. 2013-06-28 15:28:30 +09:00
Cedric Bail 7849c5de32 eo: 30% speed improvement in message propagation. 2013-06-28 10:18:39 +09:00
Tom Hacohen 6e3f555fe4 Eo: Made del event an hot event (we always want to get it). 2013-05-21 15:07:41 +01:00
Cedric Bail 1db92f9ac0 eo: some event should not be frozen. 2013-05-20 18:17:29 +09:00
Daniel Willmann 7f87d9891d eo: Fix incorrect pointer allocation
We want to allocate sizeof(Eo_Dbg_Info) - not sizeof(Eo_Dbg_Info *)
bytes.
2013-04-24 23:27:48 +01:00
Tom Hacohen 269e3a7797 Eo: Fixed an error in in _eo_callback_remove and a few minor things.
The other things are not really issues but more about silencing clang.
Thanks to clang-analyzer.
2013-04-12 17:17:38 +01:00
Tom Hacohen 263e54d705 Eo: Moved the debug info functions to the base class code. 2013-04-12 13:49:26 +01:00
Tom Hacohen 3e11c380c9 Eo: Added eo_event_callback_array_* functions.
These functions let you pass an array of callbacks instead of just one.
It's more memory efficient to use this if you just add a bulk of events
on the same object.

This commits breaks ABI, and breaks API of the EO_EV_CALLBACK_ADD/DEL
signals (the event info passed).
2013-04-12 12:02:49 +01:00
Tom Hacohen 45fdd4574e Eo base: Reduce object memory footprint. 2013-04-11 17:04:42 +01:00
Tom Hacohen c226a11bfe Eo callbacks: Improve memory footprint of callbacks.
We don't really need a double-linked-list with a pointer to the last item.
This saves us 2 pointers per callback, which is a decent improvement.
2013-04-11 15:07:07 +01:00
Aharon Hillel 028f059d32 Clouseau-Eo integration: Added debug info functions.
From now, classes implementing the Eo function with id
EO_BASE_SUB_ID_DBG_INFO_GET will be able to show in Clouseau their own
specific information.
Information contents is controlled by the class itself and no more
by Clouseau. Basic types and lists are supported..

Signed-off-by: Aharon Hillel <a.hillel@samsung.com>

SVN revision: 83410
2013-01-29 06:36:23 +00:00
Vincent Torri 3b5a3448b7 merge: add eo
SVN revision: 77072
2012-09-26 06:56:52 +00:00