summaryrefslogtreecommitdiff
path: root/src/lib/ecore
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-05-02 16:47:16 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-05-02 16:47:16 +0900
commitf8c9a8d16708ac52195a8df70493a1fc91872348 (patch)
treec78586a9c486bf2468ac4645521ba24a79c3df09 /src/lib/ecore
parentb64a2994b3b277cbe7fce17d7ee275fd0d78c925 (diff)
revert the revert... damn you git!
Revert "Revert "Efl: replace eo_data_get for objects data referencing."" This reverts commit b64a2994b3b277cbe7fce17d7ee275fd0d78c925.
Diffstat (limited to 'src/lib/ecore')
-rw-r--r--src/lib/ecore/ecore_anim.c4
-rw-r--r--src/lib/ecore/ecore_idle_enterer.c2
-rw-r--r--src/lib/ecore/ecore_idle_exiter.c2
-rw-r--r--src/lib/ecore/ecore_idler.c2
-rw-r--r--src/lib/ecore/ecore_job.c2
-rw-r--r--src/lib/ecore/ecore_poll.c2
-rw-r--r--src/lib/ecore/ecore_timer.c19
7 files changed, 20 insertions, 13 deletions
diff --git a/src/lib/ecore/ecore_anim.c b/src/lib/ecore/ecore_anim.c
index a3797f08b4..39cc560a5e 100644
--- a/src/lib/ecore/ecore_anim.c
+++ b/src/lib/ecore/ecore_anim.c
@@ -400,7 +400,7 @@ ecore_animator_del(Ecore_Animator *obj)
400 400
401 if (!obj) return NULL; 401 if (!obj) return NULL;
402 EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL); 402 EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
403 Ecore_Animator_Private_Data *animator = eo_data_get(obj, MY_CLASS); 403 Ecore_Animator_Private_Data *animator = eo_data_scope_get(obj, MY_CLASS);
404 _ecore_lock(); 404 _ecore_lock();
405 405
406 if (!animator) goto unlock; 406 if (!animator) goto unlock;
@@ -570,7 +570,7 @@ static Eina_Bool
570_ecore_animator_run(void *data) 570_ecore_animator_run(void *data)
571{ 571{
572 Ecore_Animator *obj = data; 572 Ecore_Animator *obj = data;
573 Ecore_Animator_Private_Data *animator = eo_data_get(obj, MY_CLASS); 573 Ecore_Animator_Private_Data *animator = eo_data_scope_get(obj, MY_CLASS);
574 574
575 double pos = 0.0, t; 575 double pos = 0.0, t;
576 Eina_Bool run_ret; 576 Eina_Bool run_ret;
diff --git a/src/lib/ecore/ecore_idle_enterer.c b/src/lib/ecore/ecore_idle_enterer.c
index 36ab9a6aca..d5753ae2a5 100644
--- a/src/lib/ecore/ecore_idle_enterer.c
+++ b/src/lib/ecore/ecore_idle_enterer.c
@@ -174,7 +174,7 @@ ecore_idle_enterer_del(Ecore_Idle_Enterer *idle_enterer)
174static void * 174static void *
175_ecore_idle_enterer_del(Ecore_Idle_Enterer *obj) 175_ecore_idle_enterer_del(Ecore_Idle_Enterer *obj)
176{ 176{
177 Ecore_Idle_Enterer_Private_Data *idle_enterer = eo_data_get(obj, MY_CLASS); 177 Ecore_Idle_Enterer_Private_Data *idle_enterer = eo_data_scope_get(obj, MY_CLASS);
178 178
179 if (!idle_enterer) return NULL; 179 if (!idle_enterer) return NULL;
180 EINA_SAFETY_ON_TRUE_RETURN_VAL(idle_enterer->delete_me, NULL); 180 EINA_SAFETY_ON_TRUE_RETURN_VAL(idle_enterer->delete_me, NULL);
diff --git a/src/lib/ecore/ecore_idle_exiter.c b/src/lib/ecore/ecore_idle_exiter.c
index fa93d1ca2e..cf76275027 100644
--- a/src/lib/ecore/ecore_idle_exiter.c
+++ b/src/lib/ecore/ecore_idle_exiter.c
@@ -125,7 +125,7 @@ ecore_idle_exiter_del(Ecore_Idle_Exiter *idle_exiter)
125static void * 125static void *
126_ecore_idle_exiter_del(Ecore_Idle_Exiter *obj) 126_ecore_idle_exiter_del(Ecore_Idle_Exiter *obj)
127{ 127{
128 Ecore_Idle_Exiter_Private_Data *idle_exiter = eo_data_get(obj, MY_CLASS); 128 Ecore_Idle_Exiter_Private_Data *idle_exiter = eo_data_scope_get(obj, MY_CLASS);
129 EINA_SAFETY_ON_TRUE_RETURN_VAL(idle_exiter->delete_me, NULL); 129 EINA_SAFETY_ON_TRUE_RETURN_VAL(idle_exiter->delete_me, NULL);
130 idle_exiter->delete_me = 1; 130 idle_exiter->delete_me = 1;
131 idle_exiters_delete_me = 1; 131 idle_exiters_delete_me = 1;
diff --git a/src/lib/ecore/ecore_idler.c b/src/lib/ecore/ecore_idler.c
index 0094e238e6..0495b4edfa 100644
--- a/src/lib/ecore/ecore_idler.c
+++ b/src/lib/ecore/ecore_idler.c
@@ -111,7 +111,7 @@ ecore_idler_del(Ecore_Idler *idler)
111static void * 111static void *
112_ecore_idler_del(Ecore_Idler *obj) 112_ecore_idler_del(Ecore_Idler *obj)
113{ 113{
114 Ecore_Idler_Private_Data *idler = eo_data_get(obj, MY_CLASS); 114 Ecore_Idler_Private_Data *idler = eo_data_scope_get(obj, MY_CLASS);
115 EINA_SAFETY_ON_TRUE_RETURN_VAL(idler->delete_me, NULL); 115 EINA_SAFETY_ON_TRUE_RETURN_VAL(idler->delete_me, NULL);
116 idler->delete_me = 1; 116 idler->delete_me = 1;
117 idlers_delete_me = 1; 117 idlers_delete_me = 1;
diff --git a/src/lib/ecore/ecore_job.c b/src/lib/ecore/ecore_job.c
index e057af00e2..cfdb1d1891 100644
--- a/src/lib/ecore/ecore_job.c
+++ b/src/lib/ecore/ecore_job.c
@@ -124,7 +124,7 @@ ecore_job_del(Ecore_Job *obj)
124 124
125 if (!obj) return NULL; 125 if (!obj) return NULL;
126 EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL); 126 EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
127 Ecore_Job_Private_Data *job = eo_data_get(obj, MY_CLASS); 127 Ecore_Job_Private_Data *job = eo_data_scope_get(obj, MY_CLASS);
128 data = job->data; 128 data = job->data;
129 ecore_event_del(job->event); 129 ecore_event_del(job->event);
130 eo_parent_set(obj, NULL); 130 eo_parent_set(obj, NULL);
diff --git a/src/lib/ecore/ecore_poll.c b/src/lib/ecore/ecore_poll.c
index 9057d992a7..886e6531cf 100644
--- a/src/lib/ecore/ecore_poll.c
+++ b/src/lib/ecore/ecore_poll.c
@@ -394,7 +394,7 @@ ecore_poller_del(Ecore_Poller *obj)
394 394
395 if (!obj) return NULL; 395 if (!obj) return NULL;
396 EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL); 396 EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
397 Ecore_Poller_Private_Data *poller = eo_data_get(obj, MY_CLASS); 397 Ecore_Poller_Private_Data *poller = eo_data_scope_get(obj, MY_CLASS);
398 /* we are walking the poller list - a bad idea to remove from it while 398 /* we are walking the poller list - a bad idea to remove from it while
399 * walking it, so just flag it as delete_me and come back to it after 399 * walking it, so just flag it as delete_me and come back to it after
400 * the loop has finished */ 400 * the loop has finished */
diff --git a/src/lib/ecore/ecore_timer.c b/src/lib/ecore/ecore_timer.c
index 2ecd67af7e..08396d6ae0 100644
--- a/src/lib/ecore/ecore_timer.c
+++ b/src/lib/ecore/ecore_timer.c
@@ -603,7 +603,7 @@ EAPI void
603_ecore_timer_delay(Ecore_Timer *obj, 603_ecore_timer_delay(Ecore_Timer *obj,
604 double add) 604 double add)
605{ 605{
606 Ecore_Timer_Private_Data *timer = eo_data_get(obj, MY_CLASS); 606 Ecore_Timer_Private_Data *timer = eo_data_scope_get(obj, MY_CLASS);
607 607
608 if (timer->frozen) 608 if (timer->frozen)
609 { 609 {
@@ -612,6 +612,7 @@ _ecore_timer_delay(Ecore_Timer *obj,
612 else 612 else
613 { 613 {
614 timers = (Ecore_Timer_Private_Data *)eina_inlist_remove(EINA_INLIST_GET(timers), EINA_INLIST_GET(timer)); 614 timers = (Ecore_Timer_Private_Data *)eina_inlist_remove(EINA_INLIST_GET(timers), EINA_INLIST_GET(timer));
615 eo_data_unref(obj, timer);
615 _ecore_timer_set(obj, timer->at + add, timer->in, timer->func, timer->data); 616 _ecore_timer_set(obj, timer->at + add, timer->in, timer->func, timer->data);
616 } 617 }
617} 618}
@@ -619,12 +620,13 @@ _ecore_timer_delay(Ecore_Timer *obj,
619void * 620void *
620_ecore_timer_del(Ecore_Timer *obj) 621_ecore_timer_del(Ecore_Timer *obj)
621{ 622{
622 Ecore_Timer_Private_Data *timer = eo_data_get(obj, MY_CLASS); 623 Ecore_Timer_Private_Data *timer = eo_data_scope_get(obj, MY_CLASS);
623 624
624 if (timer->frozen && !timer->references) 625 if (timer->frozen && !timer->references)
625 { 626 {
626 void *data = timer->data; 627 void *data = timer->data;
627 628
629 eo_data_unref(obj, timer);
628 suspended = (Ecore_Timer_Private_Data *)eina_inlist_remove(EINA_INLIST_GET(suspended), EINA_INLIST_GET(timer)); 630 suspended = (Ecore_Timer_Private_Data *)eina_inlist_remove(EINA_INLIST_GET(suspended), EINA_INLIST_GET(timer));
629 631
630 if (timer->delete_me) 632 if (timer->delete_me)
@@ -668,6 +670,7 @@ _ecore_timer_shutdown(void)
668 { 670 {
669 timers = (Ecore_Timer_Private_Data *)eina_inlist_remove(EINA_INLIST_GET(timers), EINA_INLIST_GET(timers)); 671 timers = (Ecore_Timer_Private_Data *)eina_inlist_remove(EINA_INLIST_GET(timers), EINA_INLIST_GET(timers));
670 672
673 eo_data_unref(timer->obj, timer);
671 eo_parent_set(timer->obj, NULL); 674 eo_parent_set(timer->obj, NULL);
672 if (eo_destructed_is(timer->obj)) 675 if (eo_destructed_is(timer->obj))
673 eo_manual_free(timer->obj); 676 eo_manual_free(timer->obj);
@@ -679,6 +682,7 @@ _ecore_timer_shutdown(void)
679 { 682 {
680 suspended = (Ecore_Timer_Private_Data *)eina_inlist_remove(EINA_INLIST_GET(suspended), EINA_INLIST_GET(suspended)); 683 suspended = (Ecore_Timer_Private_Data *)eina_inlist_remove(EINA_INLIST_GET(suspended), EINA_INLIST_GET(suspended));
681 684
685 eo_data_unref(timer->obj, timer);
682 eo_parent_set(timer->obj, NULL); 686 eo_parent_set(timer->obj, NULL);
683 if (eo_destructed_is(timer->obj)) 687 if (eo_destructed_is(timer->obj))
684 eo_manual_free(timer->obj); 688 eo_manual_free(timer->obj);
@@ -710,6 +714,7 @@ _ecore_timer_cleanup(void)
710 } 714 }
711 timers = (Ecore_Timer_Private_Data *)eina_inlist_remove(EINA_INLIST_GET(timers), EINA_INLIST_GET(timer)); 715 timers = (Ecore_Timer_Private_Data *)eina_inlist_remove(EINA_INLIST_GET(timers), EINA_INLIST_GET(timer));
712 716
717 eo_data_unref(timer->obj, timer);
713 eo_parent_set(timer->obj, NULL); 718 eo_parent_set(timer->obj, NULL);
714 if (eo_destructed_is(timer->obj)) 719 if (eo_destructed_is(timer->obj))
715 eo_manual_free(timer->obj); 720 eo_manual_free(timer->obj);
@@ -734,6 +739,7 @@ _ecore_timer_cleanup(void)
734 } 739 }
735 suspended = (Ecore_Timer_Private_Data *)eina_inlist_remove(EINA_INLIST_GET(suspended), EINA_INLIST_GET(timer)); 740 suspended = (Ecore_Timer_Private_Data *)eina_inlist_remove(EINA_INLIST_GET(suspended), EINA_INLIST_GET(timer));
736 741
742 eo_data_unref(timer->obj, timer);
737 eo_parent_set(timer->obj, NULL); 743 eo_parent_set(timer->obj, NULL);
738 if (eo_destructed_is(timer->obj)) 744 if (eo_destructed_is(timer->obj))
739 eo_manual_free(timer->obj); 745 eo_manual_free(timer->obj);
@@ -794,7 +800,7 @@ static inline Ecore_Timer *
794_ecore_timer_after_get(Ecore_Timer *obj) 800_ecore_timer_after_get(Ecore_Timer *obj)
795{ 801{
796 Ecore_Timer *ret = NULL; 802 Ecore_Timer *ret = NULL;
797 Ecore_Timer_Private_Data *base = eo_data_get(obj, MY_CLASS); 803 Ecore_Timer_Private_Data *base = eo_data_scope_get(obj, MY_CLASS);
798 804
799 Ecore_Timer_Private_Data *timer = (Ecore_Timer_Private_Data *)EINA_INLIST_GET(base)->next; 805 Ecore_Timer_Private_Data *timer = (Ecore_Timer_Private_Data *)EINA_INLIST_GET(base)->next;
800 Ecore_Timer_Private_Data *valid_timer = NULL; 806 Ecore_Timer_Private_Data *valid_timer = NULL;
@@ -826,7 +832,7 @@ _ecore_timer_next_get(void)
826 second_obj = _ecore_timer_after_get(first_obj); 832 second_obj = _ecore_timer_after_get(first_obj);
827 if (second_obj) first_obj = second_obj; 833 if (second_obj) first_obj = second_obj;
828 834
829 first = eo_data_get(first_obj, MY_CLASS); 835 first = eo_data_scope_get(first_obj, MY_CLASS);
830 836
831 now = ecore_loop_time_get(); 837 now = ecore_loop_time_get();
832 in = first->at - now; 838 in = first->at - now;
@@ -838,10 +844,11 @@ static inline void
838_ecore_timer_reschedule(Ecore_Timer *obj, 844_ecore_timer_reschedule(Ecore_Timer *obj,
839 double when) 845 double when)
840{ 846{
841 Ecore_Timer_Private_Data *timer = eo_data_get(obj, MY_CLASS); 847 Ecore_Timer_Private_Data *timer = eo_data_scope_get(obj, MY_CLASS);
842 if ((timer->delete_me) || (timer->frozen)) return; 848 if ((timer->delete_me) || (timer->frozen)) return;
843 849
844 timers = (Ecore_Timer_Private_Data *)eina_inlist_remove(EINA_INLIST_GET(timers), EINA_INLIST_GET(timer)); 850 timers = (Ecore_Timer_Private_Data *)eina_inlist_remove(EINA_INLIST_GET(timers), EINA_INLIST_GET(timer));
851 eo_data_unref(obj, timer);
845 852
846 /* if the timer would have gone off more than 15 seconds ago, 853 /* if the timer would have gone off more than 15 seconds ago,
847 * assume that the system hung and set the timer to go off 854 * assume that the system hung and set the timer to go off
@@ -932,7 +939,7 @@ _ecore_timer_set(Ecore_Timer *obj,
932{ 939{
933 Ecore_Timer_Private_Data *t2; 940 Ecore_Timer_Private_Data *t2;
934 941
935 Ecore_Timer_Private_Data *timer = eo_data_get(obj, MY_CLASS); 942 Ecore_Timer_Private_Data *timer = eo_data_ref(obj, MY_CLASS);
936 943
937 timers_added = 1; 944 timers_added = 1;
938 timer->at = at; 945 timer->at = at;