Commit Graph

316 Commits

Author SHA1 Message Date
Tom Hacohen f080d40df7 Eo: rename EO_HOT_EVENT_DESCRIPTION to EO_EVENT_DESCRIPTION_HOT.
The old naming is inconsistent with the rest of the EFL. This fixes that.
Since we are already breaking ABI (and possibly API), we should fix this too.
2015-09-28 15:09:16 +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
Tom Hacohen db6c17627f Eo: Fix windows support.
This is heavily based on a patch by Vincent Torri. I just refactored it
a bit so it doesn't break ABI on Linux, only on Windows (where it was
broken anyway).

This patch changes things so on Windows, functions are looked up only
based on their name. Because of the indirection (and export/import
tables) windows does, this is the only reasonable way to make it work.
2015-06-18 14:23:08 +01:00
Thiep Ha ac09acd508 Eo: Add Null check
Summary: Add Null checking when allocate memory.

Reviewers: cedric, tasn

Reviewed By: tasn

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2664
2015-06-11 09:50:12 +01:00
Tom Hacohen 5b89cf1633 Eo base: move type definitions into eo_base.eo. 2015-05-29 11:39:03 +01: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 d0b58aab54 Eo base: Fix Eolian files to use Eo.Base instead of Eo.
Eo is not a known Eolian type, we should only be using the class names.
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
Cedric BAIL 3dfdafe41c eo: remove the need to order the header correctly for Windows. 2015-05-07 09:53:11 +02:00
Tom Hacohen 6cb22bae35 Eo: Add eo_do_part.
This is a convenience macro to be used by the common pattern of getting
a part and then immediately calling functions on it. For example,
  without this macro, you'd have to write code like:

Eo *part;
eo_do(obj, part = efl_part_name_get("partname"));
eo_do(part, a_set(7));

while using the helper function trims it to:

eo_do_part(obj, efl_part_name_get("partname"), a_set(7));

@feature
2015-05-06 17:56:05 +01:00
Tom Hacohen c3c12ab4ad Eo: Improve documentation. 2015-05-06 15:46:18 +01:00
Tom Hacohen b26088d558 Eo: Take eo out of beta.
This is following a last review and a discussion on IRC. Eo has been
stable (apart of a decision a few months ago to support more compilers)
for a long while. Developers are already using it for a while, and it's
stupid to break it for them anyway, so we might as well make this
promise now. There are no plans to change it anymore, and it's been
heavily used and tested throughout the EFL for a few releases now.

I'm tagging it as a feature, although it's not, I'm doing it for the
automatic changelog generation. :)

@feature.
2015-05-06 15:46:18 +01:00
Tom Hacohen e891c56f60 Revert "eo: add eo_error_get"
As discussed on IRC and ML. We are in a feature freeze phase, and this
patch is not essential. Furthermore, this patch was never discussed.

This reverts commit 537c7fe9e3.
2015-04-15 08:18:25 +01:00
Jaehwan Kim 537c7fe9e3 eo: add eo_error_get
This is pair of eo_error_set.
2015-04-15 13:57:42 +09:00
Cedric BAIL 3d37f150c7 eo: internal variable should not have that much chance to conflict prefix them with ___. 2015-04-03 16:14:19 +02:00
Srivardhan Hebbar d180f4991b eo: updated documentation of eo_add and eo_ref_add.
Summary: Had a chat with raster to understand the behavior of these two functions in the IRC. Thought it might be helpful if added in the documentation itself. So updated it accordingly.

Reviewers: cedric

Subscribers: cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-03-06 20:19:21 +01: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
Jérémy Zurcher 93f85f095e eo2: rewrite eo2_do_start(...)
we need Eo_Class *cur_klass for eo2_do_super
 be sure not to update stack pointer before we can't fail anymore
