From 950087f75fe18fc98fc6ebbc79d42e0f375bbaa5 Mon Sep 17 00:00:00 2001 From: cedric Date: Tue, 21 Oct 2008 15:54:55 +0000 Subject: [PATCH] Remove Evas_List from Ecore. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@36941 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/ecore_config/ecore_config.c | 8 ++--- src/lib/ecore_evas/Ecore_Evas.h | 4 +-- src/lib/ecore_evas/ecore_evas.c | 10 +++--- src/lib/ecore_evas/ecore_evas_buffer.c | 25 ++++++-------- src/lib/ecore_evas/ecore_evas_directfb.c | 10 +++--- src/lib/ecore_evas/ecore_evas_fb.c | 11 +++--- src/lib/ecore_evas/ecore_evas_private.h | 4 +-- src/lib/ecore_evas/ecore_evas_sdl.c | 2 +- src/lib/ecore_evas/ecore_evas_win32.c | 15 +++----- src/lib/ecore_evas/ecore_evas_wince.c | 15 +++----- src/lib/ecore_evas/ecore_evas_x.c | 59 +++++++++----------------------- src/lib/ecore_ipc/Ecore_Ipc.h | 20 +++++------ 12 files changed, 67 insertions(+), 116 deletions(-) diff --git a/src/lib/ecore_config/ecore_config.c b/src/lib/ecore_config/ecore_config.c index 275eefd..b6d52ed 100644 --- a/src/lib/ecore_config/ecore_config.c +++ b/src/lib/ecore_config/ecore_config.c @@ -1160,13 +1160,13 @@ ecore_config_struct_create(const char *key) static int _ecore_config_struct_append(Ecore_Config_Prop *sct, Ecore_Config_Prop *add) { - Evas_List *l; + Eina_List *l; if (!sct || !add || sct->type != ECORE_CONFIG_SCT) return ECORE_CONFIG_ERR_IGNORED; l = sct->data; - sct->data = evas_list_append(l, add); + sct->data = eina_list_append(l, add); add->parent = sct; return ECORE_CONFIG_ERR_SUCC; @@ -1301,7 +1301,7 @@ EAPI int ecore_config_struct_get(const char *key, void *data) { Ecore_Config_Prop *e, *f; - Evas_List *l; + Eina_List *l; unsigned char *ptr; long argb; @@ -1347,7 +1347,7 @@ ecore_config_struct_get(const char *key, void *data) default: printf("ARGH - STRUCT coding not implemented yet\n"); } - l = evas_list_next(l); + l = eina_list_next(l); } return ECORE_CONFIG_ERR_SUCC; } diff --git a/src/lib/ecore_evas/Ecore_Evas.h b/src/lib/ecore_evas/Ecore_Evas.h index 97f8e36..60d64a1 100644 --- a/src/lib/ecore_evas/Ecore_Evas.h +++ b/src/lib/ecore_evas/Ecore_Evas.h @@ -122,8 +122,8 @@ EAPI int ecore_evas_engine_type_supported_get(Ecore_Evas_Engine_Type eng EAPI int ecore_evas_init(void); EAPI int ecore_evas_shutdown(void); -EAPI Evas_List *ecore_evas_engines_get(void); -EAPI void ecore_evas_engines_free(Evas_List *engines); +EAPI Eina_List *ecore_evas_engines_get(void); +EAPI void ecore_evas_engines_free(Eina_List *engines); EAPI Ecore_Evas *ecore_evas_new(const char *engine_name, int x, int y, int w, int h, const char *extra_options); diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c index 04aae49..a74b639 100644 --- a/src/lib/ecore_evas/ecore_evas.c +++ b/src/lib/ecore_evas/ecore_evas.c @@ -534,14 +534,14 @@ static const struct ecore_evas_engine _engines[] = { * strings are internal and should be considered constants, do not * free them, to avoid problems use ecore_evas_engines_free() */ -EAPI Evas_List * +EAPI Eina_List * ecore_evas_engines_get(void) { const struct ecore_evas_engine *itr; - Evas_List *lst = NULL; + Eina_List *lst = NULL; for (itr = _engines; itr->name != NULL; itr++) - lst = evas_list_append(lst, itr->name); + lst = eina_list_append(lst, itr->name); return lst; } @@ -550,9 +550,9 @@ ecore_evas_engines_get(void) * Free list returned by ecore_evas_engines_get() */ EAPI void -ecore_evas_engines_free(Evas_List *engines) +ecore_evas_engines_free(Eina_List *engines) { - evas_list_free(engines); + eina_list_free(engines); } static Ecore_Evas * diff --git a/src/lib/ecore_evas/ecore_evas_buffer.c b/src/lib/ecore_evas/ecore_evas_buffer.c index c1df0fe..0af7935 100644 --- a/src/lib/ecore_evas/ecore_evas_buffer.c +++ b/src/lib/ecore_evas/ecore_evas_buffer.c @@ -44,7 +44,7 @@ _ecore_evas_buffer_free(Ecore_Evas *ee) ee2 = evas_object_data_get(ee->engine.buffer.image, "Ecore_Evas_Parent"); evas_object_del(ee->engine.buffer.image); - ee2->sub_ecore_evas = evas_list_remove(ee2->sub_ecore_evas, ee); + ee2->sub_ecore_evas = eina_list_remove(ee2->sub_ecore_evas, ee); } else free(ee->engine.buffer.pixels); @@ -108,13 +108,11 @@ _ecore_evas_buffer_shutdown(void) void _ecore_evas_buffer_render(Ecore_Evas *ee) { - Evas_List *updates, *l, *ll; + Eina_List *updates, *l, *ll; + Ecore_Evas *ee2; - for (ll = ee->sub_ecore_evas; ll; ll = ll->next) + EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2) { - Ecore_Evas *ee2; - - ee2 = ll->data; if (ee2->func.fn_pre_render) ee2->func.fn_pre_render(ee2); _ecore_evas_buffer_render(ee2); if (ee2->func.fn_post_render) ee2->func.fn_post_render(ee2); @@ -130,15 +128,12 @@ _ecore_evas_buffer_render(Ecore_Evas *ee) updates = evas_render_updates(ee->evas); if (ee->engine.buffer.image) { - for (l = updates; l; l = l->next) - { - Evas_Rectangle *r; + Evas_Rectangle *r; - r = l->data; - if (ee->engine.buffer.image) - evas_object_image_data_update_add(ee->engine.buffer.image, - r->x, r->y, r->w, r->h); - } + EINA_LIST_FOREACH(updates, l, r) + if (ee->engine.buffer.image) + evas_object_image_data_update_add(ee->engine.buffer.image, + r->x, r->y, r->w, r->h); } if (updates) { @@ -645,7 +640,7 @@ ecore_evas_object_image_new(Ecore_Evas *ee_target) evas_key_lock_add(ee->evas, "Num_Lock"); evas_key_lock_add(ee->evas, "Scroll_Lock"); - ee_target->sub_ecore_evas = evas_list_append(ee_target->sub_ecore_evas, ee); + ee_target->sub_ecore_evas = eina_list_append(ee_target->sub_ecore_evas, ee); return o; #else return NULL; diff --git a/src/lib/ecore_evas/ecore_evas_directfb.c b/src/lib/ecore_evas/ecore_evas_directfb.c index 23723d9..d0fc2b2 100644 --- a/src/lib/ecore_evas/ecore_evas_directfb.c +++ b/src/lib/ecore_evas/ecore_evas_directfb.c @@ -21,14 +21,12 @@ static Ecore_Idle_Enterer *ecore_evas_directfb_idle_enterer = NULL; static void _ecore_evas_directfb_render(Ecore_Evas *ee) { - Evas_List *updates, *ll; - + Eina_List *updates, *ll; + Ecore_Evas *ee2; + #ifdef BUILD_ECORE_EVAS_BUFFER - for (ll = ee->sub_ecore_evas; ll; ll = ll->next) + EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2) { - Ecore_Evas *ee2; - - ee2 = ll->data; if (ee2->func.fn_pre_render) ee2->func.fn_pre_render(ee2); _ecore_evas_buffer_render(ee2); if (ee2->func.fn_post_render) ee2->func.fn_post_render(ee2); diff --git a/src/lib/ecore_evas/ecore_evas_fb.c b/src/lib/ecore_evas/ecore_evas_fb.c index f29eaad..21a4c27 100644 --- a/src/lib/ecore_evas/ecore_evas_fb.c +++ b/src/lib/ecore_evas/ecore_evas_fb.c @@ -212,19 +212,16 @@ _ecore_evas_idle_enter(void *data __UNUSED__) ee = (Ecore_Evas *)l; if (ee->visible) { - Evas_List *updates; + Eina_List *updates; #ifdef BUILD_ECORE_EVAS_BUFFER - Evas_List *ll; + Eina_List *ll; + Ecore_Evas *ee2; #endif - if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee); #ifdef BUILD_ECORE_EVAS_BUFFER - for (ll = ee->sub_ecore_evas; ll; ll = ll->next) + EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2) { - Ecore_Evas *ee2; - - ee2 = ll->data; if (ee2->func.fn_pre_render) ee2->func.fn_pre_render(ee2); _ecore_evas_buffer_render(ee2); if (ee2->func.fn_post_render) ee2->func.fn_post_render(ee2); diff --git a/src/lib/ecore_evas/ecore_evas_private.h b/src/lib/ecore_evas/ecore_evas_private.h index 2fd475a..64e8ca7 100644 --- a/src/lib/ecore_evas/ecore_evas_private.h +++ b/src/lib/ecore_evas/ecore_evas_private.h @@ -156,7 +156,7 @@ struct _Ecore_Evas_Engine struct { Ecore_X_Window win_root; Ecore_X_Window win; - Evas_List *win_extra; + Eina_List *win_extra; Ecore_X_Pixmap pmap; Ecore_X_Pixmap mask; Ecore_X_GC gc; @@ -291,7 +291,7 @@ struct _Ecore_Evas } func; Ecore_Evas_Engine engine; - Evas_List *sub_ecore_evas; + Eina_List *sub_ecore_evas; unsigned char ignore_events : 1; }; diff --git a/src/lib/ecore_evas/ecore_evas_sdl.c b/src/lib/ecore_evas/ecore_evas_sdl.c index c407430..bc0af15 100644 --- a/src/lib/ecore_evas/ecore_evas_sdl.c +++ b/src/lib/ecore_evas/ecore_evas_sdl.c @@ -214,7 +214,7 @@ _ecore_evas_sdl_event_video_expose(void *data __UNUSED__, int type __UNUSED__, v static void _ecore_evas_render(Ecore_Evas *ee) { - Evas_List *updates; + Eina_List *updates; updates = evas_render_updates(ee->evas); if (updates) diff --git a/src/lib/ecore_evas/ecore_evas_win32.c b/src/lib/ecore_evas/ecore_evas_win32.c index b68c524..d734907 100644 --- a/src/lib/ecore_evas/ecore_evas_win32.c +++ b/src/lib/ecore_evas/ecore_evas_win32.c @@ -64,16 +64,15 @@ static int _ecore_evas_win32_event_window_delete_request(void *data __UNUSED__, static void _ecore_evas_win32_render(Ecore_Evas *ee) { + Eina_List *updates; #ifdef BUILD_ECORE_EVAS_BUFFER - Evas_List *ll; + Eina_List *ll; + Ecore_Evas *ee2;² #endif #ifdef BUILD_ECORE_EVAS_BUFFER - for (ll = ee->sub_ecore_evas; ll; ll = ll->next) + EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2) { - Ecore_Evas *ee2; - - ee2 = ll->data; if (ee2->func.fn_pre_render) ee2->func.fn_pre_render(ee2); _ecore_evas_buffer_render(ee2); if (ee2->func.fn_post_render) ee2->func.fn_post_render(ee2); @@ -82,8 +81,6 @@ _ecore_evas_win32_render(Ecore_Evas *ee) if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee); if (ee->prop.avoid_damage) { - Evas_List *updates; - updates = evas_render_updates(ee->evas); if (updates) evas_render_updates_free(updates); } @@ -93,15 +90,11 @@ _ecore_evas_win32_render(Ecore_Evas *ee) { if (ee->shaped) { - Evas_List *updates; - updates = evas_render_updates(ee->evas); if (updates) evas_render_updates_free(updates); } else { - Evas_List *updates; - updates = evas_render_updates(ee->evas); if (updates) evas_render_updates_free(updates); } diff --git a/src/lib/ecore_evas/ecore_evas_wince.c b/src/lib/ecore_evas/ecore_evas_wince.c index 29253e4..2e1084d 100644 --- a/src/lib/ecore_evas/ecore_evas_wince.c +++ b/src/lib/ecore_evas/ecore_evas_wince.c @@ -63,16 +63,15 @@ static int _ecore_evas_wince_event_window_delete_request(void *data __UNUSED__, static void _ecore_evas_wince_render(Ecore_Evas *ee) { + Eina_List *updates = NULL; #ifdef BUILD_ECORE_EVAS_BUFFER - Evas_List *ll; + Eina_List *ll; + Ecore_Evas *ee2; #endif #ifdef BUILD_ECORE_EVAS_BUFFER - for (ll = ee->sub_ecore_evas; ll; ll = ll->next) + EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2) { - Ecore_Evas *ee2; - - ee2 = ll->data; if (ee2->func.fn_pre_render) ee2->func.fn_pre_render(ee2); _ecore_evas_buffer_render(ee2); if (ee2->func.fn_post_render) ee2->func.fn_post_render(ee2); @@ -81,8 +80,6 @@ _ecore_evas_wince_render(Ecore_Evas *ee) if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee); if (ee->prop.avoid_damage) { - Evas_List *updates; - updates = evas_render_updates(ee->evas); if (updates) evas_render_updates_free(updates); } @@ -92,15 +89,11 @@ _ecore_evas_wince_render(Ecore_Evas *ee) { if (ee->shaped) { - Evas_List *updates; - updates = evas_render_updates(ee->evas); if (updates) evas_render_updates_free(updates); } else { - Evas_List *updates; - updates = evas_render_updates(ee->evas); if (updates) evas_render_updates_free(updates); } diff --git a/src/lib/ecore_evas/ecore_evas_x.c b/src/lib/ecore_evas/ecore_evas_x.c index a3b1f01..b5fe1ec 100644 --- a/src/lib/ecore_evas/ecore_evas_x.c +++ b/src/lib/ecore_evas/ecore_evas_x.c @@ -140,16 +140,16 @@ _ecore_evas_x_gl_window_new(Ecore_Evas *ee, Ecore_X_Window parent, int x, int y, static void _ecore_evas_x_render(Ecore_Evas *ee) { + Evas_Rectangle *r; + Eina_List *updates, *l; #ifdef BUILD_ECORE_EVAS_BUFFER - Evas_List *ll; + Eina_List *ll; + Ecore_Evas *ee2; #endif #ifdef BUILD_ECORE_EVAS_BUFFER - for (ll = ee->sub_ecore_evas; ll; ll = ll->next) + EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2) { - Ecore_Evas *ee2; - - ee2 = ll->data; if (ee2->func.fn_pre_render) ee2->func.fn_pre_render(ee2); _ecore_evas_buffer_render(ee2); if (ee2->func.fn_post_render) ee2->func.fn_post_render(ee2); @@ -158,33 +158,21 @@ _ecore_evas_x_render(Ecore_Evas *ee) if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee); if (ee->prop.avoid_damage) { - Evas_List *updates, *l; - updates = evas_render_updates(ee->evas); #if 0 // if (ee->w == 640) { - for (l = updates; l; l = l->next) - { - Evas_Rectangle *r; - - r = l->data; - printf(" UP render [%p] %ix%i, [%i %i %ix%i]\n", - ee, ee->w, ee->h, r->x, r->y, r->w, r->h); - } + EINA_LIST_FOREACH(updates, l, r) + printf(" UP render [%p] %ix%i, [%i %i %ix%i]\n", + ee, ee->w, ee->h, r->x, r->y, r->w, r->h); } #endif if (ee->engine.x.using_bg_pixmap) { if (updates) { - for (l = updates; l; l = l->next) - { - Evas_Rectangle *r; - - r = l->data; - ecore_x_window_area_clear(ee->engine.x.win, r->x, r->y, r->w, r->h); - } + EINA_LIST_FOREACH(updates, l, r) + ecore_x_window_area_clear(ee->engine.x.win, r->x, r->y, r->w, r->h); if ((ee->shaped) && (updates)) ecore_x_window_shape_mask_set(ee->engine.x.win, ee->engine.x.mask); if ((ee->alpha) && (updates)) @@ -201,15 +189,13 @@ _ecore_evas_x_render(Ecore_Evas *ee) #ifdef HAVE_ECORE_X_XCB #warning [XCB] No Region code #else - for (l = updates; l; l = l->next) + EINA_LIST_FOREACH(updates, l, r) { - Evas_Rectangle *r; XRectangle xr; Region tmpr; if (!ee->engine.x.damages) ee->engine.x.damages = XCreateRegion(); - r = l->data; tmpr = XCreateRegion(); if (ee->rotation == 0) { @@ -313,8 +299,6 @@ _ecore_evas_x_render(Ecore_Evas *ee) { if (ee->shaped) { - Evas_List *updates; - updates = evas_render_updates(ee->evas); if (updates) { @@ -325,26 +309,17 @@ _ecore_evas_x_render(Ecore_Evas *ee) } else { - Evas_List *updates; - updates = evas_render_updates(ee->evas); if (updates) { #if 0 // if (ee->w == 640) { - Evas_List *l; - printf("RENDER [%p] [%i] %ix%i\n", ee, ee->visible, ee->w, ee->h); - for (l = updates; l; l = l->next) - { - Evas_Rectangle *r; - - r = l->data; - printf(" render [%i %i %ix%i]\n", - r->x, r->y, r->w, r->h); - } + EINA_LIST_FOREACH(updates, l, r) + printf(" render [%i %i %ix%i]\n", + r->x, r->y, r->w, r->h); } #endif evas_render_updates_free(updates); @@ -1383,7 +1358,7 @@ _ecore_evas_x_free(Ecore_Evas *ee) Ecore_X_Window *winp; winp = ee->engine.x.win_extra->data; - ee->engine.x.win_extra = evas_list_remove_list(ee->engine.x.win_extra, ee->engine.x.win_extra); + ee->engine.x.win_extra = eina_list_remove_list(ee->engine.x.win_extra, ee->engine.x.win_extra); ecore_evases_hash = evas_hash_del(ecore_evases_hash, _ecore_evas_x_winid_str_get(*winp), ee); free(winp); } @@ -2979,7 +2954,7 @@ ecore_evas_software_x11_extra_event_window_add(Ecore_Evas *ee, Ecore_X_Window wi if (winp) { *winp = win; - ee->engine.x.win_extra = evas_list_append(ee->engine.x.win_extra, winp); + ee->engine.x.win_extra = eina_list_append(ee->engine.x.win_extra, winp); ecore_evases_hash = evas_hash_add(ecore_evases_hash, _ecore_evas_x_winid_str_get(win), ee); } #else @@ -3640,7 +3615,7 @@ ecore_evas_software_x11_16_extra_event_window_add(Ecore_Evas *ee, Ecore_X_Window if (winp) { *winp = win; - ee->engine.x.win_extra = evas_list_append(ee->engine.x.win_extra, winp); + ee->engine.x.win_extra = eina_list_append(ee->engine.x.win_extra, winp); ecore_evases_hash = evas_hash_add(ecore_evases_hash, _ecore_evas_x_winid_str_get(win), ee); } #else diff --git a/src/lib/ecore_ipc/Ecore_Ipc.h b/src/lib/ecore_ipc/Ecore_Ipc.h index b420cf2..59130db 100644 --- a/src/lib/ecore_ipc/Ecore_Ipc.h +++ b/src/lib/ecore_ipc/Ecore_Ipc.h @@ -143,8 +143,8 @@ EAPI unsigned long long _ecore_ipc_swap_64(unsigned long long v); /* saves typing function headers */ #define ECORE_IPC_DEC_STRUCT_PROTO(x) static int x(void *d, int s, void *pp) #define ECORE_IPC_ENC_STRUCT_PROTO(x) static void *x(void *pp, int *s) -#define ECORE_IPC_DEC_EVAS_LIST_PROTO(x) static Evas_List *x(void *d, int s) -#define ECORE_IPC_ENC_EVAS_LIST_PROTO(x) static void *x(Evas_List *lp, int *s) +#define ECORE_IPC_DEC_EINA_LIST_PROTO(x) static Eina_List *x(void *d, int s) +#define ECORE_IPC_ENC_EINA_LIST_PROTO(x) static void *x(Eina_List *lp, int *s) /* decoder setup - saves typing. requires data packet of exact size, or fail */ @@ -179,9 +179,9 @@ EAPI unsigned long long _ecore_ipc_swap_64(unsigned long long v); /* footer for the hell of it */ #define ECORE_IPC_ENC_STRUCT_FOOT() return d -#define ECORE_IPC_DEC_EVAS_LIST_HEAD(typ) \ +#define ECORE_IPC_DEC_EINA_LIST_HEAD(typ) \ unsigned char *ptr; \ - Evas_List *l; \ + Eina_List *l; \ typ *p; \ l = NULL; \ ptr = d; \ @@ -189,12 +189,12 @@ EAPI unsigned long long _ecore_ipc_swap_64(unsigned long long v); { \ p = malloc(sizeof(typ)); -#define ECORE_IPC_DEC_EVAS_LIST_FOOT() \ - l = evas_list_append(l, p); \ +#define ECORE_IPC_DEC_EINA_LIST_FOOT() \ + l = eina_list_append(l, p); \ } \ return l -#define ECORE_IPC_ENC_EVAS_LIST_HEAD_START(typ) \ - Evas_List *l; \ +#define ECORE_IPC_ENC_EINA_LIST_HEAD_START(typ) \ + Eina_List *l; \ typ *p; \ unsigned char *d, *ptr; \ int len; \ @@ -203,7 +203,7 @@ EAPI unsigned long long _ecore_ipc_swap_64(unsigned long long v); for (l = lp; l; l = l->next) \ { \ p = l->data; -#define ECORE_IPC_ENC_EVAS_LIST_HEAD_FINISH() \ +#define ECORE_IPC_ENC_EINA_LIST_HEAD_FINISH() \ } \ d = malloc(len); \ if(!d) return NULL; \ @@ -213,7 +213,7 @@ EAPI unsigned long long _ecore_ipc_swap_64(unsigned long long v); { \ p = l->data; -#define ECORE_IPC_ENC_EVAS_LIST_FOOT() \ +#define ECORE_IPC_ENC_EINA_LIST_FOOT() \ } \ return d -- 2.7.4