Tom Hacohen
9d332da1f8
Eo2: Adjust to composite object changes.
2014-04-10 04:20:21 +01:00
Jérémy Zurcher
d39d705087
eo2: call stack is now thread safe
...
create/destroy tls key (_eo2_call_stack_key) at eo_init()/eo_shutdown().
use _eo2_call_stack_get() to allocate the stack when required.
register _eo2_call_stack_free() as eina_tls_cb_new() delete callback.
2014-04-10 04:20:21 +01:00
Jérémy Zurcher
f812b38a66
eo2: do not allow ill formed class creation
...
eo_class_new() returns NULL on error in _eo2_class_funcs_set().
it covers: NULL API func, API redefined, dich func override,
overriding non-existing fct.
2014-04-10 04:20:20 +01:00
Jérémy Zurcher
70fe1398fd
eo2: if _eo2_class_funcs_set() fails eo_class_new() returns NULL
...
call to _eo2_class_funcs_set() is moved out of _eo_class_constructor()
into eo_class_new().
2014-04-10 04:20:20 +01:00
Jérémy Zurcher
a0d761cfa9
eo2: _eo2_call_resolve() fails if op is EO_NOOP
2014-04-10 04:20:20 +01:00
Jérémy Zurcher
9d2eeb7a8b
eo2: improve _eo2_class_funcs_set() errors support
...
as op descs are sorted, we can't output fct indexes in error msgs, but
as they are sorted using api_fct as key, we can detect multiple usage of
the same api_fct which leads to an unpredictable call to whatever is
returned by _eo2_api_op_id_get()->_eo2_api_desc_get().
it is still possible to instanciate an object of a not well defined class.
2014-04-10 04:20:20 +01:00
Jérémy Zurcher
a9c325c124
eo2: normalize ERR msgs
2014-04-10 04:20:20 +01:00
Jérémy Zurcher
c506ce2e1f
eo2: fix err msg in _dich_func_set()
2014-04-10 04:20:20 +01:00
Jérémy Zurcher
82af591b83
eo2: improve _eo_op_id_name_get() to support eo1/2
2014-04-10 04:20:20 +01:00
Jérémy Zurcher
19245b48f8
eo2: add _eo2_op_id_desc_get()
2014-04-10 04:20:20 +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
Jérémy Zurcher
63c271dc5e
eo2: fix indentation
2014-04-10 04:20:20 +01:00
Jérémy Zurcher
d3cd7cd63c
eo2: do not try to unref classes in eo2_do_end()
2014-04-10 04:20:20 +01:00
Jérémy Zurcher
56ae6cf32e
eo2: remove memset() in _eo2_do_end() as all stack fields are set in _eo2_do_start()
2014-04-10 04:20:20 +01:00
Jérémy Zurcher
adb5b8776d
eo2: no need to resolve eo_id when we reuse previous stack frame
2014-04-10 04:20:20 +01:00
Jérémy Zurcher
ae536bdd84
eo2: call stack grows and shrinks
2014-04-10 04:20:20 +01:00
Jérémy Zurcher
1834e3ff12
eo2: remove dead code
2014-04-10 04:20:20 +01:00
Tom Hacohen
0dc70153e5
eo2: optimize eo2_do_super func relove a bit.
...
no need to call dich_func_get twice, just reuse the value previously
fetched.
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
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
1890fdf27f
eo2: fixed eo2_do call order.
...
This fixes the mixin test and general calling order.
"Next class" can only be known per op. That's why super should be
restricted to only one op.
2014-04-10 04:20:19 +01:00
Tom Hacohen
d9ceddf63a
eo2: fixed formatting.
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
a588c7d99e
eo2: correctly handle eo2_do(NULL, ...).
2014-04-10 04:20:19 +01:00
Jérémy Zurcher
b08ae598a8
eo2: do not restrict search for api in class extensions to some class types
2014-04-10 04:20:19 +01:00
Jérémy Zurcher
ca1f245366
eo2: _eo2_api_desc_get can look into interfaces extensions too
2014-04-10 04:20:19 +01:00
Jérémy Zurcher
541cf25723
eo2: eo2_add_internal_end() return NULL if do_error is set
2014-04-10 04:20:19 +01:00
Jérémy Zurcher
9c1856bf82
eo2: support NULL op_descs
2014-04-10 04:20:19 +01:00
Jérémy Zurcher
11595dc40c
eo2: fix mixim elaboration
...
a mixin class must not inherit
- _eo2_api_desc_get()
accept NULL klass param
EO_CLASS_TYPE_REGULAR_NO_INSTANT is an acceptable extension class type for
- _eo2_class_funcs_set() do not shout if parent is NULL
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
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
47d560b720
eo2: support composites object
...
_eo2_api_desc_get() searches extensions classes
eo2_call_resolve() searches composites objects
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
fc448f89af
eo2: clean up and speed up call stack usage
2014-04-10 04:20:18 +01:00
Jérémy Zurcher
4bbd97913d
eo2: eo2_add_internal_start use trash and fix MAGIC
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
Jérémy Zurcher
3a86881941
eo2: eo2_do_start use EO_OBJ_POINTER_ macros not _eo_obj_pointer_get
2014-04-10 04:20:17 +01:00
Jérémy Zurcher
74f7bf3633
eo2: eo2_call_resolve_internal support undef HAVE_EO_ID
2014-04-10 04:20:17 +01:00
Jérémy Zurcher
2af0764eeb
eo2: _eo2_api_desc_get: walks in mro not in klass->parent
2014-04-10 04:20:17 +01:00
Jérémy Zurcher
fe23e26d0e
eo2: add DBG msg in eo2_class_funcs_set
2014-04-10 04:20:17 +01:00
Cedric Bail
8613ebe403
eo2: memset will be faster, still why not using NULL instead of -1 ?
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
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