2014-04-10 04:20:18 +01:00
Jérémy Zurcher 2be91e465a eo2: change a few variable names
in the EPAI, don't show that Eo* could be IDs.
in the implementation, use klass_id and obj_id
if you know or want it to be a class or an object,
use eo_id in general cases.
2014-04-10 04:20:18 +01:00
Jérémy Zurcher c9ccc700fd eo2: add eo2_parent_set(), eo2_parent_get(), eo2_children_iterator_new()
imported from eo_base_class.c as is in
a7f417e 2013-12-24 23:45:30 +0900 <Carsten Haitzler (Rasterman)>
2014-04-10 04:20:17 +01:00
Jérémy Zurcher 796b151c27 eo2: minor fixes after huge rebase
indentation
use _Eo_Object * instead of _Eo *
use EO_CLASS_POINTER_RETURN_VAL(), _eo_id_get(), and _eo_class_id_get().
2014-04-10 04:20:17 +01:00
Cedric Bail 0b279b600e eo2: we can rely on LD_PRELOAD for those hook, so removing them. 2014-04-10 04:20:17 +01:00
Jérémy Zurcher 7477a51432 eo2: add EO2_HOOK_DO_PREPARE 2014-04-10 04:20:17 +01:00
Cedric Bail 4b97591634 eo2: add hook for beinning and start of all function execution and for all _do.
NOTE: I don't know what the _CLASS_FUNC are, so I may have broken stuff there.
2014-04-10 04:20:17 +01:00
Jérémy Zurcher bbab74320a eo2: fix eo2 custom constructors 2014-04-10 04:20:17 +01:00
Jérémy Zurcher ebc90200a6 eo2: sprinkle with 'const' 2014-04-10 04:20:17 +01:00
Jérémy Zurcher 8959832be4 eo2: fixed EO2_CLASS_FUNC_BODY and etc. functions. 2014-04-10 04:20:17 +01:00
Tom Hacohen 2bd03348e3 eo2: revert "fixed EO2_CLASS_FUNC_BODY and etc. functions."
Still need to change it to get call earlier. Oversight because
of incomplete make files.

This reverts commit 1ea966c3bef7384a91e386477dc07015ed18d33f.
2014-04-10 04:20:17 +01:00
Tom Hacohen 1db137fa8c eo2: fixed EO2_CLASS_FUNC_BODY and etc. functions. 2014-04-10 04:20:17 +01:00
Jérémy Zurcher 4f73887b47 eo2: remove EO2_OP_FUNC_VIRTUAL
a pure virtual function is an EO2_OP_FUNC
with NULL as private function implementation pointer
2014-04-10 04:20:17 +01:00
Tom Hacohen feb5a5dc9e eo2: fix backslash alignment.
This is one of the reasons why I hate backslash alignments, you end up
fixing style when you should be working on code.
2014-04-10 04:20:17 +01:00
Tom Hacohen 5f45e57b89 eo2: revert "eo2_add accepts non-defauld constructors"
We want to have normal functions as non-default constructors, not va_arg
ones. What we should do is split the object creation to two parts again.
The creation, the constructing (changes using the macro) and the
verification/end part that checks the constructor has been called.

