From d1a9314cddfb21763ca2d8a66a5ad7b12f82cd6e Mon Sep 17 00:00:00 2001 From: Rafael Antognolli Date: Mon, 4 Nov 2013 14:18:39 -0200 Subject: [PATCH] ecore/wayland: Use eina_inlist instead of wl_list for outputs too. --- src/lib/ecore_wayland/Ecore_Wayland.h | 2 +- src/lib/ecore_wayland/ecore_wl.c | 5 ++--- src/lib/ecore_wayland/ecore_wl_output.c | 9 +++++---- src/lib/ecore_wayland/ecore_wl_private.h | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/lib/ecore_wayland/Ecore_Wayland.h b/src/lib/ecore_wayland/Ecore_Wayland.h index 9c371a0..f0bdf88 100644 --- a/src/lib/ecore_wayland/Ecore_Wayland.h +++ b/src/lib/ecore_wayland/Ecore_Wayland.h @@ -403,7 +403,7 @@ EAPI void ecore_wl_input_cursor_from_name_set(Ecore_Wl_Input *input, const char EAPI void ecore_wl_input_cursor_default_restore(Ecore_Wl_Input *input); EAPI struct wl_seat *ecore_wl_input_seat_get(Ecore_Wl_Input *input); -EAPI struct wl_list *ecore_wl_outputs_get(void); +EAPI Eina_Inlist *ecore_wl_outputs_get(void); /** * Retrieves the Wayland Globals Interface list used for the current Wayland connection. diff --git a/src/lib/ecore_wayland/ecore_wl.c b/src/lib/ecore_wayland/ecore_wl.c index 2d5593c..bd68d4e 100644 --- a/src/lib/ecore_wayland/ecore_wl.c +++ b/src/lib/ecore_wayland/ecore_wl.c @@ -181,7 +181,6 @@ ecore_wl_init(const char *name) ecore_idle_enterer_add(_ecore_wl_cb_idle_enterer, _ecore_wl_disp); wl_list_init(&_ecore_wl_disp->inputs); - wl_list_init(&_ecore_wl_disp->outputs); _ecore_wl_disp->wl.registry = wl_display_get_registry(_ecore_wl_disp->wl.display); @@ -426,12 +425,12 @@ _ecore_wl_shutdown(Eina_Bool close) if ((close) && (!_ecore_wl_fatal_error)) { - Ecore_Wl_Output *out, *tout; + Ecore_Wl_Output *out; Ecore_Wl_Input *in, *tin; Ecore_Wl_Global *global; Eina_Inlist *tmp; - wl_list_for_each_safe(out, tout, &_ecore_wl_disp->outputs, link) + EINA_INLIST_FOREACH_SAFE(_ecore_wl_disp->outputs, tmp, out) _ecore_wl_output_del(out); wl_list_for_each_safe(in, tin, &_ecore_wl_disp->inputs, link) diff --git a/src/lib/ecore_wayland/ecore_wl_output.c b/src/lib/ecore_wayland/ecore_wl_output.c index c10383e..b5a75b7 100644 --- a/src/lib/ecore_wayland/ecore_wl_output.c +++ b/src/lib/ecore_wayland/ecore_wl_output.c @@ -20,10 +20,10 @@ static const struct wl_output_listener _ecore_wl_output_listener = }; /* @since 1.2 */ -EAPI struct wl_list * +EAPI Eina_Inlist * ecore_wl_outputs_get(void) { - return &(_ecore_wl_disp->outputs); + return _ecore_wl_disp->outputs; } void @@ -42,7 +42,7 @@ _ecore_wl_output_add(Ecore_Wl_Display *ewd, unsigned int id) output->output = wl_registry_bind(ewd->wl.registry, id, &wl_output_interface, 2); - wl_list_insert(ewd->outputs.prev, &output->link); + ewd->outputs = eina_inlist_append(ewd->outputs, EINA_INLIST_GET(output)); wl_output_add_listener(output->output, &_ecore_wl_output_listener, output); } @@ -52,7 +52,8 @@ _ecore_wl_output_del(Ecore_Wl_Output *output) if (!output) return; if (output->destroy) (*output->destroy)(output, output->data); if (output->output) wl_output_destroy(output->output); - wl_list_remove(&output->link); + _ecore_wl_disp->outputs = eina_inlist_remove + (_ecore_wl_disp->outputs, EINA_INLIST_GET(output)); free(output); } diff --git a/src/lib/ecore_wayland/ecore_wl_private.h b/src/lib/ecore_wayland/ecore_wl_private.h index 0127b44..e1ac612 100644 --- a/src/lib/ecore_wayland/ecore_wl_private.h +++ b/src/lib/ecore_wayland/ecore_wl_private.h @@ -73,7 +73,7 @@ struct _Ecore_Wl_Display Ecore_Idle_Enterer *idle_enterer; struct wl_list inputs; - struct wl_list outputs; + Eina_Inlist *outputs; Eina_Inlist *globals; /** @since 1.7.6 */ Eina_Bool init_done; @@ -204,12 +204,12 @@ struct _Ecore_Wl_Input struct _Ecore_Wl_Output { + EINA_INLIST; Ecore_Wl_Display *display; struct wl_output *output; Eina_Rectangle allocation; int mw, mh; int transform; - struct wl_list link; void (*destroy) (Ecore_Wl_Output *output, void *data); void *data; -- 2.7.4