Commit Graph

511 Commits

Author SHA1 Message Date
Tom Hacohen 8e43730006 Eo: unmark Eo_Class as deprecated.
It's not deprecated, it's actually a useful alias.
2016-03-04 14:25:28 +00:00
Tom Hacohen 0c03ba0a5d Eo: Remove more deprecated functions. 2016-03-04 14:24:20 +00:00
Tom Hacohen b55ec7a34e Eo: remove the long deprecated eo_data_get.
It has been deprecated for a while, and now it's time to actually stop
using it.
2016-03-04 14:23:02 +00: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
Tom Hacohen d2f799e4cb Eo: Remove useless safety checks.
Those can never happen, ever.
2016-03-04 14:09:34 +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
Jaehyun Cho 3398db2dcd Eo: Fix typo of SUPER_TAG_SHIFT.
This commit fixes commit fc88037977
2016-03-04 13:51:43 +09: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 fc88037977 Eo: Migrate to the new syntax (Eo 4).
The syntax is described in: https://phab.enlightenment.org/w/eo/

Summary:
eo_do(obj, a_set(1)) -> a_set(obj, 1)
eo_do_super(obj, CLASS, a_set(1)) -> a_set(eo_super(obj, CLASS), 1)

eo_do_*_ret() set of functions are no longer needed.

This is the first step, the next step would be to also fix up eo_add()
which currently still uses the old syntax and is not 100% portable.

@feature
2016-03-03 09:53:23 +00:00
Tom Hacohen a761171009 Eo: Add an interface for other interfaces to inherit from. 2016-02-29 12:08:33 +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
Tom Hacohen 1f576da49e Revert "Eo: Print an ERR when deleting an object with data refs."
Revert this in the meanwhile. See discussion on the ML. This should be
enabled though, and issues fixed.

This reverts commit ec2f92e35f.
2016-02-18 19:28:41 +00:00
Tom Hacohen ec2f92e35f Eo: Print an ERR when deleting an object with data refs. 2016-02-18 15:59:36 +00:00
Tom Hacohen 1c8ae97b83 Evas canvas3d mesh: Fix Eolian warnings.
This includes either migrating types to eolian, fixing namespace or
importing extra types.
2016-02-17 10:00:11 +00:00
Tom Hacohen a6878fc95f Eina types: add missing extern to matrix3 type. 2016-02-17 09:58:12 +00:00
Tom Hacohen 4bfcc8a347 Eolian eina_types: Add Eina.Matrix3 and start using it. 2016-02-12 14:41:40 +00:00
Tom Hacohen 668fd4a6e8 Eo: add support for initialising eo after it has been shut down.
Until now it wasn't allowed/possible to init (eo_init) eo after it has
been shut down (eo_shutdown). This commit fixes that, so now that is
fully legal to have as many init/shutdown cycles as you want.

There was a previous workaround for this issue:
e47edc250d.

This should allow more flexibility when using the EFL in loadable
modules and in various other scenarios.

The problem is that the class_get() functions cache the previously
created class for efficiency, but the class is freed if eo is shut down,
so the cached pointer is actually invalid.
The solution to the problem was to maintain a generation count
(incremented every time we shut down eo), and compare that to a locally
saved version in class_get(). If they don't match, recreate the class,
as it has already been freed.

@feature
2016-02-04 09:27:15 +00:00
Tom Hacohen 43d05a334d Revert "Eo: Prevent shutdown from actually doing anything"
This commit was a workaround to let us shutdown and then init eo without
any issues. It leaks and it's wrong. This will properly be fixed in the
next commit.

This reverts commit e47edc250d.
2016-02-04 09:27:15 +00:00
Tom Hacohen d01ed68825 Eo: fix eo_shutdown()'s return value to be FALSE on shutdown.
The return value of init/shutdown is true if eo is init, false otherwise.
This was broken until now.

@fix.
2016-02-03 16:56:15 +00:00
Tom Hacohen 6721a7f1d6 Eo base: Make object del event @hot.
This event also needs to be hot, because it's lifecycle related.
We could leak and etc. if this event is not hot.

@fix.
2016-02-03 09:15:04 +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
Cedric BAIL 0ae951e544 eo: mark both callback,add and callback,del as @hot.
This events needs to be hot to remain unfreezable or it is impossible
for anyone to track all callback setting/unsetting safely.
2016-02-02 10:45:42 -08:00
Jean-Philippe Andre 258639a92e Eo: Actually mark EO_EV_ as EINA_DEPRECATED
This should add compilation warnings whereever they're used.
2016-01-21 13:10:48 +09:00
Jean-Philippe Andre 9d76a44b78 Eo: Replace deprecated EO_EV_ by EO_BASE_EVENT_ 2016-01-21 13:10:05 +09:00
Stephen Houston 669cd788ba Eo: Spell "Class" correctly when printing error.
Leave variables named Klass so it behaves with syntax highlighting and doesn't confuse programmers.  However when Erroring, the message should be spelled correctly with "Class".
2016-01-15 19:41:59 -06: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
Tom Hacohen 0ff1646871 Eo: Rearrange class creation code a bit.
This is not really needed, I just did it to make it easier for coverity
(and future static analysers) to understand that the class id doesn't
need to be accessed with a lock.