This reverts commit 2ff2ce1894f173b306a896bda595e1a7768c074d.
2014-04-10 04:20:17 +01:00
Jérémy Zurcher 7be0748b34 eo2: implement class function support 2014-04-10 04:20:17 +01:00
Jérémy Zurcher 42ad23c5c8 eo2: eo2_add accepts non-defauld constructors 2014-04-10 04:20:17 +01:00
Jérémy Zurcher 2d5baec80c eo2: call _eo2_class_funcs_set from _eo_class_constructor 2014-04-10 04:20:16 +01:00
Tom Hacohen 8307ed5aa8 eo2: cleaned up EO2_CLASS_DESCRIPTION_OPS and OP_DESC_SIZE (renamed). 2014-04-10 04:20:16 +01:00
Tom Hacohen 56f48ac817 eo2: fixed dbg_info_get function to accept the correct number of params. 2014-04-10 04:20:16 +01:00
Tom Hacohen 3ae5b846f7 eo2: cleaned up eo2_do macros.
cleaned up the cleanup attribute usage.
don't use objid more than once (it's a macro).
2014-04-10 04:20:16 +01:00
Jérémy Zurcher 329d752c59 eo2: do not call eo2_do_end() if eo2_do_start() fail 2014-04-10 04:20:16 +01:00
Jérémy Zurcher b6991985ed eo2: eo2_do() uses __attribute__ cleanup
to protect us against bad use of break, goto, return ... in eo2_do,
we use __attribute__((cleanup(eo2_do_end))) to ensure that eo2_do_end()
is called whatever.
2014-04-10 04:20:16 +01:00
Jérémy Zurcher adc1ac0c23 eo2: add eo2_call_stack_depth 2014-04-10 04:20:16 +01:00
Jérémy Zurcher 1aa3b1536f eo2: add virtual func support 2014-04-10 04:20:16 +01:00
Tom Hacohen ec1e507465 eo2: explicitly put void as the arguments in a zero argument function (macro). 2014-04-10 04:20:16 +01:00
Jérémy Zurcher 1d9d0cee9c eo2: EO2_OP_FUNC_OVERRIDE copy doc from overriden func 2014-04-10 04:20:16 +01:00
Jérémy Zurcher 2edd305507 eo2: set eo2_constructor and eo2_destructor chaining 2014-04-10 04:20:16 +01:00
Jérémy Zurcher c17a30dfb9 eo2: add cur_klass in call Stack and eo2_do_super
in eo2_do_start(), reuse previous stack fetched pointers when possible
2014-04-10 04:20:16 +01:00
Jérémy Zurcher 68fb3d4c03 eo2: improve func overriding
add klass_id parameter to eo2_get_op_id()
in op descriptions, allow NULL fct pointer for virtual,
and use EO2_OP_OVERRIDE to declare overriding.
2014-04-10 04:20:16 +01:00
Jérémy Zurcher 58cb65b895 eo2: eo2_base_class, one step further 2014-04-10 04:20:16 +01:00
Jérémy Zurcher 8b6b9532c5 eo2: Eo.h swallows eo2_base_class.h 2014-04-10 04:20:16 +01:00
Jérémy Zurcher 6a16edc888 eo2: call stack Proof Of Concept
no grow/shrink or thread local storage
2014-04-10 04:20:16 +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 8ef9e1c00d eo2: use EO2 instead of EO in macro names 2014-04-10 04:20:15 +01:00
Jérémy Zurcher 6bb29b378b eo2: add EO_FUNC_BODY_VOID and EO_FUNC_BODY_VOIDV macros 2014-04-10 04:20:15 +01:00
Jérémy Zurcher 48c2c1dfba eo2: rename func parameter into _func_ 2014-04-10 04:20:15 +01:00
Jérémy Zurcher 3295c8faaa eo2: add macros to feed op_descs 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
Jérémy Zurcher 41aff7524d eo2: clear _obj_ ptr at the end of eo2_do 2014-04-10 04:20:15 +01:00
Jérémy Zurcher 731f8e1dea eo2: add optional macros eo2_call[v] 2014-04-10 04:20:15 +01:00
Jérémy Zurcher bc6019c154 eo2: add comments end clean up 2014-04-10 04:20:15 +01:00
Jérémy Zurcher 23ae1fc453 eo2: use internal unref, break if eo2_start returns NULL 2014-04-10 04:20:15 +01:00
Jérémy Zurcher 473609e1d3 eo2: eliminate the need of OPID and Eo_Op_Func_Description
at class elaboration, sort the op descriptions using the function pointer.
when calling a function, do a dichotomic search in the
class op descriptions to find the corresponding OP_ID,
then keep it in a static variable.
2014-04-10 04:20:15 +01:00
Cedric Bail d0153fabc1 eo2: make macro pass C++ compiler. 2014-04-10 04:20:15 +01:00
Jérémy Zurcher ef873b7b29 eo2: fix obj_data retrieval and speed up
obj_data which is built from func->src not obj->klass.
replace eo2_func_get() and eo2_data_scope_get() calls
with one call to eo2_call_resolve().
2014-04-10 04:20:15 +01:00
Jérémy Zurcher 73f1d2a09e eo2: add macros for functions with no argument 2014-04-10 04:20:15 +01:00
Tom Hacohen 9e042c0686 eo2: pass the object id and data to function call 2014-04-10 04:20:15 +01:00
Jérémy Zurcher 71341334a9 eo2: add eo2_data_scope_get()
use it in function body
2014-04-10 04:20:15 +01:00
Jérémy Zurcher bfa48634cf eo2: EO_FUNC -> EO_FUNC_BODY
use macro to build the function body,
   the function prototype is a regular one
