Commit Graph

150 Commits

Author SHA1 Message Date
Avi Levin fa8f786d44 back 2015-03-16 15:55:32 +02:00
Tom Hacohen 43629a95f3 Eo: Add eo_do_super_ret.
This is the equivalent of eo_do_ret for super calls.
2015-02-24 14:23:15 +00: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
Daniel Zaoui d95224b5a7 Eo: add function name to the eo_do pre and post hooks.
This is useful to determine the Eolian class/function.
2015-01-11 16:28:44 +02: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 5db7a70603 Revert "Revert "Eo: Move eo_add_ref logic inside the library.""
This reverts commit 11da942184.

Can't reproduce with the non-existent bug report, thus have no choice
but consider it as working.
2014-10-10 09:30:52 +01:00
Mike Blumenkrantz 11da942184 Revert "Eo: Move eo_add_ref logic inside the library."
This reverts commit 8d16d8eb57.

this broke child object deletion in all the cases that I tested and regular object deletion in some cases as well
2014-10-09 21:07:30 -04:00
Tom Hacohen 8d16d8eb57 Eo: Move eo_add_ref logic inside the library.
It was a stupid lazy decision to leave it outside. Having it inside is safer
and cleaner.
2014-10-02 15:02:48 +01:00
Tom Hacohen a7560dbc61 Eo: Change eo_add/del/unref behaviour.
Before this change eo_add() used to create an object with 1 ref, and if
the object had a parent, a second ref.
Now, eo_add() always returns an object with 1 ref, and eo_add_ref()
    preserves the old behaviour (for bindings).

eo_unref now un-parents if refcount is 0, and eo_del() is an alias for
eo_unref (will change to be a way to ensure an object is dead and goes
        to zombie-land even if still refed).
2014-09-25 17:38:45 +01:00
Tom Hacohen 6846978ebd Eo: Get rid of eo_add_custom.
We decided to deprecate this one in favour of setting thing in the
construction between the constructor and the finalizer.
2014-09-25 10:30:56 +01:00
Tom Hacohen b33372b1f6 Eo do: simplify eo_do macro.
This moves the mainloop check inside the function. There was never need
for it to be in client code (i.e a header/macro).
This is better suited inside eo_do_start because this is a macro some
bindings have to re-implement, and we definitely don't want it to be any
more complicated than it has to be.

This breaks ABI and makes elm 1.12 depend on efl 1.11. This is not an issue
as because of eolian and interfaces it's already the case.
2014-09-23 14:36:20 +01:00
Cedric BAIL d86f094d67 eo: do not call eina_tls_get as often when in the main loop.
eina_tls_get is really slow, having a fast path for the main loop does really
help us right now. It is also unlikely that slowing down a little bit the use
of eo in thread is going to have any impact on application speed any time soon.

I win a +10% on expedite benchmark compared to without.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2014-09-04 18:11:45 +02:00
Jérémy Zurcher ef91422e90 Eo: add missing field initializer 2014-08-22 10:09:58 +02:00
Daniel Kolesa bb24b60638 eolian: generate implicit typedef for each class
And use these typedefs instead of just Eo in API.
2014-08-21 09:26:03 +01:00
Tom Hacohen 46b3643ff0 Revert "eo: replace composite_objects Eina_List with an array of Eo_Object*"
Comp objects are rare, and since we allow using classes as interfaces,
we end up allocating a lot of memory for something we don't even use.
That's why it was a linked list in the first place, and that's why it
should remain a list.

This is almost a complete revert. I reverted the code itself, and the
intent (use of array instead of list), but not the tests, or the new
return value added to comp_detach, which is useful.

This reverts commit ef09ef7489.
2014-06-13 18:20:24 +01:00
Daniel Zaoui 2160d0f27a Eolian/Generator: use a specific define for the Eo APIs.
The generation of EOAPI instead of EAPI for the Eo functions is only
needed for code readibility.
2014-06-10 07:57:09 +03:00
Tom Hacohen 6eb3bda426 Eo base: Start generating eo_base from the .eo file. 2014-06-03 11:28:02 +01:00
Tom Hacohen 10626ff538 Eo: Fix and use the abstract class .eo file.
Until now it was just there, but never generated or used.
2014-06-03 09:19:19 +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 9f98ddae46 Eo: Fix docs of functions that have changed in eo2. 2014-05-30 14:54:10 +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 c58b3401c3 Eo/evas events: Move legacy events dynamic generator to eo. 2014-05-28 12:28:17 +01:00
Jean-Philippe Andre 02f24d76e1 Eo: Add function name to OP desc on Windows
Match function names when the API pointer is out of range.
Reviewed by TAsn and modified according to his comments :)