CID1341854
2016-01-07 13:04:12 +00: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
Vincent Torri 47ed848a87 Evil: integrate the dlfcn code into Evil
This will remove some incompatibilities with other packages,
especially for win-builds
2015-12-29 22:13:58 +09:00
Jean-Philippe Andre e47edc250d Eo: Prevent shutdown from actually doing anything
Currently, eo_shutdown can't work.

Every Eo_Class ID is stored inside its class_get() function as a
static variable. This means any call to class_get() after eo_shutdown()
(even if eo_init was done properly) will lead to using an invalid ref
for the class id. In other words, the class is not valid anymore,
and objects can't be created.

Resetting the pointer to NULL would be possible, if we passed it
during the class creation. But this would lead to potential crashes
if a class was created from a now dlclosed library.

The only solution I can envision here is to check that class_get
actually returns a valid ref with the right class name. Most likely
the performance impact is not acceptable.

This fixes make check for me (with systemd module for ecore).
2015-12-29 20:55:50 +09:00
Jean-Philippe Andre 0dd9e02df2 Eo: Add internal function call on pointer errors
Useful for GDB: break on this function when things go wrong.
Similar to eina_safety.

I guess we could set some Eina_Error and maybe even have error
callbacks for easier application debugging. Later.
2015-12-29 20:55:50 +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
Felipe Magno de Almeida a3db1dddd3 efl-js: JavaScript Eolian binding
To configure efl sources with bindings to use in nodejs add ––with-js=nodejs in configure flags to generate node files

$ configure --with-js=nodejs

and compile normally with:

$ make
$ make install

To use, you have to require efl:

efl = require('efl')

The bindings is divided in two parts: generated and manually
written. The generation uses the Eolian library for parsing Eo files
and generate C++ code that is compiled against V8 interpreter library
to create a efl.node file that can be required in a node.js instance.

@feature
2015-12-23 23:59:40 -02: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 0bebaed0ac Eo do: use the __thread directive when available to manage call stack.
This is faster in most cases, and to be honest, should be much faster
than it is. I don't understand why there's no better directive to mark a
variable as *really* important thread storage that is used all the time.
2015-11-09 11:43:04 +00:00
Tom Hacohen 3e40b45be6 Eo: Remove extra paranoid-never could happen safety checks.
I was not able to reach those without arbitrary memory corruption, but
in that case we are in trouble anyway.
2015-11-09 11:43:04 +00:00
Tom Hacohen 6ed69b1d11 Eo: Reorganise some of the code and cleanup.
This is cleaner and makes more sense.
2015-11-09 11:43:04 +00:00
Tom Hacohen 3782931c50 Eo: Removed weird unneeded condition. 2015-11-09 11:43:04 +00:00
Tom Hacohen f28f6ecbfa Eo: Move op resolve check to where it belongs (out of hot path).
It was put in the wrong place. It should abort early if it detects we
can't resolve, and shouldn't check it if we already know it's OK.
2015-11-09 11:43:04 +00:00
Tom Hacohen 9686e44b92 Eo unref: Decrease amount of checks and hint branch prediction.
This may look minor, but this is such a hot path, that this actually
speeds things up a bit.
2015-11-09 11:43:04 +00:00
Tom Hacohen f7f7fc69cf Eo: Split object checking from class checking and simplify.
The check there was wrong for objects anyway, and was ultra conservative
for classes.
2015-11-09 11:43:04 +00: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 680388472e Eo: Reduce call stack memory footprint.
We don't really need the eo_id most of the time, and when we do, it's
very easy to get it. It's better if we just don't save the eo_id on the
stack, and just save if it's an object or a class instead.
2015-11-09 11:43:04 +00:00
Tom Hacohen adbc534703 Eo: Remove useless optimisation that is more harm than good.
It seems that the idea behind that optimisation, is to save object data
fetching when calling functions implemented by the object's class inside
functions implemented by the object's class. This should be rare enough
not to worth the upkeep, memory reads and memory writes, especially
since for all cases apart of mixins (for which this optimisation won't
work for anyway), the upkeep is more costly than fetching the data
again.
2015-11-09 11:43:04 +00:00