2014-04-10 04:20:15 +01:00
Jérémy Zurcher 787cffd3f9 eo2: macro eo_o => eo2_o for clarity 2014-04-10 04:20:15 +01:00
Tom Hacohen 2e3ad3be10 eo2: fix wrong eo2_do macro as reported by Jeremy. 2014-04-10 04:20:15 +01:00
Tom Hacohen 35856fdd13 eo2: Eo2 first commit. 2014-04-10 04:20:15 +01:00
Jeff Grimshaw 99a17f85c0 efl/eo: Fix Doxygen markup to prevent a warning
Summary:
The closing @} for the main Eo group is inside the #ifdef
EFL_BETA_API_SUPPORT block, so it gets removed by the preprocessor
unless the project is configured with EFL_BETA_API_SUPPORT.  Moved the
@} outside the #ifdef so it will always be there and Doxygen won't
complain.

Test Plan: make doc 2> doxyerr.log

Reviewers: raster

Reviewed By: raster

CC: cedric

Differential Revision: https://phab.enlightenment.org/D609
2014-03-07 17:01:22 +09:00
Jérémy Zurcher ef09ef7489 eo: replace composite_objects Eina_List with an array of Eo_Object*
as we don't support multiple composites of the same class,
and know at class elaboration how many composites we should have,
we can create the composites array and pack it at the end of the object.
2014-03-05 23:57:39 +01:00
Yossi Kantor 1287177ac2 Eolian: New features/bugs fixes
1) Include files now have include guards
  2) --gh option generates legacy header with --legacy flag and eo header
  without --legacy flag
  3) EOLIAN keyword is introduced to mark functions used by generated
  file.
  4) * for comments when comment text is empty
2014-03-03 14:09:57 +02:00
Jérémy Zurcher c7922f92bc eo: revert 13502a1 and 7821df1
I'm running out of time, will look at it later
2014-02-27 15:02:45 +01:00
Jérémy Zurcher 7821df17dc eo: replace composite_objects Eina_List with an array of Eo_Object*
as we don't support multiple composites of the same class,
and know at class elaboration how many composites we should have,
we can create the composites array and pack it at the end of the object.
2014-02-26 16:25:00 +01:00
Jérémy Zurcher e199230615 eo: eo_composite_attach check composite class, disallow duplicates
eo_composite_attach fail if the class of the composite is not
listed in the parent class extensions, or if there is already a
composite of the same class. The later because calls are
forwarded to the first responding composite, see _eo_op_internal().
2014-02-26 16:25:00 +01:00
Tom Hacohen d6ac2464bb Eo: Make eo_manual_free() return a success flag.
eo_manual_free() can fail in some cases, and it is useful for users of
this API to know about it in order to decide what to do.
2013-11-26 12:10:53 +00:00
Tom Hacohen 087f945690 Eo: remove ; after while (0) in Eo.h.
The whole point of having "do {} while (0);" is to force people to add a
; after the call to the macro. Therefore there should be no semicolon.
2013-11-06 14:38:29 +00:00
Yakov Goldberg ed8301b8bf eo: fix doxygen description, which is needed for parser 2013-10-14 18:12:28 +03:00
Jérémy Zurcher 59a73bdcad eo: enable doc generation 2013-10-13 00:00:13 +02:00
Jérémy Zurcher 1648b67c5b eo: add EO_CLASS_CLASS
it's an empty class without operations,
used as a return value for eo_class_get() when the caller is a class
2013-10-13 00:00:13 +02: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 e6886e05b1 Eo: get rid of eo_class_do(_super) which we don't need anymore.
We now completely use eo_do(_super), so those are not needed.
2013-09-27 17:01:51 +01: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 828928601e Eo: Added an Eo_Class type just for compat. Should be removed. 2013-09-27 14:01:47 +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 f4c1bff0f3 eo: eo_do_super_internal() supports objects and classes
eo_class_do_super() macro calls eo_do_super()
eo_class_do_super_internal() and _eo_class_op_internal() are removed

