* ecore: Remove Ecore_List2 from ecore_evas.
authorcedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 17 Jun 2009 11:42:02 +0000 (11:42 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 17 Jun 2009 11:42:02 +0000 (11:42 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@41073 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/ecore_evas/ecore_evas_buffer.c
src/lib/ecore_evas/ecore_evas_directfb.c
src/lib/ecore_evas/ecore_evas_fb.c
src/lib/ecore_evas/ecore_evas_private.h
src/lib/ecore_evas/ecore_evas_quartz.c
src/lib/ecore_evas/ecore_evas_sdl.c
src/lib/ecore_evas/ecore_evas_win32.c
src/lib/ecore_evas/ecore_evas_wince.c
src/lib/ecore_evas/ecore_evas_x.c

index dd43569..b0fb4b7 100644 (file)
@@ -29,7 +29,7 @@ _ecore_evas_buffer_init(void)
 static void
 _ecore_evas_buffer_free(Ecore_Evas *ee)
 {
-   ecore_evases = _ecore_list2_remove(ecore_evases, ee);
+   ecore_evases = (Ecore_Evas *) eina_inlist_remove(EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee));
    _ecore_evas_buffer_shutdown();
    if (ee->engine.buffer.image)
      {
@@ -90,7 +90,7 @@ _ecore_evas_buffer_shutdown(void)
      {
        while (ecore_evases)
          {
-            _ecore_evas_free((Ecore_Evas *)ecore_evases);
+            _ecore_evas_free(ecore_evases);
          }
        if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_shutdown();
      }
@@ -496,7 +496,7 @@ ecore_evas_buffer_new(int w, int h)
 
    evas_event_feed_mouse_in(ee->evas, 0, NULL);
 
-   ecore_evases = _ecore_list2_prepend(ecore_evases, ee);
+   ecore_evases = (Ecore_Evas *) eina_inlist_prepend(EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee));
    return ee;
 #else
    return NULL;
index 82d0ee4..00ef8bc 100644 (file)
@@ -54,7 +54,7 @@ _ecore_evas_directfb_render(Ecore_Evas *ee)
 static int
 _ecore_evas_directfb_idle_enter(void *data __UNUSED__)
 {
-   Ecore_List2 *l;
+   Ecore_Evas *l;
    double t1 = 0.0;
    double t2 = 0.0;
 
@@ -63,13 +63,8 @@ _ecore_evas_directfb_idle_enter(void *data __UNUSED__)
      {
        t1 = ecore_time_get();
      }
-   for (l = (Ecore_List2 *)ecore_evases; l; l = l->next)
-     {
-       Ecore_Evas *ee;
-
-       ee = (Ecore_Evas *)l;
+   EINA_INLIST_FOREACH(ecore_evases, l)
        _ecore_evas_directfb_render(ee);
-     }
    if (_ecore_evas_fps_debug)
      {
        t2 = ecore_time_get();
@@ -312,7 +307,7 @@ _ecore_evas_directfb_free(Ecore_Evas *ee)
 {
    eina_hash_del(ecore_evases_hash, _ecore_evas_directfb_winid_str_get(ee->engine.directfb.window->id), ee);
    ecore_directfb_window_free(ee->engine.directfb.window);
-   ecore_evases = _ecore_list2_remove(ecore_evases, ee);
+   ecore_evases = (Ecore_Evas *) eina_inlist_remove(EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee));
    _ecore_evas_directfb_shutdown();
    ecore_directfb_shutdown();
 }
@@ -577,7 +572,7 @@ ecore_evas_directfb_new(const char *disp_name, int windowed, int x, int y, int w
        einfo->info.surface = window->surface;
        evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
      }
-   ecore_evases = _ecore_list2_prepend(ecore_evases, ee);
+   ecore_evases = (Ecore_Evas *) eina_inlist_prepend(EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee));
    if (!ecore_evases_hash)
      ecore_evases_hash = eina_hash_string_superfast_new(NULL);
    eina_hash_add(ecore_evases_hash, _ecore_evas_directfb_winid_str_get(ee->engine.directfb.window->id), ee);
index 8a712c9..561ff2f 100644 (file)
@@ -76,17 +76,12 @@ _ecore_evas_fb_match(void)
 static void
 _ecore_evas_fb_lose(void *data __UNUSED__)
 {
-   Ecore_List2 *l;
+   Ecore_Evas *ee;
    Eina_List *ll;
    Ecore_Fb_Input_Device *dev;
 
-   for (l = (Ecore_List2 *)ecore_evases; l; l = l->next)
-     {
-       Ecore_Evas *ee;
-
-       ee = (Ecore_Evas *)l;
+   EINA_INLIST_FOREACH(ecore_evases, ee)
        ee->visible = 0;
-     }
 
    EINA_LIST_FOREACH(ecore_evas_input_devices, ll, dev)
      ecore_fb_input_device_listen(dev, 0);
@@ -95,15 +90,12 @@ _ecore_evas_fb_lose(void *data __UNUSED__)
 static void
 _ecore_evas_fb_gain(void *data __UNUSED__)
 {
-   Ecore_List2 *l;
+   Ecore_Evas *ee;
    Eina_List *ll;
    Ecore_Fb_Input_Device *dev;
 
-   for (l = (Ecore_List2 *)ecore_evases; l; l = l->next)
+   EINA_INLIST_FOREACH(ecore_evases,ee)
      {
-       Ecore_Evas *ee;
-
-       ee = (Ecore_Evas *)l;
        ee->visible = 1;
        if ((ee->rotation == 90) || (ee->rotation == 270))
          evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
@@ -201,7 +193,7 @@ _ecore_evas_event_mouse_wheel(void *data __UNUSED__, int type __UNUSED__, void *
 static int
 _ecore_evas_idle_enter(void *data __UNUSED__)
 {
-   Ecore_List2 *l;
+   Ecore_Evas *ee;
    double t1 = 0.0;
    double t2 = 0.0;
 
@@ -210,11 +202,8 @@ _ecore_evas_idle_enter(void *data __UNUSED__)
      {
        t1 = ecore_time_get();
      }
-   for (l = (Ecore_List2 *)ecore_evases; l; l = l->next)
+   EINA_INLIST_FOREACH(ecore_evases, ee)
      {
-       Ecore_Evas *ee;
-
-       ee = (Ecore_Evas *)l;
        if (ee->visible)
          {
             Eina_List *updates;
@@ -333,7 +322,7 @@ _ecore_evas_fb_init(int w, int h)
 static void
 _ecore_evas_fb_free(Ecore_Evas *ee)
 {
-   ecore_evases = _ecore_list2_remove(ecore_evases, ee);
+   ecore_evases = (Ecore_Evas *) eina_inlist_remove(EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee));
    _ecore_evas_fb_shutdown();
    ecore_fb_shutdown();
 }
@@ -685,7 +674,7 @@ ecore_evas_fb_new(const char *disp_name, int rotation, int w, int h)
 
    evas_event_feed_mouse_in(ee->evas, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL);
 
-   ecore_evases = _ecore_list2_prepend(ecore_evases, ee);
+   ecore_evases = (Ecore_Evas *) eina_inlist_prepend(EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee));
    return ee;
 }
 #else
index f2c9e6f..8c3f3f8 100644 (file)
@@ -222,7 +222,7 @@ struct _Ecore_Evas_Engine
 
 struct _Ecore_Evas
 {
-   Ecore_List  __list_data;
+   EINA_INLIST;
    ECORE_MAGIC;
    Evas       *evas;
    const char *driver;
index 07231f4..d669975 100644 (file)
@@ -56,13 +56,10 @@ static NSWindow * main_window;
 {
    if(ctx != NULL)
    {
-      Ecore_List2  *l;
+      Ecore_evas  *ee;
 
-      for (l = (Ecore_List2 *)ecore_evases; l; l = l->next)
+      EINA_INLIST_FOREACH(ecore_evases, l)
       {
-         Ecore_Evas *ee;
-
-         ee = (Ecore_Evas *)l;
          if (ee->visible)
             evas_damage_rectangle_add(ee->evas, 0, 0, 400, 400);
       }
@@ -146,14 +143,12 @@ _ecore_evas_quartz_event_video_expose(void *data __UNUSED__, int type __UNUSED__
 static int
 _ecore_evas_idle_enter(void *data __UNUSED__)
 {
-   Ecore_List2  *l;
+   Ecore_Evas  *l;
    double       t1 = 0.;
    double       t2 = 0.;
 
-   for (l = (Ecore_List2 *)ecore_evases; l; l = l->next)
+   EINA_INLIST_FOREACH(ecore_evases, l)
    {
-      Ecore_Evas *ee = (Ecore_Evas *)l;
-
       if (ee->visible)
          evas_render(ee->evas);
       else
@@ -214,7 +209,7 @@ _ecore_evas_quartz_shutdown(void)
 static void
 _ecore_evas_quartz_free(Ecore_Evas *ee)
 {
-   ecore_evases = _ecore_list2_remove(ecore_evases, ee);
+   ecore_evases = (Ecore_Evas *) eina_inlist_remove(EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee));
    ecore_event_window_unregister(0);
    _ecore_evas_quartz_shutdown();
    ecore_quartz_shutdown();
@@ -435,7 +430,7 @@ ecore_evas_quartz_new(const char* name, int w, int h)
 
    evas_event_feed_mouse_in(ee->evas, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL);
 
-   ecore_evases = _ecore_list2_prepend(ecore_evases, ee);
+   ecore_evases = (Ecore_Evas *) eina_inlist_prepend(EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee));
    return ee;
 
  free_window:
index 40adc6b..e45216e 100644 (file)
@@ -115,7 +115,7 @@ _ecore_evas_render(Ecore_Evas *ee)
 static int
 _ecore_evas_idle_enter(void *data __UNUSED__)
 {
-   Ecore_List2  *l;
+   Ecore_Evas  *ee;
    double       t1 = 0.0;
    double       t2 = 0.0;
 
@@ -126,17 +126,12 @@ _ecore_evas_idle_enter(void *data __UNUSED__)
        t1 = ecore_time_get();
      }
 #endif /* _WIN32 */
-   for (l = (Ecore_List2 *)ecore_evases; l; l = l->next)
+   EINA_INLIST_FOREACH(ecore_evases, ee)
      {
-       Ecore_Evas *ee;
 #ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
        Eina_List *ll;
        Ecore_Evas *ee2;
-#endif
-
-       ee = (Ecore_Evas *)l;
 
-#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
        EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2)
          {
             if (ee2->func.fn_pre_render) ee2->func.fn_pre_render(ee2);
@@ -229,7 +224,7 @@ _ecore_evas_sdl_shutdown(void)
 static void
 _ecore_evas_sdl_free(Ecore_Evas *ee)
 {
-   ecore_evases = _ecore_list2_remove(ecore_evases, ee);
+   ecore_evases = (Ecore_Evas *) eina_inlist_remove(EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee));
    ecore_event_window_unregister(0);
    _ecore_evas_sdl_shutdown();
    ecore_sdl_shutdown();
@@ -422,13 +417,13 @@ _ecore_evas_internal_sdl_new(int rmethod, const char* name, int w, int h, int fu
 
    _ecore_evas_sdl_init(w, h);
 
-   ecore_event_window_register(0, ee, ee->evas, _ecore_evas_mouse_move_process);
+   ecore_event_window_register(0, ee, ee->evas, (Ecore_Event_Mouse_Move_Cb) _ecore_evas_mouse_move_process);
 
    evas_event_feed_mouse_in(ee->evas, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL);
 
    SDL_ShowCursor(SDL_DISABLE);
 
-   ecore_evases = _ecore_list2_prepend(ecore_evases, ee);
+   ecore_evases = (Ecore_Evas *) eina_inlist_prepend(EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee));
    return ee;
 }
 #endif
index 3497948..523db7b 100644 (file)
@@ -95,7 +95,7 @@ _ecore_evas_win32_render(Ecore_Evas *ee)
 static int
 _ecore_evas_win32_idle_enter(void *data __UNUSED__)
 {
-   Ecore_List2 *l;
+   Ecore_Evas *ee;
    double       t1 = 0.0;
    double       t2 = 0.0;
 
@@ -104,14 +104,10 @@ _ecore_evas_win32_idle_enter(void *data __UNUSED__)
      {
         t1 = ecore_time_get();
      }
-   for (l = (Ecore_List2 *)ecore_evases; l; l = l->next)
-     {
-        Ecore_Evas *ee;
-
-        ee = (Ecore_Evas *)l;
+   EINA_INLIST_FOREACH(ecore_evases, l)
         _ecore_evas_win32_render(ee);
-     }
-/*    ecore_x_flush(); */
+
+   /*    ecore_x_flush(); */
    if (_ecore_evas_fps_debug)
      {
         t2 = ecore_time_get();
@@ -406,7 +402,7 @@ _ecore_evas_win32_free(Ecore_Evas *ee)
 
    ecore_win32_window_free(ee->prop.window);
    ecore_event_window_unregister(ee->prop.window);
-   ecore_evases = _ecore_list2_remove(ecore_evases, ee);
+   ecore_evases = (Ecore_Evas *) eina_inlist_remove(EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee));
    _ecore_evas_win32_shutdown();
    ecore_win32_shutdown();
 }
@@ -1098,7 +1094,7 @@ _ecore_evas_win32_new_internal(int (*_ecore_evas_engine_init)(Ecore_Evas *ee),
         return NULL;
      }
 
-   ecore_evases = _ecore_list2_prepend(ecore_evases, ee);
+   ecore_evases = (Ecore_Evas *) eina_inlist_prepend(EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee));
    ecore_event_window_register(ee->prop.window, ee, ee->evas, _ecore_evas_mouse_move_process);
 
    return ee;
index 66d6a60..da3b5c1 100644 (file)
@@ -93,7 +93,7 @@ _ecore_evas_wince_render(Ecore_Evas *ee)
 static int
 _ecore_evas_wince_idle_enter(void *data __UNUSED__)
 {
-   Ecore_List2 *l;
+   Ecore_Evas *ee;
    double       t1 = 0.0;
    double       t2 = 0.0;
 
@@ -102,13 +102,9 @@ _ecore_evas_wince_idle_enter(void *data __UNUSED__)
      {
        t1 = ecore_time_get();
      }
-   for (l = (Ecore_List2 *)ecore_evases; l; l = l->next)
-     {
-       Ecore_Evas *ee;
-
-       ee = (Ecore_Evas *)l;
+   EINA_INLIST_FOREACH(ecore_evases, l)
        _ecore_evas_wince_render(ee);
-     }
+
    if (_ecore_evas_fps_debug)
      {
        t2 = ecore_time_get();
@@ -342,7 +338,7 @@ _ecore_evas_wince_free(Ecore_Evas *ee)
 
    ecore_wince_window_free((Ecore_WinCE_Window *)ee->prop.window);
    ecore_event_window_unregister(ee->prop.window);
-   ecore_evases = _ecore_list2_remove(ecore_evases, ee);
+   ecore_evases = (Ecore_Evas *) eina_inlist_remove(EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee));
    _ecore_evas_wince_shutdown();
    ecore_wince_shutdown();
 }
@@ -853,7 +849,7 @@ ecore_evas_software_wince_new_internal(int                 backend,
         ecore_wince_window_resume_set((Ecore_WinCE_Window *)ee->prop.window, einfo->func.resume);
      }
 
-   ecore_evases = _ecore_list2_prepend(ecore_evases, ee);
+   ecore_evases = (Ecore_Evas *) eina_inlist_prepend(EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee));
    ecore_event_window_register(ee->prop.window, ee, ee->evas, (Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process);
 
    return ee;
index 122210c..8413aab 100644 (file)
@@ -995,7 +995,7 @@ _ecore_evas_x_layer_update(Ecore_Evas *ee)
 static int
 _ecore_evas_x_idle_enter(void *data __UNUSED__)
 {
-   Ecore_List2 *l;
+   Ecore_Evas *l;
    double t1 = 0.0;
    double t2 = 0.0;
    int rend = 0;
@@ -1005,13 +1005,8 @@ _ecore_evas_x_idle_enter(void *data __UNUSED__)
      {
        t1 = ecore_time_get();
      }
-   for (l = (Ecore_List2 *)ecore_evases; l; l = l->next)
-     {
-       Ecore_Evas *ee;
-
-       ee = (Ecore_Evas *)l;
-       rend |= _ecore_evas_x_render(ee);
-     }
+   EINA_INLIST_FOREACH(ecore_evases, l)
+       rend |= _ecore_evas_x_render(l);
    ecore_x_flush();
    if (_ecore_evas_fps_debug)
      {
@@ -1068,7 +1063,7 @@ _ecore_evas_x_free(Ecore_Evas *ee)
        ecore_event_window_unregister(*winp);
        free(winp);
      }
-   ecore_evases = _ecore_list2_remove(ecore_evases, ee);
+   ecore_evases = (Ecore_Evas *) eina_inlist_remove(EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee));
    _ecore_evas_x_shutdown();
    ecore_x_shutdown();
 }
@@ -2450,7 +2445,7 @@ ecore_evas_software_x11_new(const char *disp_name, Ecore_X_Window parent,
        evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
      }
 
-   ecore_evases = _ecore_list2_prepend(ecore_evases, ee);
+   ecore_evases = (Ecore_Evas *) eina_inlist_prepend(EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee));
    ecore_event_window_register(ee->prop.window, ee, ee->evas, (Ecore_Event_Mouse_Move_Cb) _ecore_evas_mouse_move_process);
    return ee;
 }
@@ -2634,7 +2629,7 @@ ecore_evas_gl_x11_new(const char *disp_name, Ecore_X_Window parent,
 //     putenv((char*)"DESKTOP_STARTUP_ID=");
      }
 
-   ecore_evases = _ecore_list2_prepend(ecore_evases, ee);
+   ecore_evases = (Ecore_Evas *) eina_inlist_prepend(EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee));
    ecore_event_window_register(ee->prop.window, ee, ee->evas, (Ecore_Event_Mouse_Move_Cb) _ecore_evas_mouse_move_process);
 # endif /* HAVE_ECORE_X_XCB */
 
@@ -2873,7 +2868,7 @@ ecore_evas_xrender_x11_new(const char *disp_name, Ecore_X_Window parent,
        evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
      }
 
-   ecore_evases = _ecore_list2_prepend(ecore_evases, ee);
+   ecore_evases = (Ecore_Evas *) eina_inlist_prepend(EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee));
    ecore_event_window_register(ee->prop.window, ee, ee->evas, (Ecore_Event_Mouse_Move_Cb) _ecore_evas_mouse_move_process);
    return ee;
 }
@@ -3082,7 +3077,7 @@ ecore_evas_software_x11_16_new(const char *disp_name, Ecore_X_Window parent,
        evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
      }
 
-   ecore_evases = _ecore_list2_prepend(ecore_evases, ee);
+   ecore_evases = (Ecore_Evas *) eina_inlist_prepend(EINA_INLIST_GET(ecore_evases), EINA_INLIST_GET(ee));
    ecore_event_window_register(ee->prop.window, ee, ee->evas, (Ecore_Event_Mouse_Move_Cb) _ecore_evas_mouse_move_process);
    return ee;
 }