summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2015-10-16 13:01:01 +0100
committerTom Hacohen <tom@stosb.com>2015-10-16 14:53:22 +0100
commitb61556aa87ad134fe04fbdc8f953bd98d941a18e (patch)
treec14c5afae6510fe0f454a625acea3c9e8a23b329 /src
parent8e2e7bd61e102e8e56dd6e2d605548c0856e2a88 (diff)
Eo: Move mainloop checks inside Eo.
This breaks ABI in a harmless way, and it will give us the ability to drastically improve Eo in the future without breaking ABI again, thus allowing us to declare Eo stable for this release if we choose to.
Diffstat (limited to 'src')
-rw-r--r--src/lib/eo/Eo.h5
-rw-r--r--src/lib/eo/eo.c7
2 files changed, 5 insertions, 7 deletions
diff --git a/src/lib/eo/Eo.h b/src/lib/eo/Eo.h
index 9bfc060..a50a327 100644
--- a/src/lib/eo/Eo.h
+++ b/src/lib/eo/Eo.h
@@ -467,11 +467,10 @@ EAPI extern Eo_Hook_Call eo_hook_call_post;
467// cache OP id, get real fct and object data then do the call 467// cache OP id, get real fct and object data then do the call
468#define EO_FUNC_COMMON_OP(Name, DefRet) \ 468#define EO_FUNC_COMMON_OP(Name, DefRet) \
469 Eo_Op_Call_Data ___call; \ 469 Eo_Op_Call_Data ___call; \
470 Eina_Bool ___is_main_loop = eina_main_loop_is(); \
471 static Eo_Op ___op = EO_NOOP; \ 470 static Eo_Op ___op = EO_NOOP; \
472 if (___op == EO_NOOP) \ 471 if (___op == EO_NOOP) \
473 ___op = _eo_api_op_id_get(EO_FUNC_COMMON_OP_FUNC(Name)); \ 472 ___op = _eo_api_op_id_get(EO_FUNC_COMMON_OP_FUNC(Name)); \
474 if (!_eo_call_resolve(#Name, ___op, &___call, ___is_main_loop, __FILE__, __LINE__)) return DefRet; \ 473 if (!_eo_call_resolve(#Name, ___op, &___call, __FILE__, __LINE__)) return DefRet; \
475 _Eo_##Name##_func _func_ = (_Eo_##Name##_func) ___call.func; \ 474 _Eo_##Name##_func _func_ = (_Eo_##Name##_func) ___call.func; \
476 475
477// to define an EAPI function 476// to define an EAPI function
@@ -538,7 +537,7 @@ EAPI extern Eo_Hook_Call eo_hook_call_post;
538EAPI Eo_Op _eo_api_op_id_get(const void *api_func); 537EAPI Eo_Op _eo_api_op_id_get(const void *api_func);
539 538
540// gets the real function pointer and the object data 539// gets the real function pointer and the object data
541EAPI Eina_Bool _eo_call_resolve(const char *func_name, const Eo_Op op, Eo_Op_Call_Data *call, Eina_Bool is_main_loop, const char *file, int line); 540EAPI Eina_Bool _eo_call_resolve(const char *func_name, const Eo_Op op, Eo_Op_Call_Data *call, const char *file, int line);
542 541
543// start of eo_do barrier, gets the object pointer and ref it, put it on the stask 542// start of eo_do barrier, gets the object pointer and ref it, put it on the stask
544 EAPI Eina_Bool _eo_do_start(const Eo *obj, const Eo_Class *cur_klass, Eina_Bool is_super, const char *file, const char *func, int line); 543 EAPI Eina_Bool _eo_do_start(const Eo *obj, const Eo_Class *cur_klass, Eina_Bool is_super, const char *file, const char *func, int line);
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index 8006318..5f56dfa 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -491,10 +491,9 @@ _eo_do_internal(const Eo *eo_id, const Eo_Class *cur_klass_id,
491EAPI Eina_Bool 491EAPI Eina_Bool
492_eo_do_start(const Eo *eo_id, const Eo_Class *cur_klass_id, Eina_Bool is_super, const char *file EINA_UNUSED, const char *func EINA_UNUSED, int line EINA_UNUSED) 492_eo_do_start(const Eo *eo_id, const Eo_Class *cur_klass_id, Eina_Bool is_super, const char *file EINA_UNUSED, const char *func EINA_UNUSED, int line EINA_UNUSED)
493{ 493{
494 Eina_Bool is_main_loop = eina_main_loop_is();
495 Eina_Bool ret = EINA_TRUE; 494 Eina_Bool ret = EINA_TRUE;
496 Eo_Stack_Frame *fptr, *pfptr; 495 Eo_Stack_Frame *fptr, *pfptr;
497 Eo_Call_Stack *stack = _eo_call_stack_get(is_main_loop); 496 Eo_Call_Stack *stack = _eo_call_stack_get(eina_main_loop_is());
498 497
499 if (stack->frame_ptr == stack->last_frame) 498 if (stack->frame_ptr == stack->last_frame)
500 _eo_call_stack_resize(stack, EINA_TRUE); 499 _eo_call_stack_resize(stack, EINA_TRUE);
@@ -543,14 +542,14 @@ _eo_do_end(void)
543} 542}
544 543
545EAPI Eina_Bool 544EAPI Eina_Bool
546_eo_call_resolve(const char *func_name, const Eo_Op op, Eo_Op_Call_Data *call, Eina_Bool is_main_loop, const char *file, int line) 545_eo_call_resolve(const char *func_name, const Eo_Op op, Eo_Op_Call_Data *call, const char *file, int line)
547{ 546{
548 Eo_Stack_Frame *fptr; 547 Eo_Stack_Frame *fptr;
549 const _Eo_Class *klass; 548 const _Eo_Class *klass;
550 const op_type_funcs *func; 549 const op_type_funcs *func;
551 Eina_Bool is_obj; 550 Eina_Bool is_obj;
552 551
553 fptr = _eo_call_stack_get(is_main_loop)->frame_ptr; 552 fptr = _eo_call_stack_get(eina_main_loop_is())->frame_ptr;
554 553
555 if (EINA_UNLIKELY(!fptr->o.obj)) 554 if (EINA_UNLIKELY(!fptr->o.obj))
556 return EINA_FALSE; 555 return EINA_FALSE;