Conflicts:
	src/lib/eo/eo.c
2013-09-27 14:01:46 +01:00
Jérémy Zurcher ef62885c93 eo: eo_vdo_internal() supports objects and classes
Conflicts:
	src/lib/eo/Eo.h
	src/lib/eo/eo.c
2013-09-27 14:01:46 +01:00
Jérémy Zurcher 12bfc76483 eo: eo_do_internal() supports objects and classes
eo_class_do() macro calls eo_do()
eo_class_do_internal()  is removed
op_type argument is remove from eo_do, eo_vdo_internal

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 7f23deb723 eo: fix typo. 2013-09-13 16:46:08 +09:00
Cedric Bail cd77853222 eo: add eo_childrens_iterator_new().
The goal would be to replace the smart children list and friends. The
problem is that they differ in content. Smart children and Eo children are
the same, but Elm children and them differ. If I put this function as a
virtual, it would be possible to override the list of children and if we
start using it in Evas render loop, that could result in "weird" behavior.

I have added the use of a simplified Eina_Trash mempool kind of feature
to have some fast path for allocation if we start using it in Evas render
loop.
2013-09-11 16:08:06 +09:00
Ryuan Choi 2692234b60 Moved brace of extern "C" to fix build break in c++ applications 2013-07-28 20:38:34 +09:00
Jérémy Zurcher fc4e117e10 remove double def of Eo_Callback_Priority 2013-07-23 19:41:37 +00:00
Cedric Bail 1dd7ed18bc eo: turn Eo API in a beta API as discussion are still ongoing. 2013-07-23 11:27:29 +09:00
Cedric Bail 60eb5d07ea eo: simplify callbacks array declaration for the lazy tasn. 2013-07-17 11:05:50 +09:00
Cedric Bail e939d9a1ce eo: let's add a macro to define a callbacks array. 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 e89f32d28d eo: try to fix callback array to work on other system. 2013-07-16 13:41:27 +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 1db92f9ac0 eo: some event should not be frozen. 2013-05-20 18:17:29 +09:00
Stefan Schmidt 7ac997c5bb eo: Fix memleak in EO_DBG_INFO_APPEND macro
If List is NULL we would never make any use of the alloced Tmp. Better check
for NULL before doing the actual alloc and doing the work.
2013-05-14 14:08:01 +01:00
Daniel Zaoui f6a37f88d2 Eo: Add reference functions for objects data
We want to introduce a new mechanism concerning the data of the Eo
objects.
The goal is to improve the memory management by defragmenting the memory
banks used by the Eo objects. The first phase has been done by raster
and consists in allocating the objects into a separate memory region
that the one used by malloc. So now, we know where our objects are
located.
Now, moving objects means moving data of objects. The issue we have here
is that a lot of data pointers are stored into data of other objects,
e.g Evas Object data into lists for rendering...
We need a way to reference the data and eo_data_get doesn't provide us
that. So we need to improve the API for data extraction by requesting
from the developer if the data will be stored or not. Five functions are
supplied:
- eo_data_scope_get: no referencing, the data pointer is no more used after
exiting the function.
- eo_data_ref: reference the data of the object. It means that while the
data is referenced, the object cannot be moved.
- eo_data_xref: reference the data of the object but for debug purpose,
we associate the objects that references. Same behavior as eo_data_ref
for non-debug.
- eo_data_unref: unreference the data of an object.
- eo_data_xunref: unreference the data of an object previously
referenced by another object.

I deprecated the eo_data_get function. Most of the time,
eo_data_scope_get needs to be used.

