summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Aguirre <aguirre.nicolas@gmail.com>2013-12-10 20:23:28 +0100
committerCedric BAIL <c.bail@partner.samsung.com>2014-06-18 11:34:06 +0200
commit5885bfcb2e0acf81c3c905ebdb30ab48211ac950 (patch)
tree154c56c3c151927d624db3e469fe05bf5ca58427
parentb24e462ef68b62a1ce4075a00587adf882e3b506 (diff)
ecore_evas: use Eina_List to store Ecore_Evases and return the first one when asked for a match.
-rw-r--r--src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c b/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
index 88e3ba105f..1ae81993e3 100644
--- a/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
+++ b/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
@@ -97,7 +97,7 @@ static Ecore_Evas *
97_ecore_evas_cocoa_match(void) 97_ecore_evas_cocoa_match(void)
98{ 98{
99 DBG("Match"); 99 DBG("Match");
100 return ecore_evases; 100 return eina_list_nth(ecore_evases, 0);
101} 101}
102 102
103static int 103static int
@@ -174,12 +174,13 @@ static int
174_ecore_evas_idle_enter(void *data EINA_UNUSED) 174_ecore_evas_idle_enter(void *data EINA_UNUSED)
175{ 175{
176 Ecore_Evas *ee; 176 Ecore_Evas *ee;
177 Eina_List *l;
177 double t1 = 0.; 178 double t1 = 0.;
178 double t2 = 0.; 179 double t2 = 0.;
179 180
180 DBG("Idle enter"); 181 DBG("Idle enter");
181 182
182 EINA_INLIST_FOREACH(ecore_evases, ee) 183 EINA_LIST_FOREACH(ecore_evases, l, ee)
183 { 184 {
184 if (ee->visible) 185 if (ee->visible)
185 evas_render(ee->evas); 186 evas_render(ee->evas);
@@ -220,13 +221,15 @@ _ecore_evas_cocoa_init(void)
220static int 221static int
221_ecore_evas_cocoa_shutdown(void) 222_ecore_evas_cocoa_shutdown(void)
222{ 223{
224 Ecore_Evas *ee;
223 DBG("Cocoa SHutodwn"); 225 DBG("Cocoa SHutodwn");
224 _ecore_evas_init_count--; 226 _ecore_evas_init_count--;
225 if (_ecore_evas_init_count == 0) 227 if (_ecore_evas_init_count == 0)
226 { 228 {
227 int i; 229 int i;
228 230
229 while (ecore_evases) _ecore_evas_free(ecore_evases); 231 EINA_LIST_FREE(ecore_evases, ee)
232 _ecore_evas_free(ee);
230 233
231 for (i = 0; i < sizeof (ecore_evas_event_handlers) / sizeof (Ecore_Event_Handler*); i++) 234 for (i = 0; i < sizeof (ecore_evas_event_handlers) / sizeof (Ecore_Event_Handler*); i++)
232 ecore_event_handler_del(ecore_evas_event_handlers[i]); 235 ecore_event_handler_del(ecore_evas_event_handlers[i]);
@@ -246,7 +249,7 @@ static void
246_ecore_evas_cocoa_free(Ecore_Evas *ee) 249_ecore_evas_cocoa_free(Ecore_Evas *ee)
247{ 250{
248 DBG("Cocoa Free"); 251 DBG("Cocoa Free");
249 ecore_evases = (Ecore_Evas *) eina_inlist_remove(EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee)); 252 ecore_evases = eina_list_remove(ecore_evases, ee);
250 ecore_event_window_unregister(0); 253 ecore_event_window_unregister(0);
251 _ecore_evas_cocoa_shutdown(); 254 _ecore_evas_cocoa_shutdown();
252 ecore_cocoa_shutdown(); 255 ecore_cocoa_shutdown();
@@ -576,6 +579,9 @@ ecore_evas_cocoa_new_internal(Ecore_Cocoa_Window *parent, int x, int y, int w, i
576 579
577 evas_event_feed_mouse_in(ee->evas, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL); 580 evas_event_feed_mouse_in(ee->evas, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL);
578 printf("Ecore Evas returned : %p\n", ee); 581 printf("Ecore Evas returned : %p\n", ee);
582
583 ecore_evases = eina_list_append(ecore_evases, ee);
584
579 return ee; 585 return ee;
580 586
581 free_window: 587 free_window: