diff --git a/src/bin/e_actions.c b/src/bin/e_actions.c index 98b9c766b..6f2d4cfb0 100644 --- a/src/bin/e_actions.c +++ b/src/bin/e_actions.c @@ -1573,14 +1573,11 @@ ACT_FN_GO(desk_linear_flip_to, ) #define DESK_ACTION_ALL(zone, act) \ E_Zone * zone; \ - const Eina_List *lc, *lz; \ - E_Comp *c; \ + const Eina_List *lz; \ \ - EINA_LIST_FOREACH(e_comp_list(), lc, c) { \ - EINA_LIST_FOREACH(c->zones, lz, zone) { \ + EINA_LIST_FOREACH(e_comp->zones, lz, zone) { \ act; \ } \ - } /***************************************************************************/ ACT_FN_GO(desk_flip_by_all, ) @@ -1717,24 +1714,20 @@ ACT_FN_GO(screen_send_by, ) #define ZONE_DESK_ACTION(con_num, zone_num, zone, act) \ E_Zone * zone; \ if ((con_num < 0) || (zone_num < 0)) { \ - Eina_List *l, *ll; \ - E_Comp *c; \ + Eina_List *l; \ if ((con_num >= 0) && (zone_num < 0)) /* con=1 zone=all */ { \ - c = e_util_comp_number_get(con_num); \ - EINA_LIST_FOREACH(c->zones, l, zone) { \ + EINA_LIST_FOREACH(e_comp->zones, l, zone) { \ act; \ } } \ else if ((con_num < 0) && (zone_num >= 0)) /* c=all zone=1 */ { \ - EINA_LIST_FOREACH(e_comp_list(), l, c) { \ zone = e_comp_zone_number_get(c, zone_num); \ if (zone) \ act; \ - } } \ + } \ else if ((con_num < 0) && (zone_num < 0)) /* c=all zone=all */ { \ - EINA_LIST_FOREACH(e_comp_list(), l, c) { \ - EINA_LIST_FOREACH(c->zones, lll, zone) { \ + EINA_LIST_FOREACH(e_comp->zones, lll, zone) { \ act; \ - } } } } } \ + } } } \ else { \ zone = e_util_comp_zone_number_get(con_num, zone_num); \ if (zone) act; \ diff --git a/src/bin/e_backlight.c b/src/bin/e_backlight.c index 46b3738f5..d71337e91 100644 --- a/src/bin/e_backlight.c +++ b/src/bin/e_backlight.c @@ -100,15 +100,13 @@ e_backlight_exists(void) EAPI void e_backlight_update(void) { - const Eina_List *l, *ll; - E_Comp *c; + const Eina_List *l; E_Zone *zone; if (bl_avail == EINA_FALSE) return; - EINA_LIST_FOREACH(e_comp_list(), l, c) - EINA_LIST_FOREACH(c->zones, ll, zone) - _e_backlight_update(zone); + EINA_LIST_FOREACH(e_comp->zones, l, zone) + _e_backlight_update(zone); } EAPI void diff --git a/src/bin/e_bg.c b/src/bin/e_bg.c index 85c3b13a3..28fe7d21d 100644 --- a/src/bin/e_bg.c +++ b/src/bin/e_bg.c @@ -403,13 +403,11 @@ e_bg_del(int manager, int zone, int desk_x, int desk_y) EAPI void e_bg_update(void) { - const Eina_List *l, *ll; - E_Comp *c; + const Eina_List *l; E_Zone *zone; - EINA_LIST_FOREACH(e_comp_list(), l, c) - EINA_LIST_FOREACH(c->zones, ll, zone) - e_zone_bg_reconfigure(zone); + EINA_LIST_FOREACH(e_comp->zones, l, zone) + e_zone_bg_reconfigure(zone); } /* local subsystem functions */ diff --git a/src/bin/e_client.c b/src/bin/e_client.c index 9ccd3b521..df3a7c6a7 100644 --- a/src/bin/e_client.c +++ b/src/bin/e_client.c @@ -86,45 +86,40 @@ static Eina_Inlist *_e_client_hooks[] = static Eina_Bool _e_client_cb_efreet_cache_update(void *data EINA_UNUSED, int type EINA_UNUSED, void *ev EINA_UNUSED) { - E_Comp *c; - const Eina_List *l, *ll; + const Eina_List *l; E_Client *ec; /* mark all clients for desktop/icon updates */ - EINA_LIST_FOREACH(e_comp_list(), l, c) - EINA_LIST_FOREACH(c->clients, ll, ec) - { - E_FREE_FUNC(ec->desktop, efreet_desktop_free); - if (e_object_is_del(E_OBJECT(ec))) continue; - ec->changes.icon = 1; - EC_CHANGED(ec); - } + EINA_LIST_FOREACH(e_comp->clients, l, ec) + { + E_FREE_FUNC(ec->desktop, efreet_desktop_free); + if (e_object_is_del(E_OBJECT(ec))) continue; + ec->changes.icon = 1; + EC_CHANGED(ec); + } return ECORE_CALLBACK_RENEW; } static Eina_Bool _e_client_cb_config_icon_theme(void *data EINA_UNUSED, int type EINA_UNUSED, void *ev EINA_UNUSED) { - E_Comp *c; - const Eina_List *l, *ll; + const Eina_List *l; E_Client *ec; /* mark all clients for desktop/icon updates */ - EINA_LIST_FOREACH(e_comp_list(), l, c) - EINA_LIST_FOREACH(c->clients, ll, ec) - { - if (e_object_is_del(E_OBJECT(ec))) continue; - ec->changes.icon = 1; - EC_CHANGED(ec); - } + EINA_LIST_FOREACH(e_comp->clients, l, ec) + { + if (e_object_is_del(E_OBJECT(ec))) continue; + ec->changes.icon = 1; + EC_CHANGED(ec); + } return ECORE_CALLBACK_RENEW; } static Eina_Bool _e_client_cb_config_mode(void *data EINA_UNUSED, int type EINA_UNUSED, void *ev EINA_UNUSED) { - E_Comp *c; - const Eina_List *l, *ll; + const Eina_List *l; E_Client *ec; E_Layer layer; @@ -137,17 +132,16 @@ _e_client_cb_config_mode(void *data EINA_UNUSED, int type EINA_UNUSED, void *ev else return ECORE_CALLBACK_RENEW; - EINA_LIST_FOREACH(e_comp_list(), l, c) - EINA_LIST_FOREACH(c->clients, ll, ec) - { - if (e_object_is_del(E_OBJECT(ec))) continue; - if ((ec->fullscreen) || (ec->need_fullscreen)) - { - ec->fullscreen = 0; - evas_object_layer_set(ec->frame, layer); - ec->fullscreen = 1; - } - } + EINA_LIST_FOREACH(e_comp->clients, l, ec) + { + if (e_object_is_del(E_OBJECT(ec))) continue; + if ((ec->fullscreen) || (ec->need_fullscreen)) + { + ec->fullscreen = 0; + evas_object_layer_set(ec->frame, layer); + ec->fullscreen = 1; + } + } return ECORE_CALLBACK_PASS_ON; } @@ -163,17 +157,15 @@ _e_client_cb_pointer_warp(void *data EINA_UNUSED, int type EINA_UNUSED, E_Event_ static Eina_Bool _e_client_cb_desk_window_profile_change(void *data EINA_UNUSED, int type EINA_UNUSED, E_Event_Desk_Window_Profile_Change *ev EINA_UNUSED) { - E_Comp *c; - const Eina_List *l, *ll; + const Eina_List *l; E_Client *ec; - EINA_LIST_FOREACH(e_comp_list(), l, c) - EINA_LIST_FOREACH(c->clients, ll, ec) - { - if (e_object_is_del(E_OBJECT(ec))) continue; - ec->e.fetch.profile = 1; - EC_CHANGED(ec); - } + EINA_LIST_FOREACH(e_comp->clients, l, ec) + { + if (e_object_is_del(E_OBJECT(ec))) continue; + ec->e.fetch.profile = 1; + EC_CHANGED(ec); + } return ECORE_CALLBACK_RENEW; } @@ -2268,84 +2260,80 @@ EINTERN void e_client_idler_before(void) { const Eina_List *l; - E_Comp *c; + E_Client *ec; if (!eina_hash_population(clients_hash)) return; - EINA_LIST_FOREACH(e_comp_list(), l, c) + + + EINA_LIST_FOREACH(e_comp->clients, l, ec) { - Eina_List *ll; - E_Client *ec; + Eina_Stringshare *title; + // pass 1 - eval0. fetch properties on new or on change and + // call hooks to decide what to do - maybe move/resize + if (!ec->changed) continue; - EINA_LIST_FOREACH(c->clients, ll, ec) + if (!_e_client_hook_call(E_CLIENT_HOOK_EVAL_PRE_FETCH, ec)) continue; + /* FETCH is hooked by the compositor to get client hints */ + title = e_client_util_name_get(ec); + if (!_e_client_hook_call(E_CLIENT_HOOK_EVAL_FETCH, ec)) continue; + if (title != e_client_util_name_get(ec)) + _e_client_event_property(ec, E_CLIENT_PROPERTY_TITLE); + /* PRE_POST_FETCH calls e_remember apply for new client */ + if (!_e_client_hook_call(E_CLIENT_HOOK_EVAL_PRE_POST_FETCH, ec)) continue; + if (!_e_client_hook_call(E_CLIENT_HOOK_EVAL_POST_FETCH, ec)) continue; + if (!_e_client_hook_call(E_CLIENT_HOOK_EVAL_PRE_FRAME_ASSIGN, ec)) continue; + + if ((ec->border.changed) && (!ec->shaded) && ((!ec->override) || ec->internal) && + (!(((ec->maximized & E_MAXIMIZE_TYPE) == E_MAXIMIZE_FULLSCREEN)))) + _e_client_frame_update(ec); + ec->border.changed = 0; + _e_client_hook_call(E_CLIENT_HOOK_EVAL_POST_FRAME_ASSIGN, ec); + } + + E_CLIENT_FOREACH(e_comp, ec) + { + // pass 2 - show windows needing show + if ((ec->changes.visible) && (ec->visible) && + (!ec->new_client) && (!ec->changes.pos) && + (!ec->changes.size)) { - Eina_Stringshare *title; - // pass 1 - eval0. fetch properties on new or on change and - // call hooks to decide what to do - maybe move/resize - if (!ec->changed) continue; - - if (!_e_client_hook_call(E_CLIENT_HOOK_EVAL_PRE_FETCH, ec)) continue; - /* FETCH is hooked by the compositor to get client hints */ - title = e_client_util_name_get(ec); - if (!_e_client_hook_call(E_CLIENT_HOOK_EVAL_FETCH, ec)) continue; - if (title != e_client_util_name_get(ec)) - _e_client_event_property(ec, E_CLIENT_PROPERTY_TITLE); - /* PRE_POST_FETCH calls e_remember apply for new client */ - if (!_e_client_hook_call(E_CLIENT_HOOK_EVAL_PRE_POST_FETCH, ec)) continue; - if (!_e_client_hook_call(E_CLIENT_HOOK_EVAL_POST_FETCH, ec)) continue; - if (!_e_client_hook_call(E_CLIENT_HOOK_EVAL_PRE_FRAME_ASSIGN, ec)) continue; - - if ((ec->border.changed) && (!ec->shaded) && ((!ec->override) || ec->internal) && - (!(((ec->maximized & E_MAXIMIZE_TYPE) == E_MAXIMIZE_FULLSCREEN)))) - _e_client_frame_update(ec); - ec->border.changed = 0; - _e_client_hook_call(E_CLIENT_HOOK_EVAL_POST_FRAME_ASSIGN, ec); + evas_object_show(ec->frame); + ec->changes.visible = !evas_object_visible_get(ec->frame); } - E_CLIENT_FOREACH(c, ec) + if ((!ec->new_client) && (!e_client_util_ignored_get(ec)) && + (!E_INSIDE(ec->x, ec->y, 0, 0, ec->comp->man->w - 5, ec->comp->man->h - 5)) && + (!E_INSIDE(ec->x, ec->y, 0 - ec->w + 5, 0 - ec->h + 5, ec->comp->man->w - 5, ec->comp->man->h - 5)) + ) { - // pass 2 - show windows needing show - if ((ec->changes.visible) && (ec->visible) && - (!ec->new_client) && (!ec->changes.pos) && - (!ec->changes.size)) - { - evas_object_show(ec->frame); - ec->changes.visible = !evas_object_visible_get(ec->frame); - } + if (e_config->screen_limits != E_SCREEN_LIMITS_COMPLETELY) + _e_client_move_lost_window_to_center(ec); + } + } - if ((!ec->new_client) && (!e_client_util_ignored_get(ec)) && - (!E_INSIDE(ec->x, ec->y, 0, 0, ec->comp->man->w - 5, ec->comp->man->h - 5)) && - (!E_INSIDE(ec->x, ec->y, 0 - ec->w + 5, 0 - ec->h + 5, ec->comp->man->w - 5, ec->comp->man->h - 5)) - ) - { - if (e_config->screen_limits != E_SCREEN_LIMITS_COMPLETELY) - _e_client_move_lost_window_to_center(ec); - } + if (_e_client_layout_cb) + _e_client_layout_cb(e_comp); + + // pass 3 - hide windows needing hide and eval (main eval) + E_CLIENT_FOREACH(e_comp, ec) + { + if (e_object_is_del(E_OBJECT(ec))) continue; + + if ((ec->changes.visible) && (!ec->visible)) + { + evas_object_hide(ec->frame); + ec->changes.visible = 0; } - if (_e_client_layout_cb) - _e_client_layout_cb(c); + if (ec->changed) + _e_client_eval(ec); - // pass 3 - hide windows needing hide and eval (main eval) - E_CLIENT_FOREACH(c, ec) + if ((ec->changes.visible) && (ec->visible) && (!ec->changed)) { - if (e_object_is_del(E_OBJECT(ec))) continue; - - if ((ec->changes.visible) && (!ec->visible)) - { - evas_object_hide(ec->frame); - ec->changes.visible = 0; - } - - if (ec->changed) - _e_client_eval(ec); - - if ((ec->changes.visible) && (ec->visible) && (!ec->changed)) - { - evas_object_show(ec->frame); - ec->changes.visible = !evas_object_visible_get(ec->frame); - ec->changed = ec->changes.visible; - } + evas_object_show(ec->frame); + ec->changes.visible = !evas_object_visible_get(ec->frame); + ec->changed = ec->changes.visible; } } } @@ -2682,28 +2670,16 @@ e_client_warping_get(void) EAPI Eina_List * -e_clients_immortal_list(const E_Comp *c) +e_clients_immortal_list(void) { - const Eina_List *l, *ll; + const Eina_List *l; Eina_List *list = NULL; E_Client *ec; - if (c) + EINA_LIST_FOREACH(e_comp->clients, l, ec) { - EINA_LIST_FOREACH(c->clients, ll, ec) - { - if (ec->lock_life) - list = eina_list_append(list, ec); - } - } - else - { - EINA_LIST_FOREACH(e_comp_list(), l, c) - EINA_LIST_FOREACH(c->clients, ll, ec) - { - if (ec->lock_life) - list = eina_list_append(list, ec); - } + if (ec->lock_life) + list = eina_list_append(list, ec); } return list; } @@ -3530,28 +3506,23 @@ EAPI Eina_List * e_client_lost_windows_get(E_Zone *zone) { Eina_List *list = NULL; - const Eina_List *l, *ll; + const Eina_List *l; E_Client *ec; - E_Comp *c; int loss_overlap = 5; E_OBJECT_CHECK_RETURN(zone, NULL); E_OBJECT_TYPE_CHECK_RETURN(zone, E_ZONE_TYPE, NULL); - EINA_LIST_FOREACH(e_comp_list(), l, c) + EINA_LIST_FOREACH(e_comp->clients, l, ec) { - if (zone->comp != c) continue; - EINA_LIST_FOREACH(c->clients, ll, ec) - { - if (ec->zone != zone) continue; + if (ec->zone != zone) continue; - if (!E_INTERSECTS(ec->zone->x + loss_overlap, - ec->zone->y + loss_overlap, - ec->zone->w - (2 * loss_overlap), - ec->zone->h - (2 * loss_overlap), - ec->x, ec->y, ec->w, ec->h)) - { - list = eina_list_append(list, ec); - } + if (!E_INTERSECTS(ec->zone->x + loss_overlap, + ec->zone->y + loss_overlap, + ec->zone->w - (2 * loss_overlap), + ec->zone->h - (2 * loss_overlap), + ec->x, ec->y, ec->w, ec->h)) + { + list = eina_list_append(list, ec); } } return list; diff --git a/src/bin/e_client.h b/src/bin/e_client.h index 1abc1da53..c29bd1ee8 100644 --- a/src/bin/e_client.h +++ b/src/bin/e_client.h @@ -748,7 +748,7 @@ EAPI void e_client_desk_set(E_Client *ec, E_Desk *desk); EAPI Eina_Bool e_client_comp_grabbed_get(void); EAPI E_Client *e_client_action_get(void); EAPI E_Client *e_client_warping_get(void); -EAPI Eina_List *e_clients_immortal_list(const E_Comp *c); +EAPI Eina_List *e_clients_immortal_list(void); EAPI void e_client_mouse_in(E_Client *ec, int x, int y); EAPI void e_client_mouse_out(E_Client *ec, int x, int y); EAPI void e_client_mouse_wheel(E_Client *ec, Evas_Point *output, E_Binding_Event_Wheel *ev); diff --git a/src/bin/e_comp.c b/src/bin/e_comp.c index 82e6bf2ee..3ea3b3ef0 100644 --- a/src/bin/e_comp.c +++ b/src/bin/e_comp.c @@ -21,7 +21,7 @@ static Eina_List *handlers = NULL; static Eina_List *hooks = NULL; -static Eina_List *compositors = NULL; +EAPI E_Comp *e_comp = NULL; static Eina_Hash *ignores = NULL; static Eina_List *actions = NULL; @@ -532,13 +532,6 @@ _e_comp_cb_animator(void *data) ////////////////////////////////////////////////////////////////////////// -static Eina_Bool -_e_comp_cb_zone_change(void *data EINA_UNUSED, int type EINA_UNUSED, EINA_UNUSED void *event) -{ - E_LIST_FOREACH(compositors, e_comp_canvas_update); - return ECORE_CALLBACK_PASS_ON; -} - #ifdef SHAPE_DEBUG static void _e_comp_shape_debug_rect(E_Comp *c, Eina_Rectangle *rect, E_Color *color) @@ -855,25 +848,20 @@ _e_comp_override_expire(void *data) static Eina_Bool _e_comp_screensaver_on(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED) { - Eina_List *l, *ll; + Eina_List *l; E_Zone *zone; - E_Comp *c; ecore_frametime = ecore_animator_frametime_get(); - // fixme: use hash if compositors list > 4 - EINA_LIST_FOREACH(compositors, l, c) + if (e_comp->saver) return ECORE_CALLBACK_RENEW; + e_comp_override_add(e_comp); + e_comp->saver = EINA_TRUE; + if (e_comp->render_animator) + ecore_animator_freeze(e_comp->render_animator); + EINA_LIST_FOREACH(e_comp->zones, l, zone) { - if (c->saver) continue; - e_comp_override_add(c); - c->saver = EINA_TRUE; - if (c->render_animator) - ecore_animator_freeze(c->render_animator); - EINA_LIST_FOREACH(c->zones, ll, zone) - { - e_zone_fade_handle(zone, 1, 3.0); - edje_object_signal_emit(zone->base, "e,state,screensaver,on", "e"); - edje_object_signal_emit(zone->over, "e,state,screensaver,on", "e"); - } + e_zone_fade_handle(zone, 1, 3.0); + edje_object_signal_emit(zone->base, "e,state,screensaver,on", "e"); + edje_object_signal_emit(zone->over, "e,state,screensaver,on", "e"); } return ECORE_CALLBACK_PASS_ON; @@ -882,30 +870,25 @@ _e_comp_screensaver_on(void *data EINA_UNUSED, int type EINA_UNUSED, void *event static Eina_Bool _e_comp_screensaver_off(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED) { - Eina_List *l, *ll; + Eina_List *l; E_Zone *zone; - E_Comp *c; + E_Client *ec; ecore_animator_frametime_set(ecore_frametime); - // fixme: use hash if compositors list > 4 - EINA_LIST_FOREACH(compositors, l, c) + if (!e_comp->saver) return ECORE_CALLBACK_RENEW; + e_comp_override_del(e_comp); + e_comp->saver = EINA_FALSE; + if (!e_comp->nocomp) + ecore_evas_manual_render_set(e_comp->ee, EINA_FALSE); + EINA_LIST_FOREACH(e_comp->zones, l, zone) { - E_Client *ec; - if (!c->saver) continue; - e_comp_override_del(c); - c->saver = EINA_FALSE; - if (!c->nocomp) - ecore_evas_manual_render_set(c->ee, EINA_FALSE); - EINA_LIST_FOREACH(c->zones, ll, zone) - { - edje_object_signal_emit(zone->base, "e,state,screensaver,off", "e"); - edje_object_signal_emit(zone->over, "e,state,screensaver,off", "e"); - e_zone_fade_handle(zone, 0, 0.5); - } - E_CLIENT_FOREACH(c, ec) - if (e_comp_object_damage_exists(ec->frame)) - e_comp_object_render_update_add(ec->frame); + edje_object_signal_emit(zone->base, "e,state,screensaver,off", "e"); + edje_object_signal_emit(zone->over, "e,state,screensaver,off", "e"); + e_zone_fade_handle(zone, 0, 0.5); } + E_CLIENT_FOREACH(e_comp, ec) + if (e_comp_object_damage_exists(ec->frame)) + e_comp_object_render_update_add(ec->frame); return ECORE_CALLBACK_PASS_ON; } @@ -1076,7 +1059,7 @@ e_comp_init(void) #if defined(HAVE_WAYLAND_CLIENTS) || defined(HAVE_WAYLAND_ONLY) e_comp_wl_init(); #endif - if (!compositors) return EINA_FALSE; + if (!e_comp) return EINA_FALSE; out: e_util_env_set("HYBRIS_EGLPLATFORM", NULL); E_LIST_HANDLER_APPEND(handlers, E_EVENT_SCREENSAVER_ON, _e_comp_screensaver_on, NULL); @@ -1085,10 +1068,6 @@ out: E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_KEY_DOWN, _e_comp_key_down, NULL); E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_SIGNAL_USER, _e_comp_signal_user, NULL); - E_LIST_HANDLER_APPEND(handlers, E_EVENT_ZONE_MOVE_RESIZE, _e_comp_cb_zone_change, NULL); - E_LIST_HANDLER_APPEND(handlers, E_EVENT_ZONE_ADD, _e_comp_cb_zone_change, NULL); - E_LIST_HANDLER_APPEND(handlers, E_EVENT_ZONE_DEL, _e_comp_cb_zone_change, NULL); - return EINA_TRUE; } @@ -1278,17 +1257,16 @@ EAPI E_Comp * e_comp_new(void) { E_Comp *c; - char name[40]; + if (e_comp) + CRI("CANNOT REPLACE EXISTING COMPOSITOR"); c = E_OBJECT_ALLOC(E_Comp, E_COMP_TYPE, _e_comp_free); if (!c) return NULL; - c->num = eina_list_count(compositors); - snprintf(name, sizeof(name), _("Compositor %u"), c->num); - c->name = eina_stringshare_add(name); + c->name = eina_stringshare_add(_("Compositor")); c->render_animator = ecore_animator_add(_e_comp_cb_animator, c); ecore_animator_freeze(c->render_animator); - compositors = eina_list_append(compositors, c); + e_comp = c; return c; } @@ -1301,15 +1279,10 @@ e_comp_internal_save(void) EINTERN int e_comp_shutdown(void) { - E_Comp *c; - E_FREE_FUNC(action_timeout, ecore_timer_del); - EINA_LIST_FREE(compositors, c) - { - while (c->clients) - e_object_del(eina_list_data_get(c->clients)); - e_object_del(E_OBJECT(c)); - } + while (e_comp->clients) + e_object_del(eina_list_data_get(e_comp->clients)); + e_object_del(E_OBJECT(e_comp)); E_FREE_LIST(handlers, ecore_event_handler_del); E_FREE_LIST(actions, e_object_del); E_FREE_LIST(hooks, e_client_hook_del); @@ -1381,114 +1354,21 @@ e_comp_config_get(void) return conf; } -EAPI const Eina_List * -e_comp_list(void) -{ - return compositors; -} - EAPI void e_comp_shadows_reset(void) { - Eina_List *l; - E_Comp *c; + E_Client *ec; - EINA_LIST_FOREACH(compositors, l, c) - { - E_Client *ec; - - _e_comp_fps_update(c); - E_LIST_FOREACH(c->zones, e_comp_canvas_zone_update); - E_CLIENT_FOREACH(c, ec) - e_comp_object_frame_theme_set(ec->frame, E_COMP_OBJECT_FRAME_RESHADOW); - } + _e_comp_fps_update(e_comp); + E_LIST_FOREACH(e_comp->zones, e_comp_canvas_zone_update); + E_CLIENT_FOREACH(e_comp, ec) + e_comp_object_frame_theme_set(ec->frame, E_COMP_OBJECT_FRAME_RESHADOW); } EAPI E_Comp * -e_comp_get(const void *o) +e_comp_get(const void *o EINA_UNUSED) { - E_Client *ec; - E_Shelf *es; - E_Menu *m; - E_Desk *desk; - E_Menu_Item *mi; - const E_Object *obj = o; - E_Zone *zone = NULL; - E_Manager *man = NULL; - E_Gadcon_Popup *gp; - E_Gadcon *gc; - E_Gadcon_Client *gcc; - E_Drag *drag; - - if (!o) - { - if (!(obj = (E_Object*)e_manager_current_get())) - return NULL; - } - - /* try to get to zone type first */ - switch (obj->type) - { - case E_DESK_TYPE: - desk = (E_Desk*)obj; - obj = (void*)desk->zone; - EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL); - break; - case E_CLIENT_TYPE: - ec = (E_Client*)obj; - return ec->comp; - case E_MENU_TYPE: - m = (E_Menu*)obj; - obj = (void*)m->zone; - EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL); - break; - case E_MENU_ITEM_TYPE: - mi = (E_Menu_Item*)obj; - obj = (void*)mi->menu->zone; - EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL); - break; - case E_SHELF_TYPE: - es = (E_Shelf*)obj; - obj = (void*)es->zone; - EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL); - break; - case E_DRAG_TYPE: - drag = (E_Drag*)obj; - return drag->comp; - case E_GADCON_POPUP_TYPE: - gp = (E_Gadcon_Popup*)obj; - obj = (void*)gp->gcc; - EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL); - /* no break */ - case E_GADCON_CLIENT_TYPE: - gcc = (E_Gadcon_Client*)obj; - obj = (void*)gcc->gadcon; - EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL); - /* no break */ - case E_GADCON_TYPE: - gc = (E_Gadcon*)obj; - obj = (void*)e_gadcon_zone_get(gc); - EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL); - break; - default: - break; - } - switch (obj->type) - { - case E_ZONE_TYPE: - if (!zone) zone = (E_Zone*)obj; - return zone->comp; - case E_MANAGER_TYPE: - if (!man) man = (E_Manager*)obj; - return man->comp; - } - if (e_obj_is_win(obj)) - { - ec = e_win_client_get((void*)obj); - return e_comp_get(ec); - } - CRI("UNIMPLEMENTED TYPE PASSED! FIXME!"); - return NULL; + return e_comp; } @@ -1585,51 +1465,33 @@ FIXME EAPI void e_comp_block_window_add(void) { - E_Comp *c; - Eina_List *l; - - EINA_LIST_FOREACH(compositors, l, c) - { - c->block_count++; - if (c->block_win) continue; - c->block_win = ecore_x_window_new(c->man->root, c->man->x, c->man->y, c->man->w, c->man->h); - INF("BLOCK WIN: %x", c->block_win); - ecore_x_window_background_color_set(c->block_win, 0, 0, 0); - e_comp_ignore_win_add(c->block_win); - ecore_x_window_configure(c->block_win, - ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING | ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE, - 0, 0, 0, 0, 0, ((E_Comp_Win*)c->wins)->win, ECORE_X_WINDOW_STACK_ABOVE); - ecore_x_window_show(c->block_win); - } + e_comp->block_count++; + if (e_comp->block_win) return; + e_comp->block_win = ecore_x_window_new(e_comp->man->root, e_comp->man->x, e_comp->man->y, e_comp->man->w, e_comp->man->h); + INF("BLOCK WIN: %x", e_comp->block_win); + ecore_x_window_background_color_set(e_comp->block_win, 0, 0, 0); + e_comp_ignore_win_add(e_comp->block_win); + ecore_x_window_configure(e_comp->block_win, + ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING | ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE, + 0, 0, 0, 0, 0, ((E_Comp_Win*)e_comp->wins)->win, ECORE_X_WINDOW_STACK_ABOVE); + ecore_x_window_show(e_comp->block_win); } EAPI void e_comp_block_window_del(void) { - E_Comp *c; - Eina_List *l; - - EINA_LIST_FOREACH(compositors, l, c) - { - if (!c->block_count) continue; - c->block_count--; - if (c->block_count) continue; - if (c->block_win) ecore_x_window_free(c->block_win); - c->block_win = 0; - } + if (!e_comp->block_count) return; + e_comp->block_count--; + if (e_comp->block_count) return; + if (e_comp->block_win) ecore_x_window_free(e_comp->block_win); + e_comp->block_win = 0; } #endif EAPI E_Comp * e_comp_find_by_window(Ecore_Window win) { - Eina_List *l; - E_Comp *c; - - EINA_LIST_FOREACH(compositors, l, c) - { - if ((c->win == win) || (c->ee_win == win) || (c->man->root == win)) return c; - } + if ((e_comp->win == win) || (e_comp->ee_win == win) || (e_comp->man->root == win)) return e_comp; return NULL; } @@ -1740,34 +1602,22 @@ e_comp_gl_get(void) EAPI E_Comp * e_comp_evas_find(const Evas *e) { - Eina_List *l; - E_Comp *c; - - EINA_LIST_FOREACH(compositors, l, c) - if (c->evas == e) return c; + if (e_comp->evas == e) return e_comp; return NULL; } EAPI void e_comp_button_bindings_ungrab_all(void) { - Eina_List *l; - E_Comp *c; - - EINA_LIST_FOREACH(compositors, l, c) - if (c->bindings_ungrab_cb) - c->bindings_ungrab_cb(c); + if (e_comp->bindings_ungrab_cb) + e_comp->bindings_ungrab_cb(e_comp); } EAPI void e_comp_button_bindings_grab_all(void) { - Eina_List *l; - E_Comp *c; - - EINA_LIST_FOREACH(compositors, l, c) - if (c->bindings_grab_cb) - c->bindings_grab_cb(c); + if (e_comp->bindings_grab_cb) + e_comp->bindings_grab_cb(e_comp); } EAPI void diff --git a/src/bin/e_comp.h b/src/bin/e_comp.h index 40871ff8b..56dc25c79 100644 --- a/src/bin/e_comp.h +++ b/src/bin/e_comp.h @@ -163,7 +163,7 @@ EAPI void e_comp_shape_queue_block(E_Comp *c, Eina_Bool block); EAPI E_Comp_Config *e_comp_config_get(void); EAPI const Eina_List *e_comp_list(void); EAPI void e_comp_shadows_reset(void); -EAPI E_Comp *e_comp_get(const void *o); +EINA_DEPRECATED EAPI E_Comp *e_comp_get(const void *o); EAPI Ecore_Window e_comp_top_window_at_xy_get(E_Comp *c, Evas_Coord x, Evas_Coord y); EAPI void e_comp_util_wins_print(const E_Comp *c); EAPI void e_comp_ignore_win_add(E_Pixmap_Type type, Ecore_Window win); @@ -191,7 +191,7 @@ EINTERN Evas_Object *e_comp_style_selector_create(Evas *evas, const char **sourc EAPI E_Config_Dialog *e_int_config_comp(Evas_Object *parent, const char *params); EAPI E_Config_Dialog *e_int_config_comp_match(Evas_Object *parent, const char *params); -static inline E_Comp * +EINA_DEPRECATED static inline E_Comp * e_comp_util_evas_object_comp_get(Evas_Object *obj) { return ecore_evas_data_get(ecore_evas_ecore_evas_get(evas_object_evas_get(obj)), "comp"); @@ -209,5 +209,7 @@ e_comp_util_client_is_fullscreen(const E_Client *ec) ); } +extern EAPI E_Comp *e_comp; + #endif #endif diff --git a/src/bin/e_comp_canvas.c b/src/bin/e_comp_canvas.c index 1c17b09a4..607ee6653 100644 --- a/src/bin/e_comp_canvas.c +++ b/src/bin/e_comp_canvas.c @@ -1,5 +1,13 @@ #include "e.h" +static Eina_List *handlers; + +static void +_e_comp_canvas_cb_del() +{ + E_FREE_LIST(handlers, ecore_event_handler_del); +} + static void _e_comp_canvas_event_compositor_resize_free(void *data EINA_UNUSED, void *event) { @@ -87,6 +95,15 @@ _e_comp_canvas_cb_mouse_wheel(E_Comp *c, Evas *e EINA_UNUSED, Evas_Object *obj E //////////////////////////////////// +static Eina_Bool +_e_comp_cb_zone_change() +{ + e_comp_canvas_update(); + return ECORE_CALLBACK_PASS_ON; +} + +//////////////////////////////////// + static void _e_comp_canvas_screensaver_active(void *d EINA_UNUSED, Evas_Object *obj, const char *sig EINA_UNUSED, const char *src EINA_UNUSED) { @@ -132,6 +149,7 @@ e_comp_canvas_init(E_Comp *c) evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_UP, (Evas_Object_Event_Cb)_e_comp_canvas_cb_mouse_up, c); evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_IN, (Evas_Object_Event_Cb)_e_comp_canvas_cb_mouse_in, c); evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_WHEEL, (Evas_Object_Event_Cb)_e_comp_canvas_cb_mouse_wheel, c); + evas_object_event_callback_add(o, EVAS_CALLBACK_DEL, _e_comp_canvas_cb_del, NULL); evas_object_show(o); ecore_evas_name_class_set(c->ee, "E", "Comp_EE"); @@ -155,6 +173,9 @@ e_comp_canvas_init(E_Comp *c) } else e_zone_new(c, 0, 0, 0, 0, c->man->w, c->man->h); + E_LIST_HANDLER_APPEND(handlers, E_EVENT_ZONE_MOVE_RESIZE, _e_comp_cb_zone_change, NULL); + E_LIST_HANDLER_APPEND(handlers, E_EVENT_ZONE_ADD, _e_comp_cb_zone_change, NULL); + E_LIST_HANDLER_APPEND(handlers, E_EVENT_ZONE_DEL, _e_comp_cb_zone_change, NULL); return EINA_TRUE; } @@ -236,17 +257,6 @@ e_comp_zone_id_get(E_Comp *c, int id) return NULL; } -EAPI E_Comp * -e_comp_number_get(unsigned int num) -{ - const Eina_List *l; - E_Comp *c; - - EINA_LIST_FOREACH(e_comp_list(), l, c) - if (c->num == num) return c; - return NULL; -} - EAPI E_Desk * e_comp_desk_window_profile_get(E_Comp *c, const char *profile) { @@ -330,7 +340,7 @@ e_comp_canvas_zone_update(E_Zone *zone) } EAPI void -e_comp_canvas_update(E_Comp *c) +e_comp_canvas_update(void) { E_Event_Compositor_Resize *ev; Eina_List *l, *screens, *zones = NULL, *ll; @@ -343,8 +353,8 @@ e_comp_canvas_update(E_Comp *c) if (screens) { - zones = c->zones; - c->zones = NULL; + zones = e_comp->zones; + e_comp->zones = NULL; EINA_LIST_FOREACH(screens, l, scr) { zone = NULL; @@ -360,12 +370,12 @@ e_comp_canvas_update(E_Comp *c) if (changed) printf("@@@ FOUND ZONE %i %i [%p]\n", zone->num, zone->id, zone); zones = eina_list_remove(zones, zone); - c->zones = eina_list_append(c->zones, zone); + e_comp->zones = eina_list_append(e_comp->zones, zone); zone->num = scr->screen; } else { - zone = e_zone_new(c, scr->screen, scr->escreen, + zone = e_zone_new(e_comp, scr->screen, scr->escreen, scr->x, scr->y, scr->w, scr->h); printf("@@@ NEW ZONE = %p\n", zone); changed = EINA_TRUE; @@ -374,19 +384,19 @@ e_comp_canvas_update(E_Comp *c) printf("@@@ SCREENS: %i %i | %i %i %ix%i\n", scr->screen, scr->escreen, scr->x, scr->y, scr->w, scr->h); } - c->zones = eina_list_sort(c->zones, 0, _e_comp_canvas_cb_zone_sort); + e_comp->zones = eina_list_sort(e_comp->zones, 0, _e_comp_canvas_cb_zone_sort); if (zones) { E_Zone *spare_zone; changed = EINA_TRUE; - spare_zone = eina_list_data_get(c->zones); + spare_zone = eina_list_data_get(e_comp->zones); EINA_LIST_FREE(zones, zone) { E_Client *ec; - E_CLIENT_FOREACH(c, ec) + E_CLIENT_FOREACH(e_comp, ec) { if (ec->zone == zone) { @@ -407,10 +417,10 @@ e_comp_canvas_update(E_Comp *c) { E_Zone *z; - z = e_comp_zone_number_get(c, 0); + z = e_comp_zone_number_get(e_comp, 0); if (z) { - changed |= e_zone_move_resize(z, 0, 0, c->man->w, c->man->h); + changed |= e_zone_move_resize(z, 0, 0, e_comp->man->w, e_comp->man->h); if (changed) e_shelf_zone_move_resize_handle(z); } } @@ -419,12 +429,12 @@ e_comp_canvas_update(E_Comp *c) if (!starting) { ev = calloc(1, sizeof(E_Event_Compositor_Resize)); - ev->comp = c; - e_object_ref(E_OBJECT(c)); + ev->comp = e_comp; + e_object_ref(E_OBJECT(e_comp)); ecore_event_add(E_EVENT_COMPOSITOR_RESIZE, ev, _e_comp_canvas_event_compositor_resize_free, NULL); } - EINA_LIST_FOREACH(c->zones, l, zone) + EINA_LIST_FOREACH(e_comp->zones, l, zone) { E_FREE_FUNC(zone->base, evas_object_del); E_FREE_FUNC(zone->over, evas_object_del); @@ -445,10 +455,10 @@ e_comp_canvas_update(E_Comp *c) Eina_List *tmp = NULL; E_Client *ec; - if (!c->layers[i].clients) continue; + if (!e_comp->layers[i].clients) continue; /* Make temporary list as e_client_res_change_geometry_restore * rearranges the order. */ - EINA_INLIST_FOREACH(c->layers[i].clients, ec) + EINA_INLIST_FOREACH(e_comp->layers[i].clients, ec) { if (!e_client_util_ignored_get(ec)) tmp = eina_list_append(tmp, ec); @@ -485,7 +495,7 @@ e_comp_canvas_fps_toggle(void) conf->fps_show = !conf->fps_show; e_comp_internal_save(); - E_LIST_FOREACH(e_comp_list(), e_comp_render_queue); + e_comp_render_queue(e_comp); } EAPI E_Layer diff --git a/src/bin/e_comp_canvas.h b/src/bin/e_comp_canvas.h index 30d6af5d4..7972d16a7 100644 --- a/src/bin/e_comp_canvas.h +++ b/src/bin/e_comp_canvas.h @@ -22,10 +22,9 @@ EAPI void e_comp_all_thaw(void); EAPI E_Zone * e_comp_zone_xy_get(const E_Comp *c, Evas_Coord x, Evas_Coord y); EAPI E_Zone * e_comp_zone_number_get(E_Comp *c, int num); EAPI E_Zone * e_comp_zone_id_get(E_Comp *c, int id); -EAPI E_Comp * e_comp_number_get(unsigned int num); EAPI E_Desk * e_comp_desk_window_profile_get(E_Comp *c, const char *profile); EAPI void e_comp_canvas_zone_update(E_Zone *zone); -EAPI void e_comp_canvas_update(E_Comp *c); +EAPI void e_comp_canvas_update(void); EAPI void e_comp_canvas_fake_layers_init(E_Comp *comp); EAPI void e_comp_canvas_fps_toggle(void); EAPI E_Layer e_comp_canvas_layer_map_to(unsigned int layer); diff --git a/src/bin/e_comp_x.c b/src/bin/e_comp_x.c index 37227564e..c367d5f41 100644 --- a/src/bin/e_comp_x.c +++ b/src/bin/e_comp_x.c @@ -468,8 +468,6 @@ static Eina_Bool _e_comp_x_post_client_idler_cb(void *d EINA_UNUSED) { E_Client *ec; - const Eina_List *l; - E_Comp *c; //INF("POST IDLER"); EINA_LIST_FREE(post_clients, ec) @@ -481,6 +479,7 @@ _e_comp_x_post_client_idler_cb(void *d EINA_UNUSED) if (ec->post_move) { E_Client *tmp; + Eina_List *l; EINA_LIST_FOREACH(ec->e.state.video_child, l, tmp) { @@ -584,12 +583,11 @@ _e_comp_x_post_client_idler_cb(void *d EINA_UNUSED) ec->post_move = 0; ec->post_resize = 0; } - EINA_LIST_FOREACH(e_comp_list(), l, c) - if (c->x_comp_data->restack && (!c->new_clients)) - { - e_hints_client_stacking_set(); - c->x_comp_data->restack = 0; - } + if (e_comp->x_comp_data->restack && (!e_comp->new_clients)) + { + e_hints_client_stacking_set(); + e_comp->x_comp_data->restack = 0; + } _e_comp_x_post_client_idler = NULL; return EINA_FALSE; } @@ -1018,16 +1016,10 @@ _e_comp_x_destroy(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_X_Event_Wi ec = _e_comp_x_client_find_by_window(ev->win); if (!ec) { - const Eina_List *l; - E_Comp *c; - - EINA_LIST_FOREACH(e_comp_list(), l, c) - { - if (!c->x_comp_data->retry_clients) continue; - c->x_comp_data->retry_clients = eina_list_remove(c->x_comp_data->retry_clients, (uintptr_t*)(unsigned long)ev->win); - if (!c->x_comp_data->retry_clients) - E_FREE_FUNC(c->x_comp_data->retry_timer, ecore_timer_del); - } + if (!e_comp->x_comp_data->retry_clients) return ECORE_CALLBACK_RENEW; + e_comp->x_comp_data->retry_clients = eina_list_remove(e_comp->x_comp_data->retry_clients, (uintptr_t*)(unsigned long)ev->win); + if (!e_comp->x_comp_data->retry_clients) + E_FREE_FUNC(e_comp->x_comp_data->retry_timer, ecore_timer_del); return ECORE_CALLBACK_PASS_ON; } if (ec->comp_data) @@ -1264,16 +1256,10 @@ _e_comp_x_hide(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_X_Event_Windo ec = _e_comp_x_client_find_by_window(ev->win); if (!ec) { - const Eina_List *l; - E_Comp *c; - - EINA_LIST_FOREACH(e_comp_list(), l, c) - { - if (!c->x_comp_data->retry_clients) continue; - c->x_comp_data->retry_clients = eina_list_remove(c->x_comp_data->retry_clients, (uintptr_t*)(unsigned long)ev->win); - if (!c->x_comp_data->retry_clients) - E_FREE_FUNC(c->x_comp_data->retry_timer, ecore_timer_del); - } + if (!e_comp->x_comp_data->retry_clients) return ECORE_CALLBACK_RENEW; + e_comp->x_comp_data->retry_clients = eina_list_remove(e_comp->x_comp_data->retry_clients, (uintptr_t*)(unsigned long)ev->win); + if (!e_comp->x_comp_data->retry_clients) + E_FREE_FUNC(e_comp->x_comp_data->retry_timer, ecore_timer_del); return ECORE_CALLBACK_PASS_ON; } if ((!ec->visible) || (ec->hidden && ec->unredirected_single)) @@ -2017,27 +2003,25 @@ _e_comp_x_state_request(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_X_Ev static Eina_Bool _e_comp_x_mapping_change(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_X_Event_Mapping_Change *ev EINA_UNUSED) { - const Eina_List *l, *ll; + const Eina_List *l; E_Client *ec; - E_Comp *c; if (_e_comp_x_mapping_change_disabled) return ECORE_CALLBACK_RENEW; e_managers_keys_ungrab(); - EINA_LIST_FOREACH(e_comp_list(), l, c) - EINA_LIST_FOREACH(c->clients, ll, ec) - { - Ecore_X_Window win; + EINA_LIST_FOREACH(e_comp->clients, l, ec) + { + Ecore_X_Window win; - if (e_pixmap_type_get(ec->pixmap) != E_PIXMAP_TYPE_X) continue; - win = e_client_util_pwin_get(ec); - if ((!ec->comp_data->first_map) || (!ec->comp_data->reparented)) continue; - _e_comp_x_focus_setdown(ec); - e_bindings_mouse_ungrab(E_BINDING_CONTEXT_WINDOW, win); - e_bindings_wheel_ungrab(E_BINDING_CONTEXT_WINDOW, win); - e_bindings_mouse_grab(E_BINDING_CONTEXT_WINDOW, win); - e_bindings_wheel_grab(E_BINDING_CONTEXT_WINDOW, win); - _e_comp_x_focus_setup(ec); - } + if (e_pixmap_type_get(ec->pixmap) != E_PIXMAP_TYPE_X) continue; + win = e_client_util_pwin_get(ec); + if ((!ec->comp_data->first_map) || (!ec->comp_data->reparented)) continue; + _e_comp_x_focus_setdown(ec); + e_bindings_mouse_ungrab(E_BINDING_CONTEXT_WINDOW, win); + e_bindings_wheel_ungrab(E_BINDING_CONTEXT_WINDOW, win); + e_bindings_mouse_grab(E_BINDING_CONTEXT_WINDOW, win); + e_bindings_wheel_grab(E_BINDING_CONTEXT_WINDOW, win); + _e_comp_x_focus_setup(ec); + } e_managers_keys_grab(); return ECORE_CALLBACK_PASS_ON; } @@ -4625,16 +4609,15 @@ _e_comp_x_xinerama_setup(int rw, int rh) } static void -_e_comp_x_ee_resize(Ecore_Evas *ee) +_e_comp_x_ee_resize(Ecore_Evas *ee EINA_UNUSED) { E_Client *ec; - E_Comp *c = ecore_evas_data_get(ee, "comp"); - ecore_x_netwm_desk_size_set(c->man->root, c->man->w, c->man->h); - _e_comp_x_xinerama_setup(c->man->w, c->man->h); + ecore_x_netwm_desk_size_set(e_comp->man->root, e_comp->man->w, e_comp->man->h); + _e_comp_x_xinerama_setup(e_comp->man->w, e_comp->man->h); - e_comp_canvas_update(c); - E_CLIENT_FOREACH(c, ec) + e_comp_canvas_update(); + E_CLIENT_FOREACH(e_comp, ec) { if (!e_client_util_ignored_get(ec)) _e_comp_x_client_zone_geometry_set(ec); @@ -4856,72 +4839,61 @@ _e_comp_x_desklock_key_down(E_Comp *comp, int t EINA_UNUSED, Ecore_Event_Key *ev static void _e_comp_x_desklock_hide(void) { - E_Comp *comp; - const Eina_List *l; - - EINA_LIST_FOREACH(e_comp_list(), l, comp) + if (e_comp->x_comp_data->lock_win) { - if (comp->x_comp_data->lock_win) - { - e_grabinput_release(comp->x_comp_data->lock_win, comp->x_comp_data->lock_win); - ecore_x_window_free(comp->x_comp_data->lock_win); - comp->x_comp_data->lock_win = 0; - } - - if (comp->x_comp_data->lock_grab_break_wnd) - ecore_x_window_show(comp->x_comp_data->lock_grab_break_wnd); - comp->x_comp_data->lock_grab_break_wnd = 0; - E_FREE_FUNC(comp->x_comp_data->lock_key_handler, ecore_event_handler_del); - e_comp_override_del(comp); + e_grabinput_release(e_comp->x_comp_data->lock_win, e_comp->x_comp_data->lock_win); + ecore_x_window_free(e_comp->x_comp_data->lock_win); + e_comp->x_comp_data->lock_win = 0; } + + if (e_comp->x_comp_data->lock_grab_break_wnd) + ecore_x_window_show(e_comp->x_comp_data->lock_grab_break_wnd); + e_comp->x_comp_data->lock_grab_break_wnd = 0; + E_FREE_FUNC(e_comp->x_comp_data->lock_key_handler, ecore_event_handler_del); + e_comp_override_del(e_comp); } static Eina_Bool _e_comp_x_desklock_show(void) { - E_Comp *comp; - const Eina_List *l; + Ecore_X_Window win; - EINA_LIST_FOREACH(e_comp_list(), l, comp) + win = e_comp->x_comp_data->lock_win = + ecore_x_window_input_new(e_comp->man->root, 0, 0, 1, 1); + ecore_x_window_show(win); + if (!e_grabinput_get(win, 0, win)) { - Ecore_X_Window win; + Ecore_X_Window *windows; + int wnum, i; - win = comp->x_comp_data->lock_win = - ecore_x_window_input_new(comp->man->root, 0, 0, 1, 1); - ecore_x_window_show(win); - if (!e_grabinput_get(win, 0, win)) + windows = ecore_x_window_children_get(e_comp->man->root, &wnum); + if (!windows) goto fail; + for (i = 0; i < wnum; i++) { - Ecore_X_Window *windows; - int wnum, i; + Ecore_X_Window_Attributes att; - windows = ecore_x_window_children_get(comp->man->root, &wnum); - if (!windows) goto fail; - for (i = 0; i < wnum; i++) + memset(&att, 0, sizeof(Ecore_X_Window_Attributes)); + ecore_x_window_attributes_get(windows[i], &att); + if (att.visible) { - Ecore_X_Window_Attributes att; - - memset(&att, 0, sizeof(Ecore_X_Window_Attributes)); - ecore_x_window_attributes_get(windows[i], &att); - if (att.visible) + ecore_x_window_hide(windows[i]); + if (e_grabinput_get(win, 0, win)) { - ecore_x_window_hide(windows[i]); - if (e_grabinput_get(win, 0, win)) - { - comp->x_comp_data->lock_grab_break_wnd = windows[i]; - free(windows); - goto works; - } - ecore_x_window_show(windows[i]); + e_comp->x_comp_data->lock_grab_break_wnd = windows[i]; + free(windows); + goto works; } + ecore_x_window_show(windows[i]); } - free(windows); } -works: - e_comp_override_add(comp); - e_comp_ignore_win_add(E_PIXMAP_TYPE_X, comp->x_comp_data->lock_win); - comp->x_comp_data->lock_key_handler = - ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, (Ecore_Event_Handler_Cb)_e_comp_x_desklock_key_down, comp); + free(windows); } +works: + e_comp_override_add(e_comp); + e_comp_ignore_win_add(E_PIXMAP_TYPE_X, e_comp->x_comp_data->lock_win); + e_comp->x_comp_data->lock_key_handler = + ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, (Ecore_Event_Handler_Cb)_e_comp_x_desklock_key_down, e_comp); + return EINA_TRUE; fail: /* everything failed - can't lock */ diff --git a/src/bin/e_desk.c b/src/bin/e_desk.c index 58f221174..52075c571 100644 --- a/src/bin/e_desk.c +++ b/src/bin/e_desk.c @@ -173,45 +173,41 @@ e_desk_name_del(int manager, int zone, int desk_x, int desk_y) EAPI void e_desk_name_update(void) { - const Eina_List *z, *l, *ll; - E_Comp *c; + const Eina_List *z, *l; E_Zone *zone; E_Desk *desk; E_Config_Desktop_Name *cfname; int d_x, d_y, ok; char name[40]; - EINA_LIST_FOREACH(e_comp_list(), l, c) + EINA_LIST_FOREACH(e_comp->zones, z, zone) { - EINA_LIST_FOREACH(c->zones, z, zone) + for (d_x = 0; d_x < zone->desk_x_count; d_x++) { - for (d_x = 0; d_x < zone->desk_x_count; d_x++) + for (d_y = 0; d_y < zone->desk_y_count; d_y++) { - for (d_y = 0; d_y < zone->desk_y_count; d_y++) + desk = zone->desks[d_x + zone->desk_x_count * d_y]; + ok = 0; + + EINA_LIST_FOREACH(e_config->desktop_names, l, cfname) { - desk = zone->desks[d_x + zone->desk_x_count * d_y]; - ok = 0; + if ((cfname->manager >= 0) && + ((int)e_comp->num != cfname->manager)) continue; + if ((cfname->zone >= 0) && + ((int)zone->num != cfname->zone)) continue; + if ((cfname->desk_x != d_x) || + (cfname->desk_y != d_y)) continue; + e_desk_name_set(desk, cfname->name); + ok = 1; + break; + } - EINA_LIST_FOREACH(e_config->desktop_names, ll, cfname) - { - if ((cfname->manager >= 0) && - ((int)c->num != cfname->manager)) continue; - if ((cfname->zone >= 0) && - ((int)zone->num != cfname->zone)) continue; - if ((cfname->desk_x != d_x) || - (cfname->desk_y != d_y)) continue; - e_desk_name_set(desk, cfname->name); - ok = 1; - break; - } - - if (!ok) - { - snprintf(name, sizeof(name), - _(e_config->desktop_default_name), - d_x, d_y); - e_desk_name_set(desk, name); - } + if (!ok) + { + snprintf(name, sizeof(name), + _(e_config->desktop_default_name), + d_x, d_y); + e_desk_name_set(desk, name); } } } @@ -615,8 +611,7 @@ e_desk_window_profile_del(int manager, EAPI void e_desk_window_profile_update(void) { - const Eina_List *z, *l, *ll; - E_Comp *c; + const Eina_List *z, *l; E_Zone *zone; E_Desk *desk; E_Config_Desktop_Window_Profile *cfprof; @@ -627,35 +622,32 @@ e_desk_window_profile_update(void) if (!(e_config->use_desktop_window_profile)) return; - EINA_LIST_FOREACH(e_comp_list(), l, c) + EINA_LIST_FOREACH(e_comp->zones, z, zone) { - EINA_LIST_FOREACH(c->zones, z, zone) + for (d_x = 0; d_x < zone->desk_x_count; d_x++) { - for (d_x = 0; d_x < zone->desk_x_count; d_x++) + for (d_y = 0; d_y < zone->desk_y_count; d_y++) { - for (d_y = 0; d_y < zone->desk_y_count; d_y++) + desk = zone->desks[d_x + zone->desk_x_count * d_y]; + ok = 0; + + EINA_LIST_FOREACH(e_config->desktop_window_profiles, l, cfprof) { - desk = zone->desks[d_x + zone->desk_x_count * d_y]; - ok = 0; + if ((cfprof->manager >= 0) && + ((int)e_comp->num != cfprof->manager)) continue; + if ((cfprof->zone >= 0) && + ((int)zone->num != cfprof->zone)) continue; + if ((cfprof->desk_x != d_x) || + (cfprof->desk_y != d_y)) continue; + e_desk_window_profile_set(desk, cfprof->profile); + ok = 1; + break; + } - EINA_LIST_FOREACH(e_config->desktop_window_profiles, ll, cfprof) - { - if ((cfprof->manager >= 0) && - ((int)c->num != cfprof->manager)) continue; - if ((cfprof->zone >= 0) && - ((int)zone->num != cfprof->zone)) continue; - if ((cfprof->desk_x != d_x) || - (cfprof->desk_y != d_y)) continue; - e_desk_window_profile_set(desk, cfprof->profile); - ok = 1; - break; - } - - if (!ok) - { - e_desk_window_profile_set - (desk, e_config->desktop_default_window_profile); - } + if (!ok) + { + e_desk_window_profile_set + (desk, e_config->desktop_default_window_profile); } } } diff --git a/src/bin/e_desklock.c b/src/bin/e_desklock.c index f03edc9e8..b0d8b3e8b 100644 --- a/src/bin/e_desklock.c +++ b/src/bin/e_desklock.c @@ -209,7 +209,6 @@ EAPI int e_desklock_show(Eina_Bool suspend) { const Eina_List *l; - E_Comp *comp; E_Event_Desklock *ev; E_Desklock_Show_Cb show_cb; E_Desklock_Hide_Cb hide_cb; @@ -263,17 +262,16 @@ e_desklock_show(Eina_Bool suspend) if (!show_cb()) goto fail; } - EINA_LIST_FOREACH(e_comp_list(), l, comp) - { - Evas_Object *o; + { + Evas_Object *o; - o = evas_object_rectangle_add(comp->evas); - block_rects = eina_list_append(block_rects, o); - evas_object_color_set(o, 0, 0, 0, 255); - evas_object_resize(o, comp->man->w, comp->man->h); - evas_object_layer_set(o, E_LAYER_DESKLOCK); - evas_object_show(o); - } + o = evas_object_rectangle_add(e_comp->evas); + block_rects = eina_list_append(block_rects, o); + evas_object_color_set(o, 0, 0, 0, 255); + evas_object_resize(o, e_comp->man->w, e_comp->man->h); + evas_object_layer_set(o, E_LAYER_DESKLOCK); + evas_object_show(o); + } if (e_config->desklock_language) e_intl_language_set(e_config->desklock_language); @@ -335,8 +333,8 @@ e_desklock_hide(void) if ((!_e_desklock_state) && (!_e_custom_desklock_exe)) return; - E_LIST_FOREACH(e_comp_list(), e_comp_override_del); - E_LIST_FOREACH(e_comp_list(), e_comp_shape_queue); + e_comp_override_del(e_comp); + e_comp_shape_queue(e_comp); E_FREE_LIST(block_rects, evas_object_del); //e_comp_block_window_del(); if (e_config->desklock_language) diff --git a/src/bin/e_dnd.c b/src/bin/e_dnd.c index cd006da19..65dc8306f 100644 --- a/src/bin/e_dnd.c +++ b/src/bin/e_dnd.c @@ -103,11 +103,6 @@ _e_drop_handler_active_check(E_Drop_Handler *h, const E_Drag *drag, Eina_Strings EINTERN int e_dnd_init(void) { -#ifndef HAVE_WAYLAND_ONLY - E_Comp *c; - const Eina_List *l; -#endif - _type_text_uri_list = eina_stringshare_add("text/uri-list"); _type_xds = eina_stringshare_add("XdndDirectSave0"); _type_text_x_moz_url = eina_stringshare_add("text/x-moz-url"); @@ -135,8 +130,7 @@ e_dnd_init(void) E_LIST_HANDLER_APPEND(_event_handlers, ECORE_X_EVENT_SELECTION_NOTIFY, _e_dnd_cb_event_dnd_selection, NULL); E_LIST_HANDLER_APPEND(_event_handlers, ECORE_X_EVENT_WINDOW_HIDE, _e_dnd_cb_event_hide, NULL); - EINA_LIST_FOREACH(e_comp_list(), l, c) - e_drop_xdnd_register_set(c->ee_win, 1); + e_drop_xdnd_register_set(e_comp->ee_win, 1); _action = ECORE_X_ATOM_XDND_ACTION_PRIVATE; #endif diff --git a/src/bin/e_exec.c b/src/bin/e_exec.c index 81a7bdaa4..a1140b0e9 100644 --- a/src/bin/e_exec.c +++ b/src/bin/e_exec.c @@ -160,22 +160,20 @@ e_exec(E_Zone *zone, Efreet_Desktop *desktop, const char *exec, if (dosingle) { - const Eina_List *l, *ll; + const Eina_List *l; E_Client *ec; - E_Comp *c; - EINA_LIST_FOREACH(e_comp_list(), l, c) - EINA_LIST_FOREACH(c->clients, ll, ec) - { - if (ec && (ec->desktop == desktop)) - { - if (!ec->focused) - e_client_activate(ec, EINA_TRUE); - else - evas_object_raise(ec->frame); - return NULL; - } - } + EINA_LIST_FOREACH(e_comp->clients, l, ec) + { + if (ec && (ec->desktop == desktop)) + { + if (!ec->focused) + e_client_activate(ec, EINA_TRUE); + else + evas_object_raise(ec->frame); + return NULL; + } + } } } } diff --git a/src/bin/e_font.c b/src/bin/e_font.c index 0079d374e..43aa7f235 100644 --- a/src/bin/e_font.c +++ b/src/bin/e_font.c @@ -25,9 +25,8 @@ EAPI void e_font_apply(void) { char buf[1024]; - const Eina_List *l, *ll; + const Eina_List *l; E_Client *ec; - E_Comp *c; E_Font_Default *efd; E_Font_Fallback *eff; int blen, len; @@ -73,9 +72,9 @@ e_font_apply(void) } /* Update clients */ - EINA_LIST_FOREACH(e_comp_list(), l, c) - EINA_LIST_FOREACH(c->clients, ll, ec) - e_client_frame_recalc(ec); + if (!e_comp) return; + EINA_LIST_FOREACH(e_comp->clients, l, ec) + e_client_frame_recalc(ec); } EAPI Eina_List * diff --git a/src/bin/e_gadcon.c b/src/bin/e_gadcon.c index 8e10b1ded..db5ef4b5d 100644 --- a/src/bin/e_gadcon.c +++ b/src/bin/e_gadcon.c @@ -5764,8 +5764,7 @@ _e_gadcon_location_change(E_Gadcon_Client *gcc, E_Gadcon_Location *src, E_Gadcon EAPI Eina_Bool e_gadcon_client_visible_get(const E_Gadcon_Client *gcc, const E_Desk *desk) { - const Eina_List *l, *ll; - E_Comp *c; + const Eina_List *l; E_Zone *zone; if (!gcc->gadcon) return EINA_FALSE; @@ -5775,17 +5774,15 @@ e_gadcon_client_visible_get(const E_Gadcon_Client *gcc, const E_Desk *desk) return EINA_TRUE; // FIXME for when gadman allows per-desk gadgets case E_GADCON_SITE_SHELF: if (desk) return e_shelf_desk_visible(gcc->gadcon->shelf, desk); - EINA_LIST_FOREACH(e_comp_list(), l, c) - EINA_LIST_FOREACH(c->zones, ll, zone) - if (e_shelf_desk_visible(gcc->gadcon->shelf, e_desk_current_get(zone))) - return EINA_TRUE; + EINA_LIST_FOREACH(e_comp->zones, l, zone) + if (e_shelf_desk_visible(gcc->gadcon->shelf, e_desk_current_get(zone))) + return EINA_TRUE; break; case E_GADCON_SITE_TOOLBAR: case E_GADCON_SITE_EFM_TOOLBAR: if (desk) return (e_win_client_get(gcc->gadcon->toolbar->fwin)->desk == desk); - EINA_LIST_FOREACH(e_comp_list(), l, c) - EINA_LIST_FOREACH(c->zones, ll, zone) - if (e_win_client_get(gcc->gadcon->toolbar->fwin)->desk == e_desk_current_get(zone)) return EINA_TRUE; + EINA_LIST_FOREACH(e_comp->zones, l, zone) + if (e_win_client_get(gcc->gadcon->toolbar->fwin)->desk == e_desk_current_get(zone)) return EINA_TRUE; default: break; } diff --git a/src/bin/e_hints.c b/src/bin/e_hints.c index cc6d25abe..ba1260a51 100644 --- a/src/bin/e_hints.c +++ b/src/bin/e_hints.c @@ -333,63 +333,57 @@ e_hints_client_stacking_set(void) { #ifdef HAVE_WAYLAND_ONLY #else - E_Comp *comp; - const Eina_List *l; + unsigned int c, i = 0, non_x = 0; + Ecore_X_Window *clients = NULL; #define CLIENT_STACK_DEBUG /* Get client count */ - EINA_LIST_FOREACH(e_comp_list(), l, comp) + c = e_clients_count(e_comp); + if (c) { - unsigned int c, i = 0, non_x = 0; - Ecore_X_Window *clients = NULL; - - c = e_clients_count(comp); - if (c) + E_Client *ec; +#ifdef CLIENT_STACK_DEBUG + Eina_List *ll = NULL; +#endif + clients = calloc(c, sizeof(Ecore_X_Window)); + E_CLIENT_FOREACH(e_comp, ec) { - E_Client *ec; -#ifdef CLIENT_STACK_DEBUG - Eina_List *ll = NULL; -#endif - clients = calloc(c, sizeof(Ecore_X_Window)); - E_CLIENT_FOREACH(comp, ec) + if (e_pixmap_type_get(ec->pixmap) != E_PIXMAP_TYPE_X) { - if (e_pixmap_type_get(ec->pixmap) != E_PIXMAP_TYPE_X) - { - non_x++; - continue; - } - clients[i++] = e_client_util_win_get(ec); -#ifdef CLIENT_STACK_DEBUG - ll = eina_list_append(ll, ec); -#endif - if (i > c) - { - CRI("Window list size greater than window count."); - break; - } + non_x++; + continue; } - - if (i < c - non_x) - { + clients[i++] = e_client_util_win_get(ec); #ifdef CLIENT_STACK_DEBUG - Eina_List *lll = eina_list_clone(comp->clients); - - EINA_LIST_FREE(ll, ec) - lll = eina_list_remove(lll, ec); - EINA_LIST_FREE(lll, ec) - WRN("Missing %p: %snew client", ec, ec->new_client ? "" : "not "); + ll = eina_list_append(ll, ec); #endif - CRI("Window list size less than window count."); + if (i > c) + { + CRI("Window list size greater than window count."); + break; } } - /* XXX: it should be "more correct" to be setting the stacking atom as "windows per root" - * since any apps using it are probably not going to want windows from other screens - * to be returned in the list - */ - if (i <= c) - ecore_x_netwm_client_list_stacking_set(comp->man->root, clients, c); - free(clients); + + if (i < c - non_x) + { +#ifdef CLIENT_STACK_DEBUG + Eina_List *lll = eina_list_clone(e_comp->clients); + + EINA_LIST_FREE(ll, ec) + lll = eina_list_remove(lll, ec); + EINA_LIST_FREE(lll, ec) + WRN("Missing %p: %snew client", ec, ec->new_client ? "" : "not "); +#endif + CRI("Window list size less than window count."); + } } + /* XXX: it should be "more correct" to be setting the stacking atom as "windows per root" + * since any apps using it are probably not going to want windows from other screens + * to be returned in the list + */ + if (i <= c) + ecore_x_netwm_client_list_stacking_set(e_comp->man->root, clients, c); + free(clients); #endif } @@ -1630,13 +1624,10 @@ e_hints_scale_update(void) { #ifdef HAVE_WAYLAND_ONLY #else - E_Comp *c; - const Eina_List *l; unsigned int scale = e_scale * 1000; - EINA_LIST_FOREACH(e_comp_list(), l, c) - if (c->man->root) - ecore_x_window_prop_card32_set(c->man->root, ATM_ENLIGHTENMENT_SCALE, &scale, 1); + if (e_comp->man->root) + ecore_x_window_prop_card32_set(e_comp->man->root, ATM_ENLIGHTENMENT_SCALE, &scale, 1); #endif } diff --git a/src/bin/e_init.c b/src/bin/e_init.c index a7e3fd5c0..60c8a6143 100644 --- a/src/bin/e_init.c +++ b/src/bin/e_init.c @@ -45,28 +45,13 @@ EAPI void e_init_show(void) { Evas_Object *o; - E_Comp *c; E_Zone *zone; Eina_List *l; /* exec init */ - /* extra screens */ - EINA_LIST_FOREACH(e_comp_list()->next, l, c) + EINA_LIST_FOREACH(e_comp->zones, l, zone) { - o = edje_object_add(c->evas); - e_theme_edje_object_set(o, NULL, "e/init/extra_screen"); - evas_object_name_set(o, "_e_init_extra_screen"); - evas_object_move(o, 0, 0); - evas_object_resize(o, c->man->w, c->man->h); - evas_object_layer_set(o, E_LAYER_MAX); - evas_object_show(o); - splash_objs = eina_list_append(splash_objs, o); - } - - c = eina_list_data_get(e_comp_list()); - EINA_LIST_FOREACH(c->zones, l, zone) - { - o = edje_object_add(c->evas); + o = edje_object_add(e_comp->evas); if (!zone->num) { e_theme_edje_object_set(o, NULL, "e/init/splash"); @@ -99,7 +84,7 @@ EAPI void e_init_hide(void) { E_FREE_LIST(splash_objs, evas_object_del); - E_LIST_FOREACH(e_comp_list(), e_comp_shape_queue); + e_comp_shape_queue(e_comp); _e_init_object = NULL; E_FREE_FUNC(_e_init_timeout_timer, ecore_timer_del); } diff --git a/src/bin/e_int_client_remember.c b/src/bin/e_int_client_remember.c index 0012c15e5..cdac8761f 100644 --- a/src/bin/e_int_client_remember.c +++ b/src/bin/e_int_client_remember.c @@ -358,54 +358,52 @@ _warning_dialog_show(void) static int _check_matches(E_Remember *rem, int update) { - const Eina_List *l, *ll; + const Eina_List *l; E_Client *ec; - E_Comp *c; const char *title; int n = 0; - EINA_LIST_FOREACH(e_comp_list(), l, c) - EINA_LIST_FOREACH(c->clients, ll, ec) - { - int match = rem->match; - title = e_client_util_name_get(ec); + EINA_LIST_FOREACH(e_comp->clients, l, ec) + { + int match = rem->match; + title = e_client_util_name_get(ec); - if ((match & E_REMEMBER_MATCH_NAME) && - (e_util_glob_match(ec->icccm.name, rem->name))) - match &= ~E_REMEMBER_MATCH_NAME; + if ((match & E_REMEMBER_MATCH_NAME) && + (e_util_glob_match(ec->icccm.name, rem->name))) + match &= ~E_REMEMBER_MATCH_NAME; - if ((match & E_REMEMBER_MATCH_CLASS) && - (e_util_glob_match(ec->icccm.class, rem->class))) - match &= ~E_REMEMBER_MATCH_CLASS; + if ((match & E_REMEMBER_MATCH_CLASS) && + (e_util_glob_match(ec->icccm.class, rem->class))) + match &= ~E_REMEMBER_MATCH_CLASS; - if ((match & E_REMEMBER_MATCH_TITLE) && - (e_util_glob_match(title, rem->title))) - match &= ~E_REMEMBER_MATCH_TITLE; + if ((match & E_REMEMBER_MATCH_TITLE) && + (e_util_glob_match(title, rem->title))) + match &= ~E_REMEMBER_MATCH_TITLE; - if ((match & E_REMEMBER_MATCH_ROLE) && - ((!e_util_strcmp(rem->role, ec->icccm.window_role)) || - (e_util_both_str_empty(rem->role, ec->icccm.window_role)))) - match &= ~E_REMEMBER_MATCH_ROLE; + if ((match & E_REMEMBER_MATCH_ROLE) && + ((!e_util_strcmp(rem->role, ec->icccm.window_role)) || + (e_util_both_str_empty(rem->role, ec->icccm.window_role)))) + match &= ~E_REMEMBER_MATCH_ROLE; - if ((match & E_REMEMBER_MATCH_TYPE) && - (rem->type == (int)ec->netwm.type)) - match &= ~E_REMEMBER_MATCH_TYPE; + if ((match & E_REMEMBER_MATCH_TYPE) && + (rem->type == (int)ec->netwm.type)) + match &= ~E_REMEMBER_MATCH_TYPE; - if ((match & E_REMEMBER_MATCH_TRANSIENT) && - ((rem->transient && ec->icccm.transient_for != 0) || - (!rem->transient && (ec->icccm.transient_for == 0)))) - match &= ~E_REMEMBER_MATCH_TRANSIENT; + if ((match & E_REMEMBER_MATCH_TRANSIENT) && + ((rem->transient && ec->icccm.transient_for != 0) || + (!rem->transient && (ec->icccm.transient_for == 0)))) + match &= ~E_REMEMBER_MATCH_TRANSIENT; - if (match == 0) n++; + if (match == 0) n++; - if (update) - { - ec->changed = 1; - ec->changes.icon = 1; - } - else if (n > 1) - break; - } + if (update) + { + ec->changed = 1; + ec->changes.icon = 1; + } + else if (n > 1) + break; + } return n; } diff --git a/src/bin/e_main.c b/src/bin/e_main.c index f8eb64d12..34a11eb26 100644 --- a/src/bin/e_main.c +++ b/src/bin/e_main.c @@ -1589,47 +1589,39 @@ _e_main_screens_shutdown(void) static void _e_main_desk_save(void) { - E_Comp *c; const Eina_List *l; char env[1024], name[1024]; + E_Zone *zone; - EINA_LIST_FOREACH(e_comp_list(), l, c) + EINA_LIST_FOREACH(e_comp->zones, l, zone) { - Eina_List *zl; - E_Zone *zone; - - EINA_LIST_FOREACH(c->zones, zl, zone) - { - snprintf(name, sizeof(name), "DESK_%d_%d", c->num, zone->num); - snprintf(env, sizeof(env), "%d,%d", zone->desk_x_current, zone->desk_y_current); - e_util_env_set(name, env); - } + snprintf(name, sizeof(name), "DESK_%d_%d", e_comp->num, zone->num); + snprintf(env, sizeof(env), "%d,%d", zone->desk_x_current, zone->desk_y_current); + e_util_env_set(name, env); } } static void _e_main_desk_restore(void) { - E_Comp *c; - const Eina_List *l, *ll; + const Eina_List *l; E_Zone *zone; char *env; char name[1024]; - EINA_LIST_FOREACH(e_comp_list(), l, c) - EINA_LIST_FOREACH(c->zones, ll, zone) - { - E_Desk *desk; - int desk_x, desk_y; + EINA_LIST_FOREACH(e_comp->zones, l, zone) + { + E_Desk *desk; + int desk_x, desk_y; - snprintf(name, sizeof(name), "DESK_%d_%d", c->num, zone->num); - env = getenv(name); - if (!env) continue; - if (!sscanf(env, "%d,%d", &desk_x, &desk_y)) continue; - desk = e_desk_at_xy_get(zone, desk_x, desk_y); - if (!desk) continue; - e_desk_show(desk); - } + snprintf(name, sizeof(name), "DESK_%d_%d", e_comp->num, zone->num); + env = getenv(name); + if (!env) continue; + if (!sscanf(env, "%d,%d", &desk_x, &desk_y)) continue; + desk = e_desk_at_xy_get(zone, desk_x, desk_y); + if (!desk) continue; + e_desk_show(desk); + } } static void diff --git a/src/bin/e_msgbus.c b/src/bin/e_msgbus.c index d253b65a7..5f3c47892 100644 --- a/src/bin/e_msgbus.c +++ b/src/bin/e_msgbus.c @@ -424,8 +424,7 @@ static Eldbus_Message * _e_msgbus_window_list_cb(const Eldbus_Service_Interface *iface __UNUSED__, const Eldbus_Message *msg) { - const Eina_List *l, *ll; - E_Comp *c; + const Eina_List *l; E_Client *ec; Eldbus_Message *reply; Eldbus_Message_Iter *main_iter, *array; @@ -439,19 +438,18 @@ _e_msgbus_window_list_cb(const Eldbus_Service_Interface *iface __UNUSED__, eldbus_message_iter_arguments_append(main_iter, "a(si)", &array); EINA_SAFETY_ON_FALSE_RETURN_VAL(array, reply); - EINA_LIST_FOREACH(e_comp_list(), l, c) - EINA_LIST_FOREACH(c->clients, ll, ec) - { - Eldbus_Message_Iter *s; + EINA_LIST_FOREACH(e_comp->clients, l, ec) + { + Eldbus_Message_Iter *s; - if (e_client_util_ignored_get(ec)) continue; + if (e_client_util_ignored_get(ec)) continue; - eldbus_message_iter_arguments_append(array, "(si)", &s); - if (!s) continue; - eldbus_message_iter_arguments_append(s, "si", ec->icccm.name, - e_client_util_win_get(ec)); - eldbus_message_iter_container_close(array, s); - } + eldbus_message_iter_arguments_append(array, "(si)", &s); + if (!s) continue; + eldbus_message_iter_arguments_append(s, "si", ec->icccm.name, + e_client_util_win_get(ec)); + eldbus_message_iter_container_close(array, s); + } eldbus_message_iter_container_close(main_iter, array); return reply; diff --git a/src/bin/e_remember.c b/src/bin/e_remember.c index f4f4fea57..b5d062302 100644 --- a/src/bin/e_remember.c +++ b/src/bin/e_remember.c @@ -89,10 +89,9 @@ e_remember_shutdown(void) EAPI void e_remember_internal_save(void) { - const Eina_List *l, *ll; + const Eina_List *l; E_Client *ec; E_Remember *rem; - E_Comp *c; //printf("internal save %d\n", restart); if (!remembers) @@ -104,28 +103,27 @@ e_remember_internal_save(void) remember_idler_list = eina_list_free(remember_idler_list); } - EINA_LIST_FOREACH(e_comp_list(), l, c) - EINA_LIST_FOREACH(c->clients, ll, ec) - { - if ((!ec->internal) || e_client_util_ignored_get(ec)) continue; + EINA_LIST_FOREACH(e_comp->clients, l, ec) + { + if ((!ec->internal) || e_client_util_ignored_get(ec)) continue; - rem = E_NEW(E_Remember, 1); - if (!rem) break; + rem = E_NEW(E_Remember, 1); + if (!rem) break; - e_remember_default_match_set(rem, ec); - rem->apply = (E_REMEMBER_APPLY_POS | E_REMEMBER_APPLY_SIZE | - E_REMEMBER_APPLY_BORDER | E_REMEMBER_APPLY_LAYER | - E_REMEMBER_APPLY_SHADE | E_REMEMBER_APPLY_ZONE | - E_REMEMBER_APPLY_DESKTOP | E_REMEMBER_APPLY_LOCKS | - E_REMEMBER_APPLY_SKIP_WINLIST | - E_REMEMBER_APPLY_SKIP_PAGER | - E_REMEMBER_APPLY_SKIP_TASKBAR | - E_REMEMBER_APPLY_OFFER_RESISTANCE | - E_REMEMBER_APPLY_OPACITY); - _e_remember_update(ec, rem); + e_remember_default_match_set(rem, ec); + rem->apply = (E_REMEMBER_APPLY_POS | E_REMEMBER_APPLY_SIZE | + E_REMEMBER_APPLY_BORDER | E_REMEMBER_APPLY_LAYER | + E_REMEMBER_APPLY_SHADE | E_REMEMBER_APPLY_ZONE | + E_REMEMBER_APPLY_DESKTOP | E_REMEMBER_APPLY_LOCKS | + E_REMEMBER_APPLY_SKIP_WINLIST | + E_REMEMBER_APPLY_SKIP_PAGER | + E_REMEMBER_APPLY_SKIP_TASKBAR | + E_REMEMBER_APPLY_OFFER_RESISTANCE | + E_REMEMBER_APPLY_OPACITY); + _e_remember_update(ec, rem); - remembers->list = eina_list_append(remembers->list, rem); - } + remembers->list = eina_list_append(remembers->list, rem); + } e_config_domain_save("e_remember_restart", e_remember_list_edd, remembers); } @@ -247,18 +245,16 @@ e_remember_unuse(E_Remember *rem) EAPI void e_remember_del(E_Remember *rem) { - const Eina_List *l, *ll; + const Eina_List *l; E_Client *ec; - E_Comp *c; - EINA_LIST_FOREACH(e_comp_list(), l, c) - EINA_LIST_FOREACH(c->clients, ll, ec) - { - if (ec->remember != rem) continue; + EINA_LIST_FOREACH(e_comp->clients, l, ec) + { + if (ec->remember != rem) continue; - ec->remember = NULL; - e_remember_unuse(rem); - } + ec->remember = NULL; + e_remember_unuse(rem); + } _e_remember_free(rem); } diff --git a/src/bin/e_sys.c b/src/bin/e_sys.c index ce001ab15..d7f7e4802 100644 --- a/src/bin/e_sys.c +++ b/src/bin/e_sys.c @@ -70,8 +70,7 @@ _e_sys_comp_done_cb(void *data, Evas_Object *obj, const char *sig, const char *s static Eina_Bool _e_sys_comp_action_timeout(void *data) { - const Eina_List *l, *ll; - E_Comp *c; + const Eina_List *l; E_Zone *zone; E_Sys_Action a = (long)(intptr_t)data; const char *sig = NULL; @@ -99,9 +98,8 @@ _e_sys_comp_action_timeout(void *data) E_FREE_FUNC(action_timeout, ecore_timer_del); if (sig) { - EINA_LIST_FOREACH(e_comp_list(), l, c) - EINA_LIST_FOREACH(c->zones, ll, zone) - edje_object_signal_callback_del(zone->over, sig, "e", _e_sys_comp_done_cb); + EINA_LIST_FOREACH(e_comp->zones, l, zone) + edje_object_signal_callback_del(zone->over, sig, "e", _e_sys_comp_done_cb); } e_sys_action_raw_do(a, NULL); return EINA_FALSE; @@ -110,24 +108,20 @@ _e_sys_comp_action_timeout(void *data) static void _e_sys_comp_emit_cb_wait(E_Sys_Action a, const char *sig, const char *rep, Eina_Bool nocomp_push) { - const Eina_List *l, *ll; + const Eina_List *l; E_Zone *zone; - E_Comp *c; Eina_Bool first = EINA_TRUE; - EINA_LIST_FOREACH(e_comp_list(), l, c) + if (nocomp_push) e_comp_override_add(e_comp); + else e_comp_override_timed_pop(e_comp); + EINA_LIST_FOREACH(e_comp->zones, l, zone) { - if (nocomp_push) e_comp_override_add(c); - else e_comp_override_timed_pop(c); - EINA_LIST_FOREACH(c->zones, ll, zone) - { - e_zone_fade_handle(zone, nocomp_push, 0.5); - edje_object_signal_emit(zone->base, sig, "e"); - edje_object_signal_emit(zone->over, sig, "e"); - if ((rep) && (first)) - edje_object_signal_callback_add(zone->over, rep, "e", _e_sys_comp_done_cb, (void *)(long)a); - first = EINA_FALSE; - } + e_zone_fade_handle(zone, nocomp_push, 0.5); + edje_object_signal_emit(zone->base, sig, "e"); + edje_object_signal_emit(zone->over, sig, "e"); + if ((rep) && (first)) + edje_object_signal_callback_add(zone->over, rep, "e", _e_sys_comp_done_cb, (void *)(long)a); + first = EINA_FALSE; } if (rep) { @@ -169,11 +163,7 @@ _e_sys_comp_logout(void) static void _e_sys_comp_resume(void) { - const Eina_List *l; - E_Comp *c; - - EINA_LIST_FOREACH(e_comp_list(), l, c) - evas_damage_rectangle_add(c->evas, 0, 0, c->man->w, c->man->h); + evas_damage_rectangle_add(e_comp->evas, 0, 0, e_comp->man->w, e_comp->man->h); _e_sys_comp_emit_cb_wait(E_SYS_SUSPEND, "e,state,sys,resume", NULL, EINA_FALSE); e_screensaver_deactivate(); } @@ -664,17 +654,14 @@ _e_sys_logout_confirm_dialog_update(int remaining) static Eina_Bool _e_sys_cb_logout_timer(void *data __UNUSED__) { - const Eina_List *l; - E_Comp *c; E_Client *ec; int pending = 0; - EINA_LIST_FOREACH(e_comp_list(), l, c) - E_CLIENT_FOREACH(c, ec) - { - if (e_client_util_ignored_get(ec)) continue; - if (!ec->internal) pending++; - } + E_CLIENT_FOREACH(e_comp, ec) + { + if (e_client_util_ignored_get(ec)) continue; + if (!ec->internal) pending++; + } if (pending == 0) goto after; else if (_e_sys_logout_confirm_dialog) { @@ -769,8 +756,7 @@ _e_sys_logout_after(void) static void _e_sys_logout_begin(E_Sys_Action a_after, Eina_Bool raw) { - const Eina_List *l, *ll; - E_Comp *c; + const Eina_List *l; E_Client *ec; E_Obj_Dialog *od; @@ -790,11 +776,10 @@ _e_sys_logout_begin(E_Sys_Action a_after, Eina_Bool raw) } _e_sys_action_after = a_after; _e_sys_action_after_raw = raw; - EINA_LIST_FOREACH(e_comp_list(), l, c) - EINA_LIST_FOREACH(c->clients, ll, ec) - { - e_client_act_close_begin(ec); - } + EINA_LIST_FOREACH(e_comp->clients, l, ec) + { + e_client_act_close_begin(ec); + } /* and poll to see if all pending windows are gone yet every 0.5 sec */ _e_sys_logout_begin_time = ecore_time_get(); if (_e_sys_logout_timer) ecore_timer_del(_e_sys_logout_timer); diff --git a/src/bin/e_test.c b/src/bin/e_test.c index 4f0714886..f754c3c89 100644 --- a/src/bin/e_test.c +++ b/src/bin/e_test.c @@ -1,6 +1,6 @@ #include "e.h" -static void _e_test_internal(E_Comp *c); +static void _e_test_internal(void); #ifdef DESKMIRROR_TEST @@ -30,7 +30,7 @@ deskmirror_test(void *d EINA_UNUSED) EAPI void e_test(void) { - E_LIST_FOREACH(e_comp_list(), _e_test_internal); + _e_test_internal(); #ifdef DESKMIRROR_TEST ecore_timer_add(2.0, deskmirror_test, NULL); @@ -67,7 +67,7 @@ _e_test_timer(void *data) } static void -_e_test_internal(E_Comp *c) +_e_test_internal(void) { _e_test_timer(NULL); } @@ -92,12 +92,12 @@ _e_test_delete(E_Win *win) } static void -_e_test_internal(E_Comp *c) +_e_test_internal(void) { E_Win *win; Evas_Object *o; - win = e_win_new(c); + win = e_win_new(e_comp); evas_object_resize_callback_set(win, _e_test_resize); e_win_delete_callback_set(win, _e_test_delete); e_win_placed_set(win, 0); @@ -130,7 +130,7 @@ _e_test_timer(void *data) } static void -_e_test_internal(E_Comp *c) +_e_test_internal(void) { E_Menu *m; Eina_List *l; @@ -157,7 +157,7 @@ _e_test_dialog_del(void *obj) } static void -_e_test_internal(E_Comp *c) +_e_test_internal(void) { E_Dialog *dia; @@ -188,7 +188,7 @@ _e_test_click(void *data, Evas *e, Evas_Object *obj, void *event_info) } static void -_e_test_internal(E_Comp *c) +_e_test_internal(void) { E_Dialog *dia; Evas_Object *o, *o2, *o3; @@ -254,7 +254,7 @@ _e_test_timer(void *data) } static void -_e_test_internal(E_Comp *c) +_e_test_internal(void) { tcon = c; _e_test_timer(NULL); @@ -293,7 +293,7 @@ _e_test_resize(void *data, Evas *e, Evas_Object *obj, void *event_info) } static void -_e_test_internal(E_Comp *c) +_e_test_internal(void) { E_Dialog *dia; Evas_Coord mw, mh, vw, vh; @@ -381,7 +381,7 @@ _e_test_cb_e_smart_pan_changed_hook(void *data, Evas_Object *obj, void *event_in } static void -_e_test_internal(E_Comp *c) +_e_test_internal(void) { E_Dialog *dia; Evas_Object *o; @@ -410,7 +410,7 @@ _e_test_internal(E_Comp *c) #elif 0 static void -_e_test_internal(E_Comp *c) +_e_test_internal(void) { E_Dialog *dia; Evas_Object *o; @@ -528,7 +528,7 @@ _e_test_cb_selected(void *data, Evas_Object *obj, void *event_info) } static void -_e_test_internal(E_Comp *c) +_e_test_internal(void) { E_Dialog *dia; Evas_Object *ofm, *ofm2, *of, *ob, *ot; @@ -641,7 +641,7 @@ _e_test_cb_selected(void *data, Evas_Object *obj) } static void -_e_test_internal(E_Comp *c) +_e_test_internal(void) { E_Dialog *dia; Evas_Object *o; @@ -674,7 +674,7 @@ _e_test_cb_ok(E_Color_Dialog *dia, E_Color *color, void *data) } static void -_e_test_internal(E_Comp *c) +_e_test_internal(void) { E_Color_Dialog *d; @@ -685,7 +685,7 @@ _e_test_internal(E_Comp *c) #elif 0 static void -_e_test_internal(E_Comp *c) +_e_test_internal(void) { E_Dialog *dia; Evas_Object *o, *ob, *of; @@ -754,7 +754,7 @@ _e_test_internal(E_Comp *c) } static void -_e_test_internal(E_Comp *c) +_e_test_internal(void) { ecore_timer_add(1.0, _e_test_timer, c); } @@ -821,7 +821,7 @@ _e_test_timer(void *data) } static void -_e_test_internal(E_Comp *c) +_e_test_internal(void) { ecore_timer_add(1.0, _e_test_timer, c); } @@ -888,14 +888,14 @@ _e_test_timer(void *data) } static void -_e_test_internal(E_Comp *c) +_e_test_internal(void) { ecore_timer_add(1.0, _e_test_timer, c); } #else static void -_e_test_internal(E_Comp *c __UNUSED__) +_e_test_internal(void) { } diff --git a/src/bin/e_utils.c b/src/bin/e_utils.c index f55bbc5bf..364a9ac55 100644 --- a/src/bin/e_utils.c +++ b/src/bin/e_utils.c @@ -103,21 +103,13 @@ e_util_glob_case_match(const char *str, const char *pattern) EAPI E_Zone * e_util_comp_zone_number_get(int c_num, int zone_num) { - E_Comp *c; - - c = e_comp_number_get(c_num); - if (!c) return NULL; - return e_comp_zone_number_get(c, zone_num); + return e_comp_zone_number_get(e_comp, zone_num); } EAPI E_Zone * e_util_comp_zone_id_get(int c_num, int id) { - E_Comp *c; - - c = e_comp_number_get(c_num); - if (!c) return NULL; - return e_comp_zone_id_get(c, id); + return e_comp_zone_id_get(e_comp, id); } EAPI int @@ -202,7 +194,7 @@ e_util_immortal_check(void) { Eina_List *wins; - wins = e_clients_immortal_list(NULL); + wins = e_clients_immortal_list(); if (wins) { e_util_dialog_show(_("Cannot exit - immortal windows."), @@ -1019,25 +1011,21 @@ EAPI Eina_Bool e_util_fullscreen_any(void) { E_Zone *zone; - const Eina_List *lc, *lz; - E_Comp *c; + const Eina_List *lz; E_Desk *desk; int x, y; - EINA_LIST_FOREACH(e_comp_list(), lc, c) + EINA_LIST_FOREACH(e_comp->zones, lz, zone) { - EINA_LIST_FOREACH(c->zones, lz, zone) - { - if (zone->fullscreen > 0) return EINA_TRUE; + if (zone->fullscreen > 0) return EINA_TRUE; - for (x = 0; x < zone->desk_x_count; x++) - for (y = 0; y < zone->desk_y_count; y++) - { - desk = e_desk_at_xy_get(zone, x, y); - if ((desk) && (desk->fullscreen_clients)) - return EINA_TRUE; - } - } + for (x = 0; x < zone->desk_x_count; x++) + for (y = 0; y < zone->desk_y_count; y++) + { + desk = e_desk_at_xy_get(zone, x, y); + if ((desk) && (desk->fullscreen_clients)) + return EINA_TRUE; + } } return EINA_FALSE; } diff --git a/src/bin/e_utils.h b/src/bin/e_utils.h index cd90c0704..916719e3a 100644 --- a/src/bin/e_utils.h +++ b/src/bin/e_utils.h @@ -17,8 +17,8 @@ EAPI void e_util_env_set(const char *var, const char *val); EAPI E_Zone *e_util_zone_current_get(E_Manager *man); EAPI int e_util_glob_match(const char *str, const char *glob); EAPI int e_util_glob_case_match(const char *str, const char *glob); -EAPI E_Zone *e_util_comp_zone_id_get(int con_num, int id); -EAPI E_Zone *e_util_comp_zone_number_get(int con_num, int zone_num); +EINA_DEPRECATED EAPI E_Zone *e_util_comp_zone_id_get(int con_num, int id); +EINA_DEPRECATED EAPI E_Zone *e_util_comp_zone_number_get(int con_num, int zone_num); EAPI int e_util_head_exec(int head, const char *cmd); EAPI int e_util_strcasecmp(const char *s1, const char *s2); EAPI int e_util_strcmp(const char *s1, const char *s2); diff --git a/src/bin/e_win.c b/src/bin/e_win.c index 99ca97461..f8185713f 100644 --- a/src/bin/e_win.c +++ b/src/bin/e_win.c @@ -86,7 +86,6 @@ _e_elm_win_trap_show(void *data, Evas_Object *o) else { E_Pixmap *cp; - E_Comp *c = NULL; const char *title; ecore_evas_name_class_set(ee, "E", "_e_internal_window"); @@ -97,18 +96,7 @@ _e_elm_win_trap_show(void *data, Evas_Object *o) cp = e_pixmap_new(type, win); EINA_SAFETY_ON_NULL_RETURN_VAL(cp, EINA_TRUE); - /* if (eina_list_count(e_comp_list()) > 1) */ - /* { */ -/* #ifndef HAVE_WAYLAND_ONLY */ - /* c = e_comp_find_by_window(ecore_x_window_root_get(win)); */ -/* #else */ - /* c = ; */ -/* #endif */ - /* } */ - - if (!c) - c = e_comp_get(NULL); - ctx->client = e_client_new(c, cp, 0, 1); + ctx->client = e_client_new(e_comp, cp, 0, 1); EINA_SAFETY_ON_NULL_RETURN_VAL(ctx->client, EINA_TRUE); } ctx->client->placed = ctx->placed | ctx->centered; diff --git a/src/bin/e_xsettings.c b/src/bin/e_xsettings.c index 2df08679c..ab1c04dc8 100644 --- a/src/bin/e_xsettings.c +++ b/src/bin/e_xsettings.c @@ -373,29 +373,25 @@ _e_xsettings_update(void) static void _e_xsettings_gtk_icon_update(void) { - const Eina_List *l, *ll; + const Eina_List *l; E_Client *ec; - E_Comp *c; - EINA_LIST_FOREACH(e_comp_list(), l, c) - EINA_LIST_FOREACH(c->clients, ll, ec) - if (ec->icccm.state) - ecore_x_client_message8_send(e_client_util_win_get(ec), - _atom_gtk_iconthemes, NULL, 0); + EINA_LIST_FOREACH(e_comp->clients, l, ec) + if (ec->icccm.state) + ecore_x_client_message8_send(e_client_util_win_get(ec), + _atom_gtk_iconthemes, NULL, 0); } static void _e_xsettings_gtk_rcfiles_update(void) { - const Eina_List *l, *ll; + const Eina_List *l; E_Client *ec; - E_Comp *c; - EINA_LIST_FOREACH(e_comp_list(), l, c) - EINA_LIST_FOREACH(c->clients, ll, ec) - if (ec->icccm.state) - ecore_x_client_message8_send(e_client_util_win_get(ec), - _atom_gtk_rcfiles, NULL, 0); + EINA_LIST_FOREACH(e_comp->clients, l, ec) + if (ec->icccm.state) + ecore_x_client_message8_send(e_client_util_win_get(ec), + _atom_gtk_rcfiles, NULL, 0); } static void diff --git a/src/bin/e_zone.c b/src/bin/e_zone.c index edbbbf47d..e98217998 100644 --- a/src/bin/e_zone.c +++ b/src/bin/e_zone.c @@ -65,13 +65,11 @@ e_zone_shutdown(void) EAPI void e_zone_all_edge_flip_eval(void) { - const Eina_List *l, *ll; - E_Comp *c; + const Eina_List *l; E_Zone *zone; - EINA_LIST_FOREACH(e_comp_list(), l, c) - EINA_LIST_FOREACH(c->zones, ll, zone) - e_zone_edge_flip_eval(zone); + EINA_LIST_FOREACH(e_comp->zones, l, zone) + e_zone_edge_flip_eval(zone); } static void @@ -502,8 +500,6 @@ e_zone_flip_coords_handle(E_Zone *zone, if (next_zone->y != cy) one_row = 0; } } - if (eina_list_count(e_comp_list()) > 1) - goto noflip; if (!E_INSIDE(x, y, zone->x, zone->y, zone->w, zone->h)) goto noflip; if ((one_row) && (y == 0)) @@ -808,56 +804,48 @@ e_zone_desk_linear_flip_to(E_Zone *zone, EAPI void e_zone_edge_enable(void) { - const Eina_List *l, *ll; - E_Comp *c; + const Eina_List *l; E_Zone *zone; - EINA_LIST_FOREACH(e_comp_list(), l, c) + EINA_LIST_FOREACH(e_comp->zones, l, zone) { - EINA_LIST_FOREACH(c->zones, ll, zone) - { - if (zone->edge.left) evas_object_show(zone->edge.left); - if (zone->edge.right) evas_object_show(zone->edge.right); - if (zone->edge.top) evas_object_show(zone->edge.top); - if (zone->edge.bottom) evas_object_show(zone->edge.bottom); - if (zone->corner.left_top) evas_object_show(zone->corner.left_top); - if (zone->corner.top_left) evas_object_show(zone->corner.top_left); - if (zone->corner.top_right) evas_object_show(zone->corner.top_right); - if (zone->corner.right_top) evas_object_show(zone->corner.right_top); - if (zone->corner.right_bottom) evas_object_show(zone->corner.right_bottom); - if (zone->corner.bottom_right) evas_object_show(zone->corner.bottom_right); - if (zone->corner.bottom_left) evas_object_show(zone->corner.bottom_left); - if (zone->corner.left_bottom) evas_object_show(zone->corner.left_bottom); - e_zone_edge_flip_eval(zone); - } + if (zone->edge.left) evas_object_show(zone->edge.left); + if (zone->edge.right) evas_object_show(zone->edge.right); + if (zone->edge.top) evas_object_show(zone->edge.top); + if (zone->edge.bottom) evas_object_show(zone->edge.bottom); + if (zone->corner.left_top) evas_object_show(zone->corner.left_top); + if (zone->corner.top_left) evas_object_show(zone->corner.top_left); + if (zone->corner.top_right) evas_object_show(zone->corner.top_right); + if (zone->corner.right_top) evas_object_show(zone->corner.right_top); + if (zone->corner.right_bottom) evas_object_show(zone->corner.right_bottom); + if (zone->corner.bottom_right) evas_object_show(zone->corner.bottom_right); + if (zone->corner.bottom_left) evas_object_show(zone->corner.bottom_left); + if (zone->corner.left_bottom) evas_object_show(zone->corner.left_bottom); + e_zone_edge_flip_eval(zone); } } EAPI void e_zone_edge_disable(void) { - const Eina_List *l, *ll; - E_Comp *c; + const Eina_List *l; E_Zone *zone; - EINA_LIST_FOREACH(e_comp_list(), l, c) + EINA_LIST_FOREACH(e_comp->zones, l, zone) { - EINA_LIST_FOREACH(c->zones, ll, zone) - { - zone->flip.switching = E_ZONE_EDGE_NONE; - if (zone->edge.left) evas_object_hide(zone->edge.left); - if (zone->edge.right) evas_object_hide(zone->edge.right); - if (zone->edge.top) evas_object_hide(zone->edge.top); - if (zone->edge.bottom) evas_object_hide(zone->edge.bottom); - if (zone->corner.left_top) evas_object_hide(zone->corner.left_top); - if (zone->corner.top_left) evas_object_hide(zone->corner.top_left); - if (zone->corner.top_right) evas_object_hide(zone->corner.top_right); - if (zone->corner.right_top) evas_object_hide(zone->corner.right_top); - if (zone->corner.right_bottom) evas_object_hide(zone->corner.right_bottom); - if (zone->corner.bottom_right) evas_object_hide(zone->corner.bottom_right); - if (zone->corner.bottom_left) evas_object_hide(zone->corner.bottom_left); - if (zone->corner.left_bottom) evas_object_hide(zone->corner.left_bottom); - } + zone->flip.switching = E_ZONE_EDGE_NONE; + if (zone->edge.left) evas_object_hide(zone->edge.left); + if (zone->edge.right) evas_object_hide(zone->edge.right); + if (zone->edge.top) evas_object_hide(zone->edge.top); + if (zone->edge.bottom) evas_object_hide(zone->edge.bottom); + if (zone->corner.left_top) evas_object_hide(zone->corner.left_top); + if (zone->corner.top_left) evas_object_hide(zone->corner.top_left); + if (zone->corner.top_right) evas_object_hide(zone->corner.top_right); + if (zone->corner.right_top) evas_object_hide(zone->corner.right_top); + if (zone->corner.right_bottom) evas_object_hide(zone->corner.right_bottom); + if (zone->corner.bottom_right) evas_object_hide(zone->corner.bottom_right); + if (zone->corner.bottom_left) evas_object_hide(zone->corner.bottom_left); + if (zone->corner.left_bottom) evas_object_hide(zone->corner.left_bottom); } } @@ -1015,139 +1003,127 @@ e_zone_edge_flip_eval(E_Zone *zone) EAPI void e_zone_edge_new(E_Zone_Edge edge) { - const Eina_List *l, *ll; - E_Comp *c; + const Eina_List *l; E_Zone *zone; int cw, ch; if (edge == E_ZONE_EDGE_NONE) return; - // configurably disallow edge bindings when we have more than 1 root - // window (ie pure old multihead) since we don't know which direction - // other root windows are in - if ((!e_config->multiscreen_flip) && (eina_list_count(e_comp_list()) > 1)) return; - EINA_LIST_FOREACH(e_comp_list(), l, c) + EINA_LIST_FOREACH(e_comp->zones, l, zone) { - EINA_LIST_FOREACH(c->zones, ll, zone) + // don't allow bindings on edges that are on the boundary + // between zones + if (e_zone_exists_direction(zone, edge)) continue; + cw = zone->w * E_ZONE_CORNER_RATIO; + ch = zone->h * E_ZONE_CORNER_RATIO; + switch (edge) { - // don't allow bindings on edges that are on the boundary - // between zones - if (e_zone_exists_direction(zone, edge)) continue; - cw = zone->w * E_ZONE_CORNER_RATIO; - ch = zone->h * E_ZONE_CORNER_RATIO; - switch (edge) - { #define EDGE_NEW(MEMBER, X, Y, W, H) do { \ - if (!zone->MEMBER) \ - { \ - zone->MEMBER = evas_object_rectangle_add(c->evas); \ - evas_object_name_set(zone->MEMBER, #MEMBER); \ - evas_object_move(zone->MEMBER, (X), (Y)); \ - evas_object_resize(zone->MEMBER, (W), (H)); \ - evas_object_color_set(zone->MEMBER, 0, 0, 0, 0); \ - evas_object_event_callback_add(zone->MEMBER, EVAS_CALLBACK_MOUSE_MOVE, _e_zone_cb_mouse_move, zone); \ - evas_object_event_callback_add(zone->MEMBER, EVAS_CALLBACK_MOUSE_IN, _e_zone_cb_mouse_in, zone); \ - evas_object_event_callback_add(zone->MEMBER, EVAS_CALLBACK_MOUSE_OUT, _e_zone_cb_mouse_out, zone); \ - evas_object_event_callback_add(zone->MEMBER, EVAS_CALLBACK_MOUSE_DOWN, _e_zone_cb_mouse_down, zone); \ - evas_object_event_callback_add(zone->MEMBER, EVAS_CALLBACK_MOUSE_UP, _e_zone_cb_mouse_up, zone); \ - evas_object_show(zone->MEMBER); \ - } \ - } while (0) + if (!zone->MEMBER) \ + { \ + zone->MEMBER = evas_object_rectangle_add(e_comp->evas); \ + evas_object_name_set(zone->MEMBER, #MEMBER); \ + evas_object_move(zone->MEMBER, (X), (Y)); \ + evas_object_resize(zone->MEMBER, (W), (H)); \ + evas_object_color_set(zone->MEMBER, 0, 0, 0, 0); \ + evas_object_event_callback_add(zone->MEMBER, EVAS_CALLBACK_MOUSE_MOVE, _e_zone_cb_mouse_move, zone); \ + evas_object_event_callback_add(zone->MEMBER, EVAS_CALLBACK_MOUSE_IN, _e_zone_cb_mouse_in, zone); \ + evas_object_event_callback_add(zone->MEMBER, EVAS_CALLBACK_MOUSE_OUT, _e_zone_cb_mouse_out, zone); \ + evas_object_event_callback_add(zone->MEMBER, EVAS_CALLBACK_MOUSE_DOWN, _e_zone_cb_mouse_down, zone); \ + evas_object_event_callback_add(zone->MEMBER, EVAS_CALLBACK_MOUSE_UP, _e_zone_cb_mouse_up, zone); \ + evas_object_show(zone->MEMBER); \ + } \ + } while (0) - case E_ZONE_EDGE_LEFT: - EDGE_NEW(edge.left, zone->x, zone->y + ch, 1, zone->h - 2 * ch); - break; - case E_ZONE_EDGE_RIGHT: - EDGE_NEW(edge.right, zone->x + zone->w - 1, zone->y + ch, 1, zone->h - 2 * ch); - break; - case E_ZONE_EDGE_TOP: - EDGE_NEW(edge.top, zone->x + 1 + cw, zone->y, zone->w - 2 * cw - 2, 1); - break; - case E_ZONE_EDGE_BOTTOM: - EDGE_NEW(edge.bottom, zone->x + 1 + cw, zone->y + zone->h - 1, zone->w - 2 - 2 * cw, 1); - break; - case E_ZONE_EDGE_TOP_LEFT: - EDGE_NEW(corner.left_top, zone->x, zone->y, 1, ch); - EDGE_NEW(corner.top_left, zone->x + 1, zone->y, cw, 1); - break; - case E_ZONE_EDGE_TOP_RIGHT: - EDGE_NEW(corner.top_right, zone->x + zone->w - cw - 2, zone->y, cw, 1); - EDGE_NEW(corner.right_top, zone->x + zone->w - 1, zone->y, 1, ch); - break; - case E_ZONE_EDGE_BOTTOM_RIGHT: - EDGE_NEW(corner.right_bottom, zone->x + zone->w - 1, zone->y + zone->h - ch, 1, ch); - EDGE_NEW(corner.bottom_right, zone->x + zone->w - cw - 2, zone->y + zone->h - 1, cw, 1); - break; - case E_ZONE_EDGE_BOTTOM_LEFT: - EDGE_NEW(corner.bottom_left, zone->x + 1, zone->y + zone->h - 1, cw, 1); - EDGE_NEW(corner.left_bottom, zone->x, zone->y + zone->h - ch, 1, ch); - break; - default: continue; - } - if (e_config->fullscreen_flip) - e_zone_edge_win_layer_set(zone, E_LAYER_CLIENT_EDGE_FULLSCREEN); - else - e_zone_edge_win_layer_set(zone, E_LAYER_CLIENT_EDGE); + case E_ZONE_EDGE_LEFT: + EDGE_NEW(edge.left, zone->x, zone->y + ch, 1, zone->h - 2 * ch); + break; + case E_ZONE_EDGE_RIGHT: + EDGE_NEW(edge.right, zone->x + zone->w - 1, zone->y + ch, 1, zone->h - 2 * ch); + break; + case E_ZONE_EDGE_TOP: + EDGE_NEW(edge.top, zone->x + 1 + cw, zone->y, zone->w - 2 * cw - 2, 1); + break; + case E_ZONE_EDGE_BOTTOM: + EDGE_NEW(edge.bottom, zone->x + 1 + cw, zone->y + zone->h - 1, zone->w - 2 - 2 * cw, 1); + break; + case E_ZONE_EDGE_TOP_LEFT: + EDGE_NEW(corner.left_top, zone->x, zone->y, 1, ch); + EDGE_NEW(corner.top_left, zone->x + 1, zone->y, cw, 1); + break; + case E_ZONE_EDGE_TOP_RIGHT: + EDGE_NEW(corner.top_right, zone->x + zone->w - cw - 2, zone->y, cw, 1); + EDGE_NEW(corner.right_top, zone->x + zone->w - 1, zone->y, 1, ch); + break; + case E_ZONE_EDGE_BOTTOM_RIGHT: + EDGE_NEW(corner.right_bottom, zone->x + zone->w - 1, zone->y + zone->h - ch, 1, ch); + EDGE_NEW(corner.bottom_right, zone->x + zone->w - cw - 2, zone->y + zone->h - 1, cw, 1); + break; + case E_ZONE_EDGE_BOTTOM_LEFT: + EDGE_NEW(corner.bottom_left, zone->x + 1, zone->y + zone->h - 1, cw, 1); + EDGE_NEW(corner.left_bottom, zone->x, zone->y + zone->h - ch, 1, ch); + break; + default: continue; } + if (e_config->fullscreen_flip) + e_zone_edge_win_layer_set(zone, E_LAYER_CLIENT_EDGE_FULLSCREEN); + else + e_zone_edge_win_layer_set(zone, E_LAYER_CLIENT_EDGE); } } EAPI void e_zone_edge_free(E_Zone_Edge edge) { - const Eina_List *l, *ll; - E_Comp *c; + const Eina_List *l; E_Zone *zone; if (edge == E_ZONE_EDGE_NONE) return; - EINA_LIST_FOREACH(e_comp_list(), l, c) + EINA_LIST_FOREACH(e_comp->zones, l, zone) { - EINA_LIST_FOREACH(c->zones, ll, zone) + if (zone->flip.switching == edge) + zone->flip.switching = E_ZONE_EDGE_NONE; + switch (edge) { - if (zone->flip.switching == edge) - zone->flip.switching = E_ZONE_EDGE_NONE; - switch (edge) - { - case E_ZONE_EDGE_NONE: - /* noop */ - break; + case E_ZONE_EDGE_NONE: + /* noop */ + break; - case E_ZONE_EDGE_LEFT: - E_FREE_FUNC(zone->edge.left, evas_object_del); - break; + case E_ZONE_EDGE_LEFT: + E_FREE_FUNC(zone->edge.left, evas_object_del); + break; - case E_ZONE_EDGE_RIGHT: - E_FREE_FUNC(zone->edge.right, evas_object_del); - break; + case E_ZONE_EDGE_RIGHT: + E_FREE_FUNC(zone->edge.right, evas_object_del); + break; - case E_ZONE_EDGE_TOP: - E_FREE_FUNC(zone->edge.top, evas_object_del); - break; + case E_ZONE_EDGE_TOP: + E_FREE_FUNC(zone->edge.top, evas_object_del); + break; - case E_ZONE_EDGE_BOTTOM: - E_FREE_FUNC(zone->edge.bottom, evas_object_del); - break; + case E_ZONE_EDGE_BOTTOM: + E_FREE_FUNC(zone->edge.bottom, evas_object_del); + break; - case E_ZONE_EDGE_TOP_LEFT: - E_FREE_FUNC(zone->corner.left_top, evas_object_del); - E_FREE_FUNC(zone->corner.top_left, evas_object_del); - break; + case E_ZONE_EDGE_TOP_LEFT: + E_FREE_FUNC(zone->corner.left_top, evas_object_del); + E_FREE_FUNC(zone->corner.top_left, evas_object_del); + break; - case E_ZONE_EDGE_TOP_RIGHT: - E_FREE_FUNC(zone->corner.top_right, evas_object_del); - E_FREE_FUNC(zone->corner.right_top, evas_object_del); - break; + case E_ZONE_EDGE_TOP_RIGHT: + E_FREE_FUNC(zone->corner.top_right, evas_object_del); + E_FREE_FUNC(zone->corner.right_top, evas_object_del); + break; - case E_ZONE_EDGE_BOTTOM_RIGHT: - E_FREE_FUNC(zone->corner.right_bottom, evas_object_del); - E_FREE_FUNC(zone->corner.bottom_right, evas_object_del); - break; + case E_ZONE_EDGE_BOTTOM_RIGHT: + E_FREE_FUNC(zone->corner.right_bottom, evas_object_del); + E_FREE_FUNC(zone->corner.bottom_right, evas_object_del); + break; - case E_ZONE_EDGE_BOTTOM_LEFT: - E_FREE_FUNC(zone->corner.bottom_left, evas_object_del); - E_FREE_FUNC(zone->corner.left_bottom, evas_object_del); - break; - } + case E_ZONE_EDGE_BOTTOM_LEFT: + E_FREE_FUNC(zone->corner.bottom_left, evas_object_del); + E_FREE_FUNC(zone->corner.left_bottom, evas_object_del); + break; } } } diff --git a/src/modules/access/e_mod_main.c b/src/modules/access/e_mod_main.c index 0e7a03a93..c5579041c 100644 --- a/src/modules/access/e_mod_main.c +++ b/src/modules/access/e_mod_main.c @@ -783,20 +783,16 @@ _cover_new(E_Zone *zone) static void _covers_init(void) { - const Eina_List *l, *l2; - E_Comp *comp; + const Eina_List *l; int i = 0; + E_Zone *zone; - EINA_LIST_FOREACH(e_comp_list(), l, comp) + EINA_LIST_FOREACH(e_comp->zones, l, zone) { - E_Zone *zone; - EINA_LIST_FOREACH(comp->zones, l2, zone) - { - Cover *cov = _cover_new(zone); - if (!cov) continue; - covers = eina_list_append(covers, cov); - for (i = 0; i < HISTORY_MAX; i++) cov->mouse_history[i] = -1; - } + Cover *cov = _cover_new(zone); + if (!cov) continue; + covers = eina_list_append(covers, cov); + for (i = 0; i < HISTORY_MAX; i++) cov->mouse_history[i] = -1; } } diff --git a/src/modules/conf_bindings/e_int_config_edgebindings.c b/src/modules/conf_bindings/e_int_config_edgebindings.c index 87f9ecc94..c1f8c7b41 100644 --- a/src/modules/conf_bindings/e_int_config_edgebindings.c +++ b/src/modules/conf_bindings/e_int_config_edgebindings.c @@ -187,8 +187,7 @@ _free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata) static int _basic_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata) { - const Eina_List *l, *ll; - E_Comp *comp; + const Eina_List *l; E_Zone *zone; E_Config_Binding_Edge *bi, *bi2; E_Layer layer; @@ -231,11 +230,8 @@ _basic_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata) else layer = E_LAYER_CLIENT_EDGE; - EINA_LIST_FOREACH(e_comp_list(), l, comp) - { - EINA_LIST_FOREACH(comp->zones, ll, zone) - e_zone_edge_win_layer_set(zone, layer); - } + EINA_LIST_FOREACH(e_comp->zones, l, zone) + e_zone_edge_win_layer_set(zone, layer); } e_config->fullscreen_flip = cfdata->fullscreen_flip; diff --git a/src/modules/conf_display/e_int_config_desklock.c b/src/modules/conf_display/e_int_config_desklock.c index 8fa018963..a7e8727f7 100644 --- a/src/modules/conf_display/e_int_config_desklock.c +++ b/src/modules/conf_display/e_int_config_desklock.c @@ -11,7 +11,6 @@ static Evas_Object *_basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dia static void _cb_method_change(void *data, Evas_Object *obj, void *event_info); static void _login_method_change(void *data, Evas_Object *obj, void *event_info); static void _cb_login_change(void *data, Evas_Object *obj); -static int _zone_count_get(void); static void _cb_bg_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event); @@ -133,7 +132,7 @@ _fill_data(E_Config_Dialog_Data *cfdata) E_Config_Desklock_Background *bg; int x; - cfdata->zone_count = _zone_count_get(); + cfdata->zone_count = eina_list_count(e_comp->zones); EINA_LIST_FOREACH(e_config->desklock_backgrounds, l, bg) cfdata->bgs = eina_list_append(cfdata->bgs, desklock_bg_dup(bg, NULL)); if (!cfdata->bgs) @@ -216,10 +215,9 @@ _basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data E_Config_XKB_Layout *cl; int grp = 0; Evas_Object *otb, *ol, *ow, *of, *oc; - const Eina_List *l, *ll; + const Eina_List *l; E_Zone *zone; E_Radio_Group *rg; - E_Comp *comp; int screen_count, x = 0; e_dialog_resizable_set(cfd->dia, 1); @@ -406,17 +404,16 @@ _basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data cfdata->gui.o_table = e_widget_table_add(evas, 1); - EINA_LIST_FOREACH(e_comp_list(), l, comp) - EINA_LIST_FOREACH(comp->zones, ll, zone) - { - ow = e_widget_preview_add(evas, 100, 140); - cfdata->gui.bgs = eina_list_append(cfdata->gui.bgs, ow); - evas_object_data_set(ow, "zone", zone); - e_widget_disabled_set(ow, - (cfdata->bg_method < E_DESKLOCK_BACKGROUND_METHOD_CUSTOM)); - evas_object_event_callback_add(ow, EVAS_CALLBACK_MOUSE_DOWN, _cb_bg_mouse_down, cfdata); - e_widget_table_object_append(cfdata->gui.o_table, ow, x++, 0, 1, 1, 1, 1, 1, 1); - } + EINA_LIST_FOREACH(e_comp->zones, l, zone) + { + ow = e_widget_preview_add(evas, 100, 140); + cfdata->gui.bgs = eina_list_append(cfdata->gui.bgs, ow); + evas_object_data_set(ow, "zone", zone); + e_widget_disabled_set(ow, + (cfdata->bg_method < E_DESKLOCK_BACKGROUND_METHOD_CUSTOM)); + evas_object_event_callback_add(ow, EVAS_CALLBACK_MOUSE_DOWN, _cb_bg_mouse_down, cfdata); + e_widget_table_object_append(cfdata->gui.o_table, ow, x++, 0, 1, 1, 1, 1, 1, 1); + } _cb_method_change(cfdata, NULL, NULL); e_widget_list_object_append(ol, cfdata->gui.o_table, 1, 1, 0.5); e_widget_toolbook_page_append(otb, NULL, _("Wallpaper"), ol, @@ -748,18 +745,6 @@ _cb_login_change(void *data, Evas_Object *obj __UNUSED__) e_widget_disabled_set(cfdata->gui.loginbox_slider, (cfdata->login_zone < 0)); } -static int -_zone_count_get(void) -{ - int num = 0; - const Eina_List *l; - E_Comp *comp; - - EINA_LIST_FOREACH(e_comp_list(), l, comp) - num += eina_list_count(comp->zones); - return num; -} - static void _cb_bg_mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event __UNUSED__) { diff --git a/src/modules/conf_display/e_int_config_desks.c b/src/modules/conf_display/e_int_config_desks.c index 2ee4daf85..96bc2cbef 100644 --- a/src/modules/conf_display/e_int_config_desks.c +++ b/src/modules/conf_display/e_int_config_desks.c @@ -117,13 +117,11 @@ _basic_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata) if ((cfdata->x != e_config->zone_desks_x_count) || (cfdata->y != e_config->zone_desks_y_count)) { - const Eina_List *l, *ll; - E_Comp *comp; + const Eina_List *l; E_Zone *zone; - EINA_LIST_FOREACH(e_comp_list(), l, comp) - EINA_LIST_FOREACH(comp->zones, ll, zone) - e_zone_desk_count_set(zone, cfdata->x, cfdata->y); + EINA_LIST_FOREACH(e_comp->zones, l, zone) + e_zone_desk_count_set(zone, cfdata->x, cfdata->y); } eina_stringshare_replace(&e_config->desk_flip_animate_type, NULL); @@ -146,19 +144,17 @@ _basic_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata) static int _basic_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata) { - const Eina_List *l, *ll; - E_Comp *comp; + const Eina_List *l; E_Zone *zone; - EINA_LIST_FOREACH(e_comp_list(), l, comp) - EINA_LIST_FOREACH(comp->zones, ll, zone) - { - int x, y; + EINA_LIST_FOREACH(e_comp->zones, l, zone) + { + int x, y; - e_zone_desk_count_get(zone, &x, &y); - if ((x != cfdata->x) || (y != cfdata->y)) - return 1; - } + e_zone_desk_count_get(zone, &x, &y); + if ((x != cfdata->x) || (y != cfdata->y)) + return 1; + } return ((e_util_strcasecmp(eina_list_nth(cfdata->comp_effects, cfdata->flip_mode), e_config->desk_flip_animate_type)) || (e_config->desk_flip_animate_interpolation != cfdata->flip_interp) || diff --git a/src/modules/conf_interaction/e_int_config_mouse.c b/src/modules/conf_interaction/e_int_config_mouse.c index 7773930bc..6ad251554 100644 --- a/src/modules/conf_interaction/e_int_config_mouse.c +++ b/src/modules/conf_interaction/e_int_config_mouse.c @@ -98,9 +98,6 @@ _free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata) static int _basic_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata) { - const Eina_List *l; - E_Comp *comp; - e_config->use_e_cursor = cfdata->use_e_cursor; e_config->show_cursor = cfdata->show_cursor; e_config->idle_cursor = cfdata->idle_cursor; @@ -113,13 +110,10 @@ _basic_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata) e_config_save_queue(); /* Apply the above settings */ - EINA_LIST_FOREACH(e_comp_list(), l, comp) - { - if ((comp->comp_type == E_PIXMAP_TYPE_X) && (!e_config->show_cursor)) - e_pointer_hide(comp->pointer); - else - e_pointers_size_set(e_config->cursor_size); - } + if ((e_comp->comp_type == E_PIXMAP_TYPE_X) && (!e_config->show_cursor)) + e_pointer_hide(e_comp->pointer); + else + e_pointers_size_set(e_config->cursor_size); e_mouse_update(); diff --git a/src/modules/contact/e_edges.c b/src/modules/contact/e_edges.c index 74e22a42c..e66520bd4 100644 --- a/src/modules/contact/e_edges.c +++ b/src/modules/contact/e_edges.c @@ -36,18 +36,14 @@ static Eina_List *handlers = NULL; void e_edges_init(void) { - const Eina_List *l, *ll; - E_Comp *comp; + const Eina_List *l; E_Zone *zone; - EINA_LIST_FOREACH(e_comp_list(), l, comp) + EINA_LIST_FOREACH(e_comp->zones, l, zone) { - EINA_LIST_FOREACH(comp->zones, ll, zone) - { - Edgeset *es = _edgeset_new(zone); - - if (es) edges = eina_list_append(edges, es); - } + Edgeset *es = _edgeset_new(zone); + + if (es) edges = eina_list_append(edges, es); } } diff --git a/src/modules/contact/e_policy.c b/src/modules/contact/e_policy.c index 2b8a47bcd..28e73beca 100644 --- a/src/modules/contact/e_policy.c +++ b/src/modules/contact/e_policy.c @@ -52,20 +52,18 @@ e_policy_shutdown(void) void e_policy_kbd_override_set(Eina_Bool override) { - const Eina_List *l, *ll; + const Eina_List *l; E_Client *ec, *kbd = NULL;; - E_Comp *comp; if (kbd_override == override) return; kbd_override = override; - EINA_LIST_FOREACH(e_comp_list(), l, comp) - EINA_LIST_FOREACH(comp->clients, ll, ec) - { - if (ec->vkbd.vkbd) - { - kbd = ec; - } - } + EINA_LIST_FOREACH(e_comp->clients, l, ec) + { + if (ec->vkbd.vkbd) + { + kbd = ec; + } + } if (kbd) { ec = kbd; diff --git a/src/modules/fileman/e_fwin.c b/src/modules/fileman/e_fwin.c index ec5575edb..e24ce3eda 100644 --- a/src/modules/fileman/e_fwin.c +++ b/src/modules/fileman/e_fwin.c @@ -560,7 +560,6 @@ void e_fwin_reload_all(void) { const Eina_List *l, *ll; - E_Comp *comp; E_Fwin *fwin; E_Zone *zone; @@ -621,13 +620,12 @@ e_fwin_reload_all(void) } /* Hook into zones */ - EINA_LIST_FOREACH(e_comp_list(), l, comp) - EINA_LIST_FOREACH(comp->zones, ll, zone) - { - if (e_fwin_zone_find(zone)) continue; - if (e_config->show_desktop_icons) - e_fwin_zone_new(zone, e_mod_fileman_path_find(zone)); - } + EINA_LIST_FOREACH(e_comp->zones, l, zone) + { + if (e_fwin_zone_find(zone)) continue; + if (e_config->show_desktop_icons) + e_fwin_zone_new(zone, e_mod_fileman_path_find(zone)); + } } void * diff --git a/src/modules/fileman/e_mod_main.c b/src/modules/fileman/e_mod_main.c index ee634b4b2..6587c88ac 100644 --- a/src/modules/fileman/e_mod_main.c +++ b/src/modules/fileman/e_mod_main.c @@ -30,8 +30,7 @@ EAPI E_Module_Api e_modapi = EAPI void * e_modapi_init(E_Module *m) { - const Eina_List *l, *ll; - E_Comp *comp; + const Eina_List *l; E_Zone *zone; conf_module = m; @@ -65,13 +64,12 @@ e_modapi_init(E_Module *m) e_fwin_init(); /* Hook into zones */ - EINA_LIST_FOREACH(e_comp_list(), l, comp) - EINA_LIST_FOREACH(comp->zones, ll, zone) - { - if (e_fwin_zone_find(zone)) continue; - if (e_config->show_desktop_icons) - e_fwin_zone_new(zone, e_mod_fileman_path_find(zone)); - } + EINA_LIST_FOREACH(e_comp->zones, l, zone) + { + if (e_fwin_zone_find(zone)) continue; + if (e_config->show_desktop_icons) + e_fwin_zone_new(zone, e_mod_fileman_path_find(zone)); + } zone_add_handler = ecore_event_handler_add(E_EVENT_ZONE_ADD, _e_mod_zone_add, NULL); @@ -87,8 +85,7 @@ e_modapi_init(E_Module *m) EAPI int e_modapi_shutdown(E_Module *m __UNUSED__) { - const Eina_List *l, *ll; - E_Comp *comp; + const Eina_List *l; E_Zone *zone; E_Config_Dialog *cfd; @@ -98,9 +95,8 @@ e_modapi_shutdown(E_Module *m __UNUSED__) zone_add_handler = NULL; /* Unhook zone fm */ - EINA_LIST_FOREACH(e_comp_list(), l, comp) - EINA_LIST_FOREACH(comp->zones, ll, zone) - e_fwin_zone_shutdown(zone); + EINA_LIST_FOREACH(e_comp->zones, l, zone) + e_fwin_zone_shutdown(zone); e_fwin_nav_shutdown(); diff --git a/src/modules/ibox/e_mod_config.c b/src/modules/ibox/e_mod_config.c index 84226f5e4..bea58b68f 100644 --- a/src/modules/ibox/e_mod_config.c +++ b/src/modules/ibox/e_mod_config.c @@ -88,8 +88,6 @@ _basic_create_widgets(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dial E_Radio_Group *rg; Evas_Object *o, *of, *ob; Evas_Object *show_check = NULL; - E_Comp *comp; - const Eina_List *l; int zone_count = 0; o = e_widget_list_add(evas, 0, 0); @@ -134,8 +132,7 @@ _basic_create_widgets(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dial of = e_widget_framelist_add(evas, _("Screen"), 0); - EINA_LIST_FOREACH(e_comp_list(), l, comp) - zone_count += eina_list_count(comp->zones); + zone_count = eina_list_count(e_comp->zones); if (zone_count <= 1) cfdata->zone_policy = 1; diff --git a/src/modules/illume2/e_mod_main.c b/src/modules/illume2/e_mod_main.c index bd2fc4d60..3ca19904c 100644 --- a/src/modules/illume2/e_mod_main.c +++ b/src/modules/illume2/e_mod_main.c @@ -15,8 +15,6 @@ EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Illume2" }; EAPI void * e_modapi_init(E_Module *m) { - const Eina_List *cl, *zl; - E_Comp *comp; E_Zone *zone; Ecore_X_Window *zones; int zcount = 0; @@ -65,9 +63,7 @@ e_modapi_init(E_Module *m) e_mod_kbd_hide(); /* loop zones and get count */ - EINA_LIST_FOREACH(e_comp_list(), cl, comp) - EINA_LIST_FOREACH(comp->zones, zl, zone) - zcount++; + zcount = eina_list_count(e_comp->zones); /* allocate enough zones */ zones = calloc(zcount, sizeof(Ecore_X_Window)); @@ -93,29 +89,26 @@ e_modapi_init(E_Module *m) zcount = 0; /* loop the zones and create quickpanels for each one */ - EINA_LIST_FOREACH(e_comp_list(), cl, comp) + EINA_LIST_FOREACH(e_comp->zones, zl, zone) { - EINA_LIST_FOREACH(comp->zones, zl, zone) - { - E_Illume_Quickpanel *qp; + E_Illume_Quickpanel *qp; - /* set zone window in list of zones */ - zones[zcount] = zone->black_win; + /* set zone window in list of zones */ + zones[zcount] = zone->black_win; - /* increment zone count */ - zcount++; + /* increment zone count */ + zcount++; - /* try to create a new quickpanel for this zone */ - if (!(qp = e_mod_quickpanel_new(zone))) continue; + /* try to create a new quickpanel for this zone */ + if (!(qp = e_mod_quickpanel_new(zone))) continue; - /* append new qp to list */ - _e_illume_qps = eina_list_append(_e_illume_qps, qp); - } - /* set the zone list on this root. This is needed for some - * elm apps like elm_indicator so that they know how many - * indicators to create at startup */ - ecore_x_e_illume_zone_list_set(comp->man->root, zones, zcount); + /* append new qp to list */ + _e_illume_qps = eina_list_append(_e_illume_qps, qp); } + /* set the zone list on this root. This is needed for some + * elm apps like elm_indicator so that they know how many + * indicators to create at startup */ + ecore_x_e_illume_zone_list_set(comp->man->root, zones, zcount); /* free zones variable */ free(zones); diff --git a/src/modules/lokker/lokker.c b/src/modules/lokker/lokker.c index 7aedd255b..56a35ed26 100644 --- a/src/modules/lokker/lokker.c +++ b/src/modules/lokker/lokker.c @@ -42,19 +42,6 @@ lokker_is_pin(void) return e_config->desklock_auth_method == E_DESKLOCK_AUTH_METHOD_PIN; } -static int -_zone_count_get(void) -{ - int num = 0; - const Eina_List *l; - E_Comp *comp; - - EINA_LIST_FOREACH(e_comp_list(), l, comp) - num += eina_list_count(comp->zones); - - return num; -} - static void _lokker_state_set(int state) { @@ -316,7 +303,7 @@ _text_login_box_add(Lokker_Popup *lp) zone = lp->zone; last_active_zone = current_zone = e_util_zone_current_get(e_manager_current_get()); - total_zone_num = _zone_count_get(); + total_zone_num = eina_list_count(e_comp->zones); if (total_zone_num > 1) { if ((e_config->desklock_login_box_zone == -2) && (zone != current_zone)) @@ -424,7 +411,7 @@ _lokker_popup_add(E_Zone *zone) evas_object_clip_set(lp->comp_object, lp->zone->bg_clip_object); last_active_zone = current_zone = e_util_zone_current_get(e_manager_current_get()); - total_zone_num = _zone_count_get(); + total_zone_num = eina_list_count(e_comp->zones); if (total_zone_num > 1) { if ((e_config->desklock_login_box_zone == -2) && (zone != current_zone)) @@ -775,8 +762,6 @@ EINTERN Eina_Bool lokker_lock(void) { int total_zone_num = 0; - const Eina_List *l; - E_Comp *comp; if (edd) return EINA_TRUE; @@ -791,11 +776,8 @@ lokker_lock(void) edd = E_NEW(Lokker_Data, 1); if (!edd) return EINA_FALSE; - EINA_LIST_FOREACH(e_comp_list(), l, comp) - { - E_LIST_FOREACH(comp->zones, _lokker_popup_add); - total_zone_num += eina_list_count(comp->zones); - } + E_LIST_FOREACH(e_comp->zones, _lokker_popup_add); + total_zone_num = eina_list_count(e_comp->zones); /* handlers */ E_LIST_HANDLER_APPEND(edd->handlers, ECORE_EVENT_KEY_DOWN, _lokker_cb_key_down, NULL); diff --git a/src/modules/notification/e_mod_popup.c b/src/modules/notification/e_mod_popup.c index a1826e068..21684bb58 100644 --- a/src/modules/notification/e_mod_popup.c +++ b/src/modules/notification/e_mod_popup.c @@ -181,37 +181,35 @@ _notification_theme_cb_find(Popup_Data *popup, const char *emission __UNUSED__, const char *source __UNUSED__) { - const Eina_List *l, *ll; + const Eina_List *l; E_Client *ec; - E_Comp *comp; if (!popup->app_name) return; - EINA_LIST_FOREACH(e_comp_list(), l, comp) - EINA_LIST_FOREACH(comp->clients, ll, ec) - { - size_t len, test; - const char *name; + EINA_LIST_FOREACH(e_comp->clients, l, ec) + { + size_t len, test; + const char *name; - if (e_client_util_ignored_get(ec)) continue; - len = strlen(popup->app_name); - name = e_client_util_name_get(ec); - if (!name) continue; - test = eina_strlen_bounded(name, len + 1); + if (e_client_util_ignored_get(ec)) continue; + len = strlen(popup->app_name); + name = e_client_util_name_get(ec); + if (!name) continue; + test = eina_strlen_bounded(name, len + 1); - /* We can't be sure that the app_name really match the application name. - * Some plugin put their name instead. But this search gives some good - * results. - */ - if (strncasecmp(name, popup->app_name, (test < len) ? test : len)) - continue; + /* We can't be sure that the app_name really match the application name. + * Some plugin put their name instead. But this search gives some good + * results. + */ + if (strncasecmp(name, popup->app_name, (test < len) ? test : len)) + continue; - e_desk_show(ec->desk); - evas_object_show(ec->frame); - evas_object_raise(ec->frame); - e_client_focus_set_with_pointer(ec); - break; - } + e_desk_show(ec->desk); + evas_object_show(ec->frame); + evas_object_raise(ec->frame); + e_client_focus_set_with_pointer(ec); + break; + } } static void diff --git a/src/modules/pager_plain/e_mod_main.c b/src/modules/pager_plain/e_mod_main.c index 89434f7cd..434bf2c1f 100644 --- a/src/modules/pager_plain/e_mod_main.c +++ b/src/modules/pager_plain/e_mod_main.c @@ -1734,7 +1734,6 @@ _pager_cb_event_bg_update(void *data __UNUSED__, int type __UNUSED__, void *even Eina_List *l, *ll; Pager *p; Pager_Desk *pd; - E_Comp *comp; E_Zone *zone; E_Desk *desk; @@ -1745,9 +1744,7 @@ _pager_cb_event_bg_update(void *data __UNUSED__, int type __UNUSED__, void *even _pager_desk_livethumb_setup(pd); return ECORE_CALLBACK_RENEW; } - comp = eina_list_nth(e_comp_list(), ev->manager); - if (!comp) return ECORE_CALLBACK_RENEW; - zone = eina_list_nth(comp->zones, ev->zone); + zone = eina_list_nth(e_comp->zones, ev->zone); if (!zone) return ECORE_CALLBACK_RENEW; desk = e_desk_at_xy_get(zone, ev->desk_x, ev->desk_y); if (!zone) return ECORE_CALLBACK_RENEW; diff --git a/src/modules/policy_mobile/e_mod_config.c b/src/modules/policy_mobile/e_mod_config.c index 5d6f12f52..dcbc641c6 100644 --- a/src/modules/policy_mobile/e_mod_config.c +++ b/src/modules/policy_mobile/e_mod_config.c @@ -84,7 +84,6 @@ _pol_cfd_data_free(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdat static int _pol_cfd_data_basic_apply(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdata) { - E_Comp *comp; E_Zone *zone; E_Desk *desk; Pol_Softkey *softkey; @@ -133,8 +132,7 @@ _pol_cfd_data_basic_apply(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data EINA_LIST_FOREACH(cfdata->conf->desks, l, d) { - comp = e_comp_number_get(d->comp_num); - zone = e_comp_zone_number_get(comp, d->zone_num); + zone = e_comp_zone_number_get(e_comp, d->zone_num); desk = e_desk_at_xy_get(zone, d->x, d->y); if (!desk) continue; diff --git a/src/modules/policy_mobile/e_mod_main.c b/src/modules/policy_mobile/e_mod_main.c index 2d8b86e92..710c26a6c 100644 --- a/src/modules/policy_mobile/e_mod_main.c +++ b/src/modules/policy_mobile/e_mod_main.c @@ -422,10 +422,8 @@ void e_mod_pol_desk_add(E_Desk *desk) { Pol_Desk *pd; - E_Comp *comp; E_Client *ec; Pol_Softkey *softkey; - const Eina_List *l; pd = eina_hash_find(hash_pol_desks, &desk); if (pd) return; @@ -437,12 +435,11 @@ e_mod_pol_desk_add(E_Desk *desk) eina_hash_add(hash_pol_desks, &desk, pd); /* add clients */ - EINA_LIST_FOREACH(e_comp_list(), l, comp) - E_CLIENT_FOREACH(comp, ec) - { - if (pd->desk == ec->desk) - _pol_client_add(ec); - } + E_CLIENT_FOREACH(e_comp, ec) + { + if (pd->desk == ec->desk) + _pol_client_add(ec); + } /* add and show softkey */ if (_pol_mod->conf->use_softkey) @@ -534,10 +531,9 @@ EAPI void * e_modapi_init(E_Module *m) { Mod *mod; - E_Comp *comp; E_Zone *zone; Config_Desk *d; - const Eina_List *l, *ll; + const Eina_List *l; int i, n; char buf[PATH_MAX]; @@ -560,32 +556,31 @@ e_modapi_init(E_Module *m) e_mod_pol_conf_init(mod); - EINA_LIST_FOREACH(e_comp_list(), l, comp) - EINA_LIST_FOREACH(comp->zones, ll, zone) - { - //Eina_Bool home_add = EINA_FALSE; - n = zone->desk_y_count * zone->desk_x_count; - for (i = 0; i < n; i++) - { - d = e_mod_pol_conf_desk_get_by_nums(_pol_mod->conf, - comp->num, - zone->num, - zone->desks[i]->x, - zone->desks[i]->y); - if (d) - { - e_mod_pol_desk_add(zone->desks[i]); - //home_add = EINA_TRUE; - } - } + EINA_LIST_FOREACH(e_comp->zones, l, zone) + { + //Eina_Bool home_add = EINA_FALSE; + n = zone->desk_y_count * zone->desk_x_count; + for (i = 0; i < n; i++) + { + d = e_mod_pol_conf_desk_get_by_nums(_pol_mod->conf, + e_comp->num, + zone->num, + zone->desks[i]->x, + zone->desks[i]->y); + if (d) + { + e_mod_pol_desk_add(zone->desks[i]); + //home_add = EINA_TRUE; + } + } - /* FIXME: should consider the case that illume-home module - * is not loaded yet and make it configurable. - * and also, this code will be enabled when e_policy stuff lands in e. - */ - //if (home_add) - // e_policy_zone_home_add_request(zone); - } + /* FIXME: should consider the case that illume-home module + * is not loaded yet and make it configurable. + * and also, this code will be enabled when e_policy stuff lands in e. + */ + //if (home_add) + // e_policy_zone_home_add_request(zone); + } E_LIST_HANDLER_APPEND(handlers, E_EVENT_ZONE_ADD, _pol_cb_zone_add, NULL); E_LIST_HANDLER_APPEND(handlers, E_EVENT_ZONE_DEL, _pol_cb_zone_del, NULL); diff --git a/src/modules/quickaccess/e_mod_quickaccess.c b/src/modules/quickaccess/e_mod_quickaccess.c index 04533f928..05ca7c3b8 100644 --- a/src/modules/quickaccess/e_mod_quickaccess.c +++ b/src/modules/quickaccess/e_mod_quickaccess.c @@ -592,22 +592,19 @@ _e_qa_begin(void) } if (count) { - E_Comp *comp; - const Eina_List *lll; /* some non-transient entries exist without assigned borders * try assigning from existing borders */ - EINA_LIST_FOREACH(e_comp_list(), lll, comp) - EINA_LIST_FOREACH(comp->clients, l, ec) - { - if (e_client_util_ignored_get(ec)) continue; - entry = _e_qa_entry_find_match(ec, 1); - if ((!entry) || entry->client) continue; - DBG("border=%p matches entry %s", ec, entry->id); - _e_qa_entry_border_associate(entry, ec); - count--; - if (!count) break; - } + EINA_LIST_FOREACH(e_comp->clients, l, ec) + { + if (e_client_util_ignored_get(ec)) continue; + entry = _e_qa_entry_find_match(ec, 1); + if ((!entry) || entry->client) continue; + DBG("border=%p matches entry %s", ec, entry->id); + _e_qa_entry_border_associate(entry, ec); + count--; + if (!count) break; + } } } diff --git a/src/modules/tiling/e_mod_tiling.c b/src/modules/tiling/e_mod_tiling.c index 5e3a721f2..d02f4165a 100644 --- a/src/modules/tiling/e_mod_tiling.c +++ b/src/modules/tiling/e_mod_tiling.c @@ -1535,24 +1535,20 @@ _disable_all_tiling(void) static void _foreach_desk(void (*func)(E_Desk *desk)) { - const Eina_List *l, *ll; - E_Comp *comp; + const Eina_List *l; E_Zone *zone; E_Desk *desk; int x, y; - EINA_LIST_FOREACH(e_comp_list(), l, comp) + EINA_LIST_FOREACH(e_comp->zones, l, zone) { - EINA_LIST_FOREACH(comp->zones, ll, zone) + for (x = 0; x < zone->desk_x_count; x++) { - for (x = 0; x < zone->desk_x_count; x++) + for (y = 0; y < zone->desk_y_count; y++) { - for (y = 0; y < zone->desk_y_count; y++) - { - desk = zone->desks[x + (y * zone->desk_x_count)]; + desk = zone->desks[x + (y * zone->desk_x_count)]; - func(desk); - } + func(desk); } } } diff --git a/src/modules/wizard/e_wizard.c b/src/modules/wizard/e_wizard.c index 18ee7e1d6..388abe608 100644 --- a/src/modules/wizard/e_wizard.c +++ b/src/modules/wizard/e_wizard.c @@ -34,19 +34,15 @@ static Ecore_Timer *next_timer = NULL; EAPI int e_wizard_init(void) { - E_Comp *comp; E_Zone *zone; - const Eina_List *l, *ll; + const Eina_List *l; - EINA_LIST_FOREACH(e_comp_list(), l, comp) + EINA_LIST_FOREACH(e_comp->zones, l, zone) { - EINA_LIST_FOREACH(comp->zones, ll, zone) - { - if (!pop) - pop = _e_wizard_main_new(zone); - else - pops = eina_list_append(pops, _e_wizard_extra_new(zone)); - } + if (!pop) + pop = _e_wizard_main_new(zone); + else + pops = eina_list_append(pops, _e_wizard_extra_new(zone)); } E_LIST_HANDLER_APPEND(handlers, EFREET_EVENT_DESKTOP_CACHE_BUILD,