Differential Revision: https://phab.enlightenment.org/D876
2014-05-21 18:03:53 +09:00
Tom Hacohen 8784685120 Eo: Rename descs2 to descs (remnant of the Eo2 change). 2014-05-09 08:26:25 +01:00
Tom Hacohen 368f36dee3 Eo: Improved docs a bit. 2014-05-09 08:26:25 +01:00
Tom Hacohen d77a7ce468 Eo: eo_do now returns called func's value + default ret fix.
It's now completely valid to do:
a = eo_do(obj, a_get());

or:
b = eo_do(obj, a_set(1), b_get());

Also, the default return value for eo2 functions is now also returned
when the object is invalid, not just when the object does not match
class.

It's a small refactor that fixed both issues at once.

@feature
@fix
2014-04-14 10:54:08 +01:00
Tom Hacohen 92cc33c46f Eo: EO_BASE_CLASS->EO_CLASS. 2014-04-10 04:20:21 +01:00
Tom Hacohen 374af9b9ca Eo: eo_base's data_*->key_data_*. 2014-04-10 04:20:21 +01:00
Tom Hacohen c32bb4fe95 Eo2: Updated naming Eo2->Eo. 2014-04-10 04:20:21 +01:00
Tom Hacohen 80faa56ed3 Eo2: Removed more Eo1 code. 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 e41f2804b4 eo2: improve err msg in _eo2_api_op_id_get() and _eo2_call_resolve() 2014-04-10 04:20:20 +01:00
Tom Hacohen 055dd3c521 eo2: change the order of EO2_OP_FUNC* to put EAPI first.
This looks cleaner and more aligned. Also, it makes more sense as the
internal function is bound to the EAPI and not the other way around.
2014-04-10 04:20:20 +01:00
Tom Hacohen 08aca96bc3 eo2: get rid of eo2_stack_depth_get.
This is super internal, no reason why it should be exposed.

We should just implement automatic stack growth.
2014-04-10 04:20:20 +01:00
Tom Hacohen 76dc0d99a6 eo2: formatting. 2014-04-10 04:20:19 +01:00
Tom Hacohen 2fe10219c0 eo2: prefixed internal functions with _.
This is done to prevent code completion from picking them up.
2014-04-10 04:20:19 +01:00
Tom Hacohen ebae305a9e eo2: fixed validity checks for eo2_do_super.
The class should be checked to be valid and non-null.
This fixes the issues with eo_suite.
2014-04-10 04:20:19 +01:00
Tom Hacohen 7c3f7e9b5b eo2: eo2_do_super should only have one func.
This is a limitation that must be respected as eo2_do_super, unlike
eo2_do can end up with having different next class because of mixins.
2014-04-10 04:20:19 +01:00
Tom Hacohen a62d150c96 eo2: share code between eo2_do and eo2_do_super. 2014-04-10 04:20:19 +01:00
Tom Hacohen b8ae43b464 eo2: prefix all the eo2_*internal* functions with an underscore.
This prevents them from being auto-completed by IDEs which makes
development nicer.
2014-04-10 04:20:19 +01:00
Tom Hacohen 123ebca6d0 eo2: don't create types starting with __, that's reserved.
__ is a reserved compiler domain, prefix with _Eo2_ instead.
2014-04-10 04:20:19 +01:00
Tom Hacohen d0f71a6e8b eo2: fix eo2_base_class function signatures.
"void func(void)" != "void func()" !
The former is a func that accepts 0 parameters.
The latter is a func that accepts variable number of parameters.

Watch out.
2014-04-10 04:20:19 +01:00
Jérémy Zurcher 36c5127822 eo2: add EO2_CLASS_DESCRIPTION_NOOPS() macros 2014-04-10 04:20:18 +01:00
Jérémy Zurcher 23e2c29298 eo2: remove EO2_CLASS_FUNC_* macros
there is no more difference in class or regular functions prototypes and definitions

- eo2_api_op_id_get() uses _eo_is_a_class() at runtime
- add 'void *class_data EINA_UNUSED' parameter to eo2_base class functions
- Eo2_Op_Call_Data.klass is kept only for eo2_hook_call_pre end eo2_hook_call_post,
  but could be removed easily
2014-04-10 04:20:18 +01:00
Tom Hacohen f481e8dc64 eo2: fixed EO2_VOID_CLASS_FUNC_BODY function. 2014-04-10 04:20:18 +01:00
Tom Hacohen 5e92ffb121 eo2: improved error messages on failed resolves. 2014-04-10 04:20:18 +01:00
Jérémy Zurcher eb01d1c3e8 eo2: add EO2_CLASS_CLASS 2014-04-10 04:20:18 +01:00
Jérémy Zurcher 2e9ae2a571 eo2: optimize eo2_call_resolve and call stack 2014-04-10 04:20:18 +01:00
Jérémy Zurcher e51e397b89 eo2: fix eo_base_data_get(), eo_composite_attach(), eo_composite_detach() 2014-04-10 04:20:18 +01:00
Jérémy Zurcher 782092f7af eo2: eo2_do() and eo2_do_super() supports objects and classes 2014-04-10 04:20:18 +01:00