In the next patches, I changed the eo_data_get to the corresponding
functions, according to the usage of the data pointer.

The next step is to find all the places in the code where the data is
stored but not yet referenced. This will be done by:
- requesting from every object to unreference all data to other objects.
- moving all the objects from one region to another
- requesting from every object to rerefenrence the data.
- debugging by hunting the segmentation faults and other weird
creatures.
2013-05-01 10:37:08 +03:00
Daniel Zaoui 337fac0e73 Eo: pointers indirection mechanism for objects and classes
Summary: This feature replaces Eo pointers with ids to prevent bad usage
or reuse of these pointers. It doesn't change API.
The mechanism uses tables storing the real pointers to the objects.
See the src/lib/eo/eo_ptr_indirection.c file for more details on the
mechanism.
2013-04-23 09:50:40 +03:00
Daniel Willmann 8a19bb4b29 Eo: Print location of the calling functions in eo log output
Because of the way eo is dispatching method calls of objects the usual
error log you get if you mix up objects or try to call non-existent
methods is:

ERR<12404>:eo lib/eo/eo.c:362 _eo_dov_internal() Can't find func for op
0x24 (ecore_audio_obj_in:ECORE_AUDIO_OBJ_IN_SUB_ID_SPEED_GET) for class
'ecore_audio_obj_out_pulse'. Aborting.

Of course the problem is not really in lib/eo/eo.c, but in the function
calling eo_do()

Now the macros pass source file and line number on to the _internal
functions so we can log where the error originally happened:

ERR<1938>:eo lib/eo/eo.c:362 _eo_dov_internal() in
lib/ecore_audio/ecore_audio_obj_out_pulse.c:119: Can't find func for op
0x24 (ecore_audio_obj_in:ECORE_AUDIO_OBJ_IN_SUB_ID_SPEED_GET) for class
'ecore_audio_obj_out_pulse'. Aborting.

This makes debugging with eo a lot easier.

Signed-off-by: Daniel Willmann <d.willmann@samsung.com>
2013-04-17 15:56:45 +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 83180acf26 Eo: Added cur_klass as a parameter to eo_*_do_super.
We now need to pass the current class to eo_do_super. This is faster and
more memory efficient and generally lets us do things better.

Using the eo_benchmarks we get ~20% speed-up.
2013-03-18 16:14:18 +00:00
Carsten Haitzler 63802e5b84 since Eo.h is inclued in c++ stuff... how about we cast from the void *
return from calloc to Eo_Dbg_Info * since c++ is really unhappy with
this stuff without a cast (silly c++).
2013-03-05 23:00:38 +09:00
Tom Hacohen fc4846fbc6 Eo: Changed EO_DBG_INFO_LIST_APPEND to be an inline function.
It's cleaner. Should have never been a macro. This is part of the effort of
reducing the usage of ({ which is apparently a non standard extension.
We can get rid of most of it and ifdef the rest.
2013-03-05 09:26:07 +00:00
Cedric BAIL 495bcba4ac efl/eo: add an interface to give the list of parameter directly.
I restrained myself to not name it vodooooo !


SVN revision: 83850
2013-02-12 10:20:15 +00:00
Tom Hacohen 70156285b0 Eo dbg: Use eina_value as the debug info type.
SVN revision: 83443
2013-01-29 16:36:01 +00: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
Christopher Michael 19b5f5a1b5 Fix doxygen typo.
Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 82416
2013-01-08 14:12:11 +00:00
Cedric BAIL 35a5c733ff eo: let's make weak ref safer to manipulate.
SVN revision: 81899
2012-12-30 12:26:25 +00:00
Gustavo Sverzut Barbieri 2608f68571 efl/docs: clean-up and make it more uniform.
now unified docs are bit more uniform in their start pages, overall
improved but much to do :-(



SVN revision: 81851
2012-12-28 23:26:05 +00:00
Vincent Torri 3b5a3448b7 merge: add eo
SVN revision: 77072
2012-09-26 06:56:52 +00:00