diff options
Diffstat (limited to 'src/modules/illume2/policies/illume/policy.c')
-rw-r--r-- | src/modules/illume2/policies/illume/policy.c | 1371 |
1 files changed, 669 insertions, 702 deletions
diff --git a/src/modules/illume2/policies/illume/policy.c b/src/modules/illume2/policies/illume/policy.c index 5e619a2c4c..7de78af06e 100644 --- a/src/modules/illume2/policies/illume/policy.c +++ b/src/modules/illume2/policies/illume/policy.c @@ -9,67 +9,67 @@ #define DIALOG_USES_PIXEL_BORDER 1 /* local function prototypes */ -static void _policy_border_set_focus(E_Border *bd); -static void _policy_border_move(E_Border *bd, int x, int y); -static void _policy_border_resize(E_Border *bd, int w, int h); -static void _policy_border_hide_above(E_Border *bd); -static void _policy_border_hide_below(E_Border *bd); -static void _policy_border_show_below(E_Border *bd); +static void _policy_border_set_focus(E_Client *ec); +static void _policy_border_move(E_Client *ec, int x, int y); +static void _policy_border_resize(E_Client *ec, int w, int h); +static void _policy_border_hide_above(E_Client *ec); +static void _policy_border_hide_below(E_Client *ec); +static void _policy_border_show_below(E_Client *ec); static void _policy_zone_layout_update(E_Zone *zone); -static void _policy_zone_layout_indicator(E_Border *bd, E_Illume_Config_Zone *cz); -static void _policy_zone_layout_quickpanel(E_Border *bd); -static void _policy_zone_layout_softkey(E_Border *bd, E_Illume_Config_Zone *cz); -static void _policy_zone_layout_keyboard(E_Border *bd, E_Illume_Config_Zone *cz); -static void _policy_zone_layout_home_single(E_Border *bd, E_Illume_Config_Zone *cz); -static void _policy_zone_layout_home_dual_top(E_Border *bd, E_Illume_Config_Zone *cz); -static void _policy_zone_layout_home_dual_custom(E_Border *bd, E_Illume_Config_Zone *cz); -static void _policy_zone_layout_home_dual_left(E_Border *bd, E_Illume_Config_Zone *cz); -static void _policy_zone_layout_fullscreen(E_Border *bd); -static void _policy_zone_layout_app_single(E_Border *bd, E_Illume_Config_Zone *cz); -static void _policy_zone_layout_app_dual_top(E_Border *bd, E_Illume_Config_Zone *cz); -static void _policy_zone_layout_app_dual_custom(E_Border *bd, E_Illume_Config_Zone *cz); -static void _policy_zone_layout_app_dual_left(E_Border *bd, E_Illume_Config_Zone *cz); -static void _policy_zone_layout_dialog(E_Border *bd, E_Illume_Config_Zone *cz); -static void _policy_zone_layout_splash(E_Border *bd, E_Illume_Config_Zone *cz); -static void _policy_zone_layout_conformant_single(E_Border *bd, E_Illume_Config_Zone *cz); -static void _policy_zone_layout_conformant_dual_top(E_Border *bd, E_Illume_Config_Zone *cz); -static void _policy_zone_layout_conformant_dual_custom(E_Border *bd, E_Illume_Config_Zone *cz); -static void _policy_zone_layout_conformant_dual_left(E_Border *bd, E_Illume_Config_Zone *cz); +static void _policy_zone_layout_indicator(E_Client *ec, E_Illume_Config_Zone *cz); +static void _policy_zone_layout_quickpanel(E_Client *ec); +static void _policy_zone_layout_softkey(E_Client *ec, E_Illume_Config_Zone *cz); +static void _policy_zone_layout_keyboard(E_Client *ec, E_Illume_Config_Zone *cz); +static void _policy_zone_layout_home_single(E_Client *ec, E_Illume_Config_Zone *cz); +static void _policy_zone_layout_home_dual_top(E_Client *ec, E_Illume_Config_Zone *cz); +static void _policy_zone_layout_home_dual_custom(E_Client *ec, E_Illume_Config_Zone *cz); +static void _policy_zone_layout_home_dual_left(E_Client *ec, E_Illume_Config_Zone *cz); +static void _policy_zone_layout_fullscreen(E_Client *ec); +static void _policy_zone_layout_app_single(E_Client *ec, E_Illume_Config_Zone *cz); +static void _policy_zone_layout_app_dual_top(E_Client *ec, E_Illume_Config_Zone *cz); +static void _policy_zone_layout_app_dual_custom(E_Client *ec, E_Illume_Config_Zone *cz); +static void _policy_zone_layout_app_dual_left(E_Client *ec, E_Illume_Config_Zone *cz); +static void _policy_zone_layout_dialog(E_Client *ec, E_Illume_Config_Zone *cz); +static void _policy_zone_layout_splash(E_Client *ec, E_Illume_Config_Zone *cz); +static void _policy_zone_layout_conformant_single(E_Client *ec, E_Illume_Config_Zone *cz); +static void _policy_zone_layout_conformant_dual_top(E_Client *ec, E_Illume_Config_Zone *cz); +static void _policy_zone_layout_conformant_dual_custom(E_Client *ec, E_Illume_Config_Zone *cz); +static void _policy_zone_layout_conformant_dual_left(E_Client *ec, E_Illume_Config_Zone *cz); static Eina_List *_pol_focus_stack; /* local functions */ static void -_policy_border_set_focus(E_Border *bd) +_policy_border_set_focus(E_Client *ec) { - if (!bd) return; + if (!ec) return; /* if focus is locked out then get out */ - if (bd->lock_focus_out) return; + if (ec->lock_focus_out) return; /* make sure the border can accept or take focus */ - if ((bd->client.icccm.accepts_focus) || (bd->client.icccm.take_focus)) + if ((ec->icccm.accepts_focus) || (ec->icccm.take_focus)) { /* check E's focus settings */ if ((e_config->focus_setting == E_FOCUS_NEW_WINDOW) || - ((bd->parent) && + ((ec->parent) && ((e_config->focus_setting == E_FOCUS_NEW_DIALOG) || - ((bd->parent->focused) && + ((ec->parent->focused) && (e_config->focus_setting == E_FOCUS_NEW_DIALOG_IF_OWNER_FOCUSED))))) { /* if the border was hidden due to layout, we need to unhide */ - if (!bd->visible) e_illume_border_show(bd); + if (!ec->visible) e_illume_client_show(ec); - if ((bd->iconic) && (!bd->lock_user_iconify)) - e_border_uniconify(bd); + if ((ec->iconic) && (!ec->lock_user_iconify)) + e_client_uniconify(ec); - if (!bd->lock_user_stacking) e_border_raise(bd); + if (!ec->lock_user_stacking) evas_object_raise(ec->frame); /* focus the border */ - e_border_focus_set(bd, 1, 1); + evas_object_focus_set(ec->frame, 1); /* hide the border below this one */ - _policy_border_hide_below(bd); + _policy_border_hide_below(ec); /* NB: since we skip needless border evals when container layout * is called (to save cpu cycles), we need to @@ -79,202 +79,166 @@ _policy_border_set_focus(E_Border *bd) * This is potentially useless as THIS policy * makes all windows borderless anyway, but it's in here for * completeness - e_border_focus_latest_set(bd); - if (bd->bg_object) - edje_object_signal_emit(bd->bg_object, "e,state,focused", "e"); - if (bd->icon_object) - edje_object_signal_emit(bd->icon_object, "e,state,focused", "e"); - e_focus_event_focus_in(bd); + e_client_focus_latest_set(ec); + if (ec->bg_object) + edje_object_signal_emit(ec->bg_object, "e,state,focused", "e"); + if (ec->icon_object) + edje_object_signal_emit(ec->icon_object, "e,state,focused", "e"); + e_focus_event_focus_in(ec); */ } } } static void -_policy_border_move(E_Border *bd, int x, int y) +_policy_border_move(E_Client *ec, int x, int y) { - if (!bd) return; + if (!ec) return; /* NB: Qt uses a weird window type called 'VCLSalFrame' that needs to - * have bd->placed set else it doesn't position correctly... + * have ec->placed set else it doesn't position correctly... * this could be a result of E honoring the icccm request position, * not sure */ /* NB: Seems something similar happens with elementary windows also - * so for now just set bd->placed on all windows until this + * so for now just set ec->placed on all windows until this * gets investigated */ - bd->placed = 1; - bd->x = x; - bd->y = y; - bd->changes.pos = 1; - BD_CHANGED(bd); + ec->placed = 1; + ec->x = x; + ec->y = y; + ec->changes.pos = 1; + EC_CHANGED(ec); } static void -_policy_border_resize(E_Border *bd, int w, int h) +_policy_border_resize(E_Client *ec, int w, int h) { - if (!bd) return; - - bd->w = w; - bd->h = h; - bd->client.w = (bd->w - (bd->client_inset.l + bd->client_inset.r)); - bd->client.h = (bd->h - (bd->client_inset.t + bd->client_inset.b)); - bd->changes.size = 1; - BD_CHANGED(bd); + if (!ec) return; + + ec->w = w; + ec->h = h; + e_comp_object_frame_wh_unadjust(ec->frame, ec->w, ec->h, &ec->client.w, &ec->client.h); + ec->changes.size = 1; + EC_CHANGED(ec); } static void -_policy_border_hide_above(E_Border *bd) +_policy_border_hide_above(E_Client *ec) { - int pos = 0, layer = 0, i; - - if (!bd) return; + E_Client *b; - /* determine layering position */ - layer = bd->layer; - if (layer < 0) layer = 0; - pos = 1 + (layer / 50); - if (pos > 10) pos = 10; + if (!ec) return; - /* Find the windows above this one */ - for (i = (pos + 1); i < 11; i++) + E_CLIENT_REVERSE_FOREACH(ec->comp, b) { - Eina_List *l; - E_Border *b; - - EINA_LIST_REVERSE_FOREACH(bd->zone->container->layers[i].clients, l, b) - { - /* skip if it's the same border */ - if (b == bd) continue; - - /* skip if it's not on this zone */ - if (b->zone != bd->zone) continue; - - /* skip special borders */ - if (e_illume_border_is_indicator(b)) continue; - if (e_illume_border_is_softkey(b)) continue; - if (e_illume_border_is_keyboard(b)) continue; - if (e_illume_border_is_quickpanel(b)) continue; - if (e_illume_border_is_home(b)) continue; - - e_border_iconify(b); - } + if (e_client_util_ignored_get(b)) continue; + if (b->layer <= ec->layer) break; + /* skip if it's the same border */ + if (b == ec) continue; + + /* skip if it's not on this zone */ + if (b->zone != ec->zone) continue; + + /* skip special borders */ + if (e_illume_client_is_indicator(b)) continue; + if (e_illume_client_is_softkey(b)) continue; + if (e_illume_client_is_keyboard(b)) continue; + if (e_illume_client_is_quickpanel(b)) continue; + if (e_illume_client_is_home(b)) continue; + + e_client_iconify(b); } } static void -_policy_border_hide_below(E_Border *bd) +_policy_border_hide_below(E_Client *ec) { - int pos = 0, layer = 0, i; - - if (!bd) return; + E_Client *b; - /* determine layering position */ - layer = bd->layer; - if (layer < 0) layer = 0; - pos = 1 + (layer / 50); - if (pos > 10) pos = 10; + if (!ec) return; - /* Find the windows below this one */ - for (i = (pos - 1); i >= 0; i--) + E_CLIENT_FOREACH(ec->comp, b) { - Eina_List *l; - E_Border *b; - - EINA_LIST_FOREACH(bd->zone->container->layers[i].clients, l, b) - { - /* skip if it's the same border */ - if (b == bd) continue; + if (e_client_util_ignored_get(b)) continue; + /* break if it's the same client */ + if (b == ec) break; - /* skip if it's not on this zone */ - if (b->zone != bd->zone) continue; + /* skip if it's not on this zone */ + if (b->zone != ec->zone) continue; - /* skip special borders */ - if (e_illume_border_is_indicator(b)) continue; - if (e_illume_border_is_softkey(b)) continue; - if (e_illume_border_is_keyboard(b)) continue; - if (e_illume_border_is_quickpanel(b)) continue; - if (e_illume_border_is_home(b)) continue; + /* skip special borders */ + if (e_illume_client_is_indicator(b)) continue; + if (e_illume_client_is_softkey(b)) continue; + if (e_illume_client_is_keyboard(b)) continue; + if (e_illume_client_is_quickpanel(b)) continue; + if (e_illume_client_is_home(b)) continue; - if ((bd->fullscreen) || (bd->need_fullscreen)) - { - if (b->visible) e_illume_border_hide(b); - } - else + if ((ec->fullscreen) || (ec->need_fullscreen)) + { + if (b->visible) e_illume_client_hide(b); + } + else + { + /* we need to check x/y position */ + if (E_CONTAINS(ec->x, ec->y, ec->w, ec->h, + b->x, b->y, b->w, b->h)) { - /* we need to check x/y position */ - if (E_CONTAINS(bd->x, bd->y, bd->w, bd->h, - b->x, b->y, b->w, b->h)) - { - if (b->visible) e_illume_border_hide(b); - } + if (b->visible) e_illume_client_hide(b); } } } } static void -_policy_border_show_below(E_Border *bd) +_policy_border_show_below(E_Client *ec) { Eina_List *l; - E_Border *prev; - int pos = 0, layer = 0, i; + E_Client *prev, *b; // printf("Show Borders Below: %s %d %d\n", -// bd->client.icccm.class, bd->x, bd->y); +// ec->icccm.class, ec->x, ec->y); - if (!bd) return; + if (!ec) return; - if (bd->client.icccm.transient_for) + if (ec->icccm.transient_for) { - if ((prev = e_border_find_by_client_window(bd->client.icccm.transient_for))) + if ((prev = e_pixmap_find_client(E_PIXMAP_TYPE_X, ec->icccm.transient_for))) { _policy_border_set_focus(prev); return; } } - /* determine layering position */ - layer = bd->layer; - if (layer < 0) layer = 0; - pos = 1 + (layer / 50); - if (pos > 10) pos = 10; - - /* Find the windows below this one */ - for (i = (pos + 1); i < 11; i++) + E_CLIENT_FOREACH(ec->comp, b) { - E_Border *b; - - EINA_LIST_REVERSE_FOREACH(bd->zone->container->layers[i].clients, l, b) - { - /* skip if it's the same border */ - if (b == bd) continue; + if (e_client_util_ignored_get(b)) continue; + /* break if it's the same border */ + if (b == ec) break; - /* skip if it's not on this zone */ - if (b->zone != bd->zone) continue; + /* skip if it's not on this zone */ + if (b->zone != ec->zone) continue; - /* skip special borders */ - if (e_illume_border_is_indicator(b)) continue; - if (e_illume_border_is_softkey(b)) continue; - if (e_illume_border_is_keyboard(b)) continue; - if (e_illume_border_is_quickpanel(b)) continue; - if (e_illume_border_is_home(b)) continue; + /* skip special borders */ + if (e_illume_client_is_indicator(b)) continue; + if (e_illume_client_is_softkey(b)) continue; + if (e_illume_client_is_keyboard(b)) continue; + if (e_illume_client_is_quickpanel(b)) continue; + if (e_illume_client_is_home(b)) continue; - if ((bd->fullscreen) || (bd->need_fullscreen)) + if ((ec->fullscreen) || (ec->need_fullscreen)) + { + _policy_border_set_focus(b); + return; + } + else + { + /* need to check x/y position */ + if (E_CONTAINS(ec->x, ec->y, ec->w, ec->h, + b->x, b->y, b->w, b->h)) { _policy_border_set_focus(b); return; } - else - { - /* need to check x/y position */ - if (E_CONTAINS(bd->x, bd->y, bd->w, bd->h, - b->x, b->y, b->w, b->h)) - { - _policy_border_set_focus(b); - return; - } - } } } @@ -282,85 +246,86 @@ _policy_border_show_below(E_Border *bd) * this one, so show previous window in stack */ EINA_LIST_REVERSE_FOREACH(_pol_focus_stack, l, prev) { - if (prev->zone != bd->zone) continue; + if (prev->zone != ec->zone) continue; _policy_border_set_focus(prev); return; } /* Fallback to focusing home if all above fails */ - _policy_focus_home(bd->zone); + _policy_focus_home(ec->zone); } static void _policy_zone_layout_update(E_Zone *zone) { Eina_List *l; - E_Border *bd; + E_Client *ec; if (!zone) return; - EINA_LIST_FOREACH(e_border_client_list(), l, bd) + EINA_LIST_FOREACH(zone->comp->clients, l, ec) { + if (e_client_util_ignored_get(ec)) continue; /* skip borders not on this zone */ - if (bd->zone != zone) continue; + if (ec->zone != zone) continue; /* skip special windows */ - if (e_object_is_del(E_OBJECT(bd))) continue; - if (e_illume_border_is_keyboard(bd)) continue; - if (e_illume_border_is_quickpanel(bd)) continue; + if (e_object_is_del(E_OBJECT(ec))) continue; + if (e_illume_client_is_keyboard(ec)) continue; + if (e_illume_client_is_quickpanel(ec)) continue; /* signal a changed pos here so layout gets updated */ - bd->changes.pos = 1; - BD_CHANGED(bd); + ec->changes.pos = 1; + EC_CHANGED(ec); } } static void -_policy_zone_layout_indicator(E_Border *bd, E_Illume_Config_Zone *cz) +_policy_zone_layout_indicator(E_Client *ec, E_Illume_Config_Zone *cz) { - if ((!bd) || (!cz)) return; + if ((!ec) || (!cz)) return; /* grab minimum indicator size */ - e_illume_border_min_get(bd, NULL, &cz->indicator.size); + e_illume_client_min_get(ec, NULL, &cz->indicator.size); /* no point in doing anything here if indicator is hidden */ - if ((!bd->new_client) && (!bd->visible)) + if ((!ec->new_client) && (!ec->visible)) { - ecore_x_e_illume_indicator_geometry_set(bd->zone->black_win, + ecore_x_e_illume_indicator_geometry_set(ec->zone->black_win, 0, 0, 0, 0); return; } /* if we are dragging, then skip it for now */ - if (bd->client.illume.drag.drag) + if (ec->illume.drag.drag) { /* when dragging indicator, we need to trigger a layout update */ - ecore_x_e_illume_indicator_geometry_set(bd->zone->black_win, + ecore_x_e_illume_indicator_geometry_set(ec->zone->black_win, 0, 0, 0, 0); - _policy_zone_layout_update(bd->zone); + _policy_zone_layout_update(ec->zone); return; } -// printf("\tLayout Indicator: %d\n", bd->zone->num); +// printf("\tLayout Indicator: %d\n", ec->zone->num); /* lock indicator window from dragging if we need to */ if ((cz->mode.dual == 1) && (cz->mode.side == 0)) - ecore_x_e_illume_drag_locked_set(bd->client.win, 0); + ecore_x_e_illume_drag_locked_set(e_client_util_win_get(ec), 0); else - ecore_x_e_illume_drag_locked_set(bd->client.win, 1); + ecore_x_e_illume_drag_locked_set(e_client_util_win_get(ec), 1); /* make sure it's the required width & height */ - if ((bd->w != bd->zone->w) || (bd->h != cz->indicator.size)) - _policy_border_resize(bd, bd->zone->w, cz->indicator.size); + if ((ec->w != ec->zone->w) || (ec->h != cz->indicator.size)) + _policy_border_resize(ec, ec->zone->w, cz->indicator.size); /* are we in single mode ? */ if (!cz->mode.dual) { /* move to 0, 0 (relative to zone) if needed */ - if ((bd->x != bd->zone->x) || (bd->y != bd->zone->y)) + if ((ec->x != ec->zone->x) || (ec->y != ec->zone->y)) { - _policy_border_move(bd, bd->zone->x, bd->zone->y); - ecore_x_e_illume_quickpanel_position_update_send(bd->client.win); + _policy_border_move(ec, ec->zone->x, ec->zone->y); + ecore_x_e_illume_quickpanel_position_update_send(e_client_util_win_get(ec)); } } else @@ -372,377 +337,377 @@ _policy_zone_layout_indicator(E_Border *bd, E_Illume_Config_Zone *cz) * in this case, the indicator itself should be responsible for * sending the quickpanel position update message when it is * finished dragging */ - if (bd->x != bd->zone->x) - _policy_border_move(bd, bd->zone->x, bd->y); + if (ec->x != ec->zone->x) + _policy_border_move(ec, ec->zone->x, ec->y); } else { /* move to 0, 0 (relative to zone) if needed */ - if ((bd->x != bd->zone->x) || (bd->y != bd->zone->y)) + if ((ec->x != ec->zone->x) || (ec->y != ec->zone->y)) { - _policy_border_move(bd, bd->zone->x, bd->zone->y); - ecore_x_e_illume_quickpanel_position_update_send(bd->client.win); + _policy_border_move(ec, ec->zone->x, ec->zone->y); + ecore_x_e_illume_quickpanel_position_update_send(e_client_util_win_get(ec)); } } } - ecore_x_e_illume_indicator_geometry_set(bd->zone->black_win, - bd->x, bd->y, - bd->w, bd->h); + ecore_x_e_illume_indicator_geometry_set(ec->zone->black_win, + ec->x, ec->y, + ec->w, ec->h); /* set layer if needed */ - if (bd->layer != POL_INDICATOR_LAYER) - e_border_layer_set(bd, POL_INDICATOR_LAYER); + if (ec->layer != POL_INDICATOR_LAYER) + evas_object_layer_set(ec->frame, POL_INDICATOR_LAYER); } static void -_policy_zone_layout_quickpanel(E_Border *bd) +_policy_zone_layout_quickpanel(E_Client *ec) { int mh; - if (!bd) return; + if (!ec) return; /* grab minimum size */ - e_illume_border_min_get(bd, NULL, &mh); + e_illume_client_min_get(ec, NULL, &mh); /* resize if needed */ - if ((bd->w != bd->zone->w) || (bd->h != mh)) - _policy_border_resize(bd, bd->zone->w, mh); + if ((ec->w != ec->zone->w) || (ec->h != mh)) + _policy_border_resize(ec, ec->zone->w, mh); /* set layer if needed */ - if (bd->layer != POL_QUICKPANEL_LAYER) - e_border_layer_set(bd, POL_QUICKPANEL_LAYER); + if (ec->layer != POL_QUICKPANEL_LAYER) + evas_object_layer_set(ec->frame, POL_QUICKPANEL_LAYER); } static void -_policy_zone_layout_softkey(E_Border *bd, E_Illume_Config_Zone *cz) +_policy_zone_layout_softkey(E_Client *ec, E_Illume_Config_Zone *cz) { int ny; - if (!bd) return; + if (!ec) return; /* grab minimum softkey size */ - e_illume_border_min_get(bd, NULL, &cz->softkey.size); + e_illume_client_min_get(ec, NULL, &cz->softkey.size); /* no point in doing anything here if softkey is hidden */ - if (!bd->visible) + if (!ec->visible) { - ecore_x_e_illume_softkey_geometry_set(bd->zone->black_win, + ecore_x_e_illume_softkey_geometry_set(ec->zone->black_win, 0, 0, 0, 0); return; } /* if we are dragging, then skip it for now */ /* NB: Disabled currently until we confirm that softkey should be draggable */ -// if (bd->client.illume.drag.drag) return; +// if (ec->illume.drag.drag) return; /* make sure it's the required width & height */ - if ((bd->w != bd->zone->w) || (bd->h != cz->softkey.size)) - _policy_border_resize(bd, bd->zone->w, cz->softkey.size); + if ((ec->w != ec->zone->w) || (ec->h != cz->softkey.size)) + _policy_border_resize(ec, ec->zone->w, cz->softkey.size); /* make sure it's in the correct position */ - ny = ((bd->zone->y + bd->zone->h) - cz->softkey.size); + ny = ((ec->zone->y + ec->zone->h) - cz->softkey.size); /* NB: not sure why yet, but on startup the border->y is reporting * that it is already in this position...but it's actually not. * So for now, just disable the ny check until this gets sorted out */ -// if ((bd->x != bd->zone->x) || (bd->y != ny)) - _policy_border_move(bd, bd->zone->x, ny); +// if ((ec->x != ec->zone->x) || (ec->y != ny)) + _policy_border_move(ec, ec->zone->x, ny); // set property for apps to find out they are - ecore_x_e_illume_softkey_geometry_set(bd->zone->black_win, - bd->x, bd->y, - bd->w, bd->h); + ecore_x_e_illume_softkey_geometry_set(ec->zone->black_win, + ec->x, ec->y, + ec->w, ec->h); /* set layer if needed */ - if (bd->layer != POL_SOFTKEY_LAYER) - e_border_layer_set(bd, POL_SOFTKEY_LAYER); + if (ec->layer != POL_SOFTKEY_LAYER) + evas_object_layer_set(ec->frame, POL_SOFTKEY_LAYER); } static void -_policy_zone_layout_keyboard(E_Border *bd, E_Illume_Config_Zone *cz) +_policy_zone_layout_keyboard(E_Client *ec, E_Illume_Config_Zone *cz) { int ny, layer; // printf("\tLayout Keyboard\n"); - if ((!bd) || (!cz)) return; + if ((!ec) || (!cz)) return; /* no point in adjusting size or position if it's not visible */ - if (!bd->visible) return; + if (!ec->visible) return; /* grab minimum keyboard size */ - e_illume_border_min_get(bd, NULL, &cz->vkbd.size); + e_illume_client_min_get(ec, NULL, &cz->vkbd.size); /* make sure it's the required width & height */ - if ((bd->w != bd->zone->w) || (bd->h != cz->vkbd.size)) - _policy_border_resize(bd, bd->zone->w, cz->vkbd.size); + if ((ec->w != ec->zone->w) || (ec->h != cz->vkbd.size)) + _policy_border_resize(ec, ec->zone->w, cz->vkbd.size); /* make sure it's in the correct position */ - ny = ((bd->zone->y + bd->zone->h) - cz->vkbd.size); - if ((bd->x != bd->zone->x) || (bd->y != ny)) - _policy_border_move(bd, bd->zone->x, ny); + ny = ((ec->zone->y + ec->zone->h) - cz->vkbd.size); + if ((ec->x != ec->zone->x) || (ec->y != ny)) + _policy_border_move(ec, ec->zone->x, ny); /* check layer according to fullscreen state */ - if ((bd->fullscreen) || (bd->need_fullscreen)) + if ((ec->fullscreen) || (ec->need_fullscreen)) layer = POL_FULLSCREEN_LAYER; else layer = POL_KEYBOARD_LAYER; /* set layer if needed */ - if ((int)bd->layer != layer) e_border_layer_set(bd, layer); + if ((int)ec->layer != layer) evas_object_layer_set(ec->frame, layer); } static void -_policy_zone_layout_home_single(E_Border *bd, E_Illume_Config_Zone *cz) +_policy_zone_layout_home_single(E_Client *ec, E_Illume_Config_Zone *cz) { int ny, nh, indsz = 0, sftsz = 0; - E_Border *ind, *sft; + E_Client *ind, *sft; - if ((!bd) || (!cz)) return; + if ((!ec) || (!cz)) return; /* no point in adjusting size or position if it's not visible */ - if (!bd->visible) return; + if (!ec->visible) return; -// printf("\tLayout Home Single: %s\n", bd->client.icccm.class); +// printf("\tLayout Home Single: %s\n", ec->icccm.class); indsz = cz->indicator.size; sftsz = cz->softkey.size; - if ((ind = e_illume_border_indicator_get(bd->zone))) + if ((ind = e_illume_client_indicator_get(ec->zone))) { if (!ind->visible) indsz = 0; } - if ((sft = e_illume_border_softkey_get(bd->zone))) + if ((sft = e_illume_client_softkey_get(ec->zone))) { if (!sft->visible) sftsz = 0; } /* make sure it's the required width & height */ - if (e_illume_border_is_conformant(bd)) nh = bd->zone->h; - else nh = (bd->zone->h - indsz - sftsz); + if (e_illume_client_is_conformant(ec)) nh = ec->zone->h; + else nh = (ec->zone->h - indsz - sftsz); - if ((bd->w != bd->zone->w) || (bd->h != nh)) - _policy_border_resize(bd, bd->zone->w, nh); + if ((ec->w != ec->zone->w) || (ec->h != nh)) + _policy_border_resize(ec, ec->zone->w, nh); /* move to correct position (relative to zone) if needed */ - if (e_illume_border_is_conformant(bd)) ny = bd->zone->y; - else ny = (bd->zone->y + indsz); - if ((bd->x != bd->zone->x) || (bd->y != ny)) - _policy_border_move(bd, bd->zone->x, ny); + if (e_illume_client_is_conformant(ec)) ny = ec->zone->y; + else ny = (ec->zone->y + indsz); + if ((ec->x != ec->zone->x) || (ec->y != ny)) + _policy_border_move(ec, ec->zone->x, ny); /* set layer if needed */ - if (bd->layer != POL_HOME_LAYER) e_border_layer_set(bd, POL_HOME_LAYER); + if (ec->layer != POL_HOME_LAYER) evas_object_layer_set(ec->frame, POL_HOME_LAYER); } static void -_policy_zone_layout_home_dual_top(E_Border *bd, E_Illume_Config_Zone *cz) +_policy_zone_layout_home_dual_top(E_Client *ec, E_Illume_Config_Zone *cz) { - E_Border *home, *ind, *sft; + E_Client *home, *ind, *sft; int ny, nh, indsz = 0, sftsz = 0; - if ((!bd) || (!cz)) return; + if ((!ec) || (!cz)) return; /* no point in adjusting size or position if it's not visible */ - if (!bd->visible) return; + if (!ec->visible) return; indsz = cz->indicator.size; sftsz = cz->softkey.size; - if ((ind = e_illume_border_indicator_get(bd->zone))) + if ((ind = e_illume_client_indicator_get(ec->zone))) { if (!ind->visible) indsz = 0; } - if ((sft = e_illume_border_softkey_get(bd->zone))) + if ((sft = e_illume_client_softkey_get(ec->zone))) { if (!sft->visible) sftsz = 0; } /* set some defaults */ - ny = (bd->zone->y + indsz); - nh = ((bd->zone->h - indsz - sftsz) / 2); + ny = (ec->zone->y + indsz); + nh = ((ec->zone->h - indsz - sftsz) / 2); /* see if there are any other home windows */ - home = e_illume_border_home_get(bd->zone); + home = e_illume_client_home_get(ec->zone); if (home) { - if (bd != home) ny = (home->y + nh); + if (ec != home) ny = (home->y + nh); } /* make sure it's the required width & height */ - if ((bd->w != bd->zone->w) || (bd->h != nh)) - _policy_border_resize(bd, bd->zone->w, nh); + if ((ec->w != ec->zone->w) || (ec->h != nh)) + _policy_border_resize(ec, ec->zone->w, nh); /* move to correct position (relative to zone) if needed */ - if ((bd->x != bd->zone->x) || (bd->y != ny)) - _policy_border_move(bd, bd->zone->x, ny); + if ((ec->x != ec->zone->x) || (ec->y != ny)) + _policy_border_move(ec, ec->zone->x, ny); /* set layer if needed */ - if (bd->layer != POL_HOME_LAYER) e_border_layer_set(bd, POL_HOME_LAYER); + if (ec->layer != POL_HOME_LAYER) evas_object_layer_set(ec->frame, POL_HOME_LAYER); } static void -_policy_zone_layout_home_dual_custom(E_Border *bd, E_Illume_Config_Zone *cz) +_policy_zone_layout_home_dual_custom(E_Client *ec, E_Illume_Config_Zone *cz) { - E_Border *home; + E_Client *home; int iy, ny, nh; -// printf("\tLayout Home Dual Custom: %s\n", bd->client.icccm.class); +// printf("\tLayout Home Dual Custom: %s\n", ec->icccm.class); - if ((!bd) || (!cz)) return; + if ((!ec) || (!cz)) return; /* no point in adjusting size or position if it's not visible */ - if (!bd->visible) return; + if (!ec->visible) return; /* grab indicator position */ - e_illume_border_indicator_pos_get(bd->zone, NULL, &iy); + e_illume_client_indicator_pos_get(ec->zone, NULL, &iy); /* set some defaults */ - ny = bd->zone->y; + ny = ec->zone->y; nh = iy; /* see if there are any other home windows */ - home = e_illume_border_home_get(bd->zone); - if ((home) && (bd != home)) + home = e_illume_client_home_get(ec->zone); + if ((home) && (ec != home)) { ny = (iy + cz->indicator.size); - nh = ((bd->zone->y + bd->zone->h) - ny - cz->softkey.size); + nh = ((ec->zone->y + ec->zone->h) - ny - cz->softkey.size); } /* make sure it's the required width & height */ - if ((bd->w != bd->zone->w) || (bd->h != nh)) - _policy_border_resize(bd, bd->zone->w, nh); + if ((ec->w != ec->zone->w) || (ec->h != nh)) + _policy_border_resize(ec, ec->zone->w, nh); /* move to correct position (relative to zone) if needed */ - if ((bd->x != bd->zone->x) || (bd->y != ny)) - _policy_border_move(bd, bd->zone->x, ny); + if ((ec->x != ec->zone->x) || (ec->y != ny)) + _policy_border_move(ec, ec->zone->x, ny); /* set layer if needed */ - if (bd->layer != POL_HOME_LAYER) e_border_layer_set(bd, POL_HOME_LAYER); + if (ec->layer != POL_HOME_LAYER) evas_object_layer_set(ec->frame, POL_HOME_LAYER); } static void -_policy_zone_layout_home_dual_left(E_Border *bd, E_Illume_Config_Zone *cz) +_policy_zone_layout_home_dual_left(E_Client *ec, E_Illume_Config_Zone *cz) { - E_Border *home; + E_Client *home; int nx, nw, nh; -// printf("\tLayout Home Dual Left: %s\n", bd->client.icccm.class); +// printf("\tLayout Home Dual Left: %s\n", ec->icccm.class); - if ((!bd) || (!cz)) return; + if ((!ec) || (!cz)) return; /* no point in adjusting size or position if it's not visible */ - if (!bd->visible) return; + if (!ec->visible) return; - nh = (bd->zone->h - cz->indicator.size - cz->softkey.size); + nh = (ec->zone->h - cz->indicator.size - cz->softkey.size); /* set some defaults */ - nx = bd->zone->x; - nw = (bd->zone->w / 2); + nx = ec->zone->x; + nw = (ec->zone->w / 2); /* see if there are any other home windows */ - home = e_illume_border_home_get(bd->zone); - if ((home) && (bd != home)) nx = (home->x + nw); + home = e_illume_client_home_get(ec->zone); + if ((home) && (ec != home)) nx = (home->x + nw); /* make sure it's the required width & height */ - if ((bd->w != nw) || (bd->h != nh)) - _policy_border_resize(bd, nw, nh); + if ((ec->w != nw) || (ec->h != nh)) + _policy_border_resize(ec, nw, nh); /* move to correct position (relative to zone) if needed */ - if ((bd->x != nx) || (bd->y != (bd->zone->y + cz->indicator.size))) - _policy_border_move(bd, nx, (bd->zone->y + cz->indicator.size)); + if ((ec->x != nx) || (ec->y != (ec->zone->y + cz->indicator.size))) + _policy_border_move(ec, nx, (ec->zone->y + cz->indicator.size)); /* set layer if needed */ - if (bd->layer != POL_HOME_LAYER) e_border_layer_set(bd, POL_HOME_LAYER); + if (ec->layer != POL_HOME_LAYER) evas_object_layer_set(ec->frame, POL_HOME_LAYER); } static void -_policy_zone_layout_fullscreen(E_Border *bd) +_policy_zone_layout_fullscreen(E_Client *ec) { int kh; -// printf("\tLayout Fullscreen: %s\n", bd->client.icccm.name); +// printf("\tLayout Fullscreen: %s\n", ec->icccm.name); - if (!bd) return; + if (!ec) return; /* grab keyboard safe region */ - e_illume_keyboard_safe_app_region_get(bd->zone, NULL, NULL, NULL, &kh); + e_illume_keyboard_safe_app_region_get(ec->zone, NULL, NULL, NULL, &kh); /* make sure it's the required width & height */ - if ((bd->w != bd->zone->w) || (bd->h != kh)) - _policy_border_resize(bd, bd->zone->w, kh); + if ((ec->w != ec->zone->w) || (ec->h != kh)) + _policy_border_resize(ec, ec->zone->w, kh); /* set layer if needed */ - if (bd->layer != POL_FULLSCREEN_LAYER) - e_border_layer_set(bd, POL_FULLSCREEN_LAYER); + if (ec->layer != POL_FULLSCREEN_LAYER) + evas_object_layer_set(ec->frame, POL_FULLSCREEN_LAYER); } static void -_policy_zone_layout_app_single(E_Border *bd, E_Illume_Config_Zone *cz) +_policy_zone_layout_app_single(E_Client *ec, E_Illume_Config_Zone *cz) { int ky, kh, ny, nh; - if ((!bd) || (!cz)) return; - if ((!bd->new_client) && (!bd->visible)) return; + if ((!ec) || (!cz)) return; + if ((!ec->new_client) && (!ec->visible)) return; -// printf("\tLayout App Single: %s\n", bd->client.icccm.name); +// printf("\tLayout App Single: %s\n", ec->icccm.name); /* grab keyboard safe region */ - e_illume_keyboard_safe_app_region_get(bd->zone, NULL, &ky, NULL, &kh); + e_illume_keyboard_safe_app_region_get(ec->zone, NULL, &ky, NULL, &kh); /* make sure it's the required width & height */ - if (kh >= bd->zone->h) + if (kh >= ec->zone->h) nh = (kh - cz->indicator.size - cz->softkey.size); else nh = (kh - cz->indicator.size); /* resize if needed */ - if ((bd->w != bd->zone->w) || (bd->h != nh)) - _policy_border_resize(bd, bd->zone->w, nh); + if ((ec->w != ec->zone->w) || (ec->h != nh)) + _policy_border_resize(ec, ec->zone->w, nh); /* move to correct position (relative to zone) if needed */ - ny = (bd->zone->y + cz->indicator.size); - if ((bd->x != bd->zone->x) || (bd->y != ny)) - _policy_border_move(bd, bd->zone->x, ny); + ny = (ec->zone->y + cz->indicator.size); + if ((ec->x != ec->zone->x) || (ec->y != ny)) + _policy_border_move(ec, ec->zone->x, ny); /* set layer if needed */ - if (bd->layer != POL_APP_LAYER) e_border_layer_set(bd, POL_APP_LAYER); + if (ec->layer != POL_APP_LAYER) evas_object_layer_set(ec->frame, POL_APP_LAYER); } static void -_policy_zone_layout_app_dual_top(E_Border *bd, E_Illume_Config_Zone *cz) +_policy_zone_layout_app_dual_top(E_Client *ec, E_Illume_Config_Zone *cz) { - E_Border *b; + E_Client *b; int kh, ny, nh; -// printf("\tLayout App Dual Top: %s\n", bd->client.icccm.name); +// printf("\tLayout App Dual Top: %s\n", ec->icccm.name); - if ((!bd) || (!cz)) return; - if ((!bd->new_client) && (!bd->visible)) return; + if ((!ec) || (!cz)) return; + if ((!ec->new_client) && (!ec->visible)) return; /* set a default Y position */ - ny = (bd->zone->y + cz->indicator.size); + ny = (ec->zone->y + cz->indicator.size); - if ((bd->focused) && - (bd->client.vkbd.state > ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF)) + if ((ec->focused) && + (ec->vkbd.state > ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF)) { /* grab keyboard safe region */ - e_illume_keyboard_safe_app_region_get(bd->zone, NULL, NULL, NULL, &kh); + e_illume_keyboard_safe_app_region_get(ec->zone, NULL, NULL, NULL, &kh); nh = (kh - cz->indicator.size); } else { /* make sure it's the required width & height */ - nh = ((bd->zone->h - cz->indicator.size - cz->softkey.size) / 2); + nh = ((ec->zone->h - cz->indicator.size - cz->softkey.size) / 2); } /* see if there is a border already there. if so, check placement based on * virtual keyboard usage */ - b = e_illume_border_at_xy_get(bd->zone, bd->zone->x, ny); - if ((b) && (b != bd)) + b = e_illume_client_at_xy_get(ec->zone, ec->zone->x, ny); + if ((b) && (b != ec)) { /* does this border need keyboard ? */ - if ((bd->focused) && - (bd->client.vkbd.state > ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF)) + if ((ec->focused) && + (ec->vkbd.state > ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF)) { int h; /* move existing border to bottom if needed */ - h = ((bd->zone->h - cz->indicator.size - cz->softkey.size) / 2); + h = ((ec->zone->h - cz->indicator.size - cz->softkey.size) / 2); if ((b->x != b->zone->x) || (b->y != (ny + h))) _policy_border_move(b, b->zone->x, (ny + h)); @@ -755,115 +720,115 @@ _policy_zone_layout_app_dual_top(E_Border *bd, E_Illume_Config_Zone *cz) } /* resize if needed */ - if ((bd->w != bd->zone->w) || (bd->h != nh)) - _policy_border_resize(bd, bd->zone->w, nh); + if ((ec->w != ec->zone->w) || (ec->h != nh)) + _policy_border_resize(ec, ec->zone->w, nh); /* move to correct position (relative to zone) if needed */ - if ((bd->x != bd->zone->x) || (bd->y != ny)) - _policy_border_move(bd, bd->zone->x, ny); + if ((ec->x != ec->zone->x) || (ec->y != ny)) + _policy_border_move(ec, ec->zone->x, ny); /* set layer if needed */ - if (bd->layer != POL_APP_LAYER) e_border_layer_set(bd, POL_APP_LAYER); + if (ec->layer != POL_APP_LAYER) evas_object_layer_set(ec->frame, POL_APP_LAYER); } static void -_policy_zone_layout_app_dual_custom(E_Border *bd, E_Illume_Config_Zone *cz) +_policy_zone_layout_app_dual_custom(E_Client *ec, E_Illume_Config_Zone *cz) { - E_Border *app; + E_Client *app; int iy, ny, nh; -// printf("\tLayout App Dual Custom: %s\n", bd->client.icccm.class); +// printf("\tLayout App Dual Custom: %s\n", ec->icccm.class); - if ((!bd) || (!cz)) return; - if ((!bd->new_client) && (!bd->visible)) return; + if ((!ec) || (!cz)) return; + if ((!ec->new_client) && (!ec->visible)) return; /* grab indicator position */ - e_illume_border_indicator_pos_get(bd->zone, NULL, &iy); + e_illume_client_indicator_pos_get(ec->zone, NULL, &iy); /* set a default position */ - ny = bd->zone->y; + ny = ec->zone->y; nh = iy; - app = e_illume_border_at_xy_get(bd->zone, bd->zone->x, bd->zone->y); - if ((app) && (bd != app)) + app = e_illume_client_at_xy_get(ec->zone, ec->zone->x, ec->zone->y); + if ((app) && (ec != app)) { ny = (iy + cz->indicator.size); - nh = ((bd->zone->y + bd->zone->h) - ny - cz->softkey.size); + nh = ((ec->zone->y + ec->zone->h) - ny - cz->softkey.size); } /* make sure it's the required width & height */ - if ((bd->w != bd->zone->w) || (bd->h != nh)) - _policy_border_resize(bd, bd->zone->w, nh); + if ((ec->w != ec->zone->w) || (ec->h != nh)) + _policy_border_resize(ec, ec->zone->w, nh); /* move to correct position (relative to zone) if needed */ - if ((bd->x != bd->zone->x) || (bd->y != ny)) - _policy_border_move(bd, bd->zone->x, ny); + if ((ec->x != ec->zone->x) || (ec->y != ny)) + _policy_border_move(ec, ec->zone->x, ny); /* set layer if needed */ - if (bd->layer != POL_APP_LAYER) e_border_layer_set(bd, POL_APP_LAYER); + if (ec->layer != POL_APP_LAYER) evas_object_layer_set(ec->frame, POL_APP_LAYER); } static void -_policy_zone_layout_app_dual_left(E_Border *bd, E_Illume_Config_Zone *cz) +_policy_zone_layout_app_dual_left(E_Client *ec, E_Illume_Config_Zone *cz) { - E_Border *b; + E_Client *b; int ky, kh, nx, nw; -// printf("\tLayout App Dual Left: %s\n", bd->client.icccm.name); +// printf("\tLayout App Dual Left: %s\n", ec->icccm.name); - if ((!bd) || (!cz)) return; - if ((!bd->new_client) && (!bd->visible)) return; + if ((!ec) || (!cz)) return; + if ((!ec->new_client) && (!ec->visible)) return; /* grab keyboard safe region */ - e_illume_keyboard_safe_app_region_get(bd->zone, NULL, &ky, NULL, &kh); + e_illume_keyboard_safe_app_region_get(ec->zone, NULL, &ky, NULL, &kh); - if (kh >= bd->zone->h) + if (kh >= ec->zone->h) kh = (kh - cz->indicator.size - cz->softkey.size); else kh = (kh - cz->indicator.size); /* set some defaults */ - nx = bd->zone->x; - nw = (bd->zone->w / 2); + nx = ec->zone->x; + nw = (ec->zone->w / 2); /* see if there is a border already there. if so, place at right */ - b = e_illume_border_at_xy_get(bd->zone, nx, (ky + cz->indicator.size)); - if ((b) && (bd != b)) nx = b->x + nw; + b = e_illume_client_at_xy_get(ec->zone, nx, (ky + cz->indicator.size)); + if ((b) && (ec != b)) nx = b->x + nw; /* resize if needed */ - if ((bd->w != nw) || (bd->h != kh)) - _policy_border_resize(bd, nw, kh); + if ((ec->w != nw) || (ec->h != kh)) + _policy_border_resize(ec, nw, kh); /* move to correct position (relative to zone) if needed */ - if ((bd->x != nx) || (bd->y != (ky + cz->indicator.size))) - _policy_border_move(bd, nx, (ky + cz->indicator.size)); + if ((ec->x != nx) || (ec->y != (ky + cz->indicator.size))) + _policy_border_move(ec, nx, (ky + cz->indicator.size)); /* set layer if needed */ - if (bd->layer != POL_APP_LAYER) e_border_layer_set(bd, POL_APP_LAYER); + if (ec->layer != POL_APP_LAYER) evas_object_layer_set(ec->frame, POL_APP_LAYER); } static void -_policy_zone_layout_dialog(E_Border *bd, E_Illume_Config_Zone *cz) +_policy_zone_layout_dialog(E_Client *ec, E_Illume_Config_Zone *cz) { - E_Border *parent; + E_Client *parent; int mw, mh, nx, ny; -// printf("\tLayout Dialog: %s\n", bd->client.icccm.name); +// printf("\tLayout Dialog: %s\n", ec->icccm.name); /* NB: This policy ignores any ICCCM requested positions and centers the * dialog on it's parent (if it exists) or on the zone */ - if ((!bd) || (!cz)) return; + if ((!ec) || (!cz)) return; - mw = bd->w; - mh = bd->h; + mw = ec->w; + mh = ec->h; /* make sure it fits in this zone */ - if (mw > bd->zone->w) mw = bd->zone->w; - if (mh > bd->zone->h) mh = bd->zone->h; + if (mw > ec->zone->w) mw = ec->zone->w; + if (mh > ec->zone->h) mh = ec->zone->h; /* try to get this dialog's parent if it exists */ - parent = e_illume_border_parent_get(bd); + parent = e_illume_client_parent_get(ec); /* if we have no parent, or we are in dual mode, then center on zone */ /* NB: we check dual mode because if we are in dual mode, dialogs tend to @@ -872,8 +837,8 @@ _policy_zone_layout_dialog(E_Border *bd, E_Illume_Config_Zone *cz) if ((!parent) || (cz->mode.dual == 1)) { /* no parent or dual mode, center on screen */ - nx = (bd->zone->x + ((bd->zone->w - mw) / 2)); - ny = (bd->zone->y + ((bd->zone->h - mh) / 2)); + nx = (ec->zone->x + ((ec->zone->w - mw) / 2)); + ny = (ec->zone->y + ((ec->zone->h - mh) / 2)); } else { @@ -890,43 +855,43 @@ _policy_zone_layout_dialog(E_Border *bd, E_Illume_Config_Zone *cz) } /* make sure it's the required width & height */ - if ((bd->w != mw) || (bd->h != mh)) - _policy_border_resize(bd, mw, mh); + if ((ec->w != mw) || (ec->h != mh)) + _policy_border_resize(ec, mw, mh); /* make sure it's in the correct position */ - if ((bd->x != nx) || (bd->y != ny)) - _policy_border_move(bd, nx, ny); + if ((ec->x != nx) || (ec->y != ny)) + _policy_border_move(ec, nx, ny); /* set layer if needed */ - if (bd->layer != POL_DIALOG_LAYER) - e_border_layer_set(bd, POL_DIALOG_LAYER); + if (ec->layer != POL_DIALOG_LAYER) + evas_object_layer_set(ec->frame, POL_DIALOG_LAYER); } static void -_policy_zone_layout_splash(E_Border *bd, E_Illume_Config_Zone *cz) +_policy_zone_layout_splash(E_Client *ec, E_Illume_Config_Zone *cz) { - E_Border *parent = NULL; + E_Client *parent = NULL; int mw, mh, nx, ny; /* NB: This code is almost exactly the same as the dialog layout code * (_policy_zone_layout_dialog) except for setting a different layer */ -// printf("\tLayout Splash: %s\n", bd->client.icccm.name); +// printf("\tLayout Splash: %s\n", ec->icccm.name); /* NB: This policy ignores any ICCCM requested positions and centers the * splash screen on it's parent (if it exists) or on the zone */ - if ((!bd) || (!cz)) return; + if ((!ec) || (!cz)) return; /* no point in adjusting size or position if it's not visible */ - if (!bd->visible) return; + if (!ec->visible) return; /* grab minimum size */ - e_illume_border_min_get(bd, &mw, &mh); + e_illume_client_min_get(ec, &mw, &mh); /* make sure it fits in this zone */ - if (mw > bd->zone->w) mw = bd->zone->w; - if (mh > bd->zone->h) mh = bd->zone->h; + if (mw > ec->zone->w) mw = ec->zone->w; + if (mh > ec->zone->h) mh = ec->zone->h; /* if we have no parent, or we are in dual mode, then center on zone */ /* NB: we check dual mode because if we are in dual mode, dialogs tend to @@ -935,8 +900,8 @@ _policy_zone_layout_splash(E_Border *bd, E_Illume_Config_Zone *cz) if ((!parent) || (cz->mode.dual == 1)) { /* no parent or in dual mode, center on screen */ - nx = (bd->zone->x + ((bd->zone->w - mw) / 2)); - ny = (bd->zone->y + ((bd->zone->h - mh) / 2)); + nx = (ec->zone->x + ((ec->zone->w - mw) / 2)); + ny = (ec->zone->y + ((ec->zone->h - mh) / 2)); } else { @@ -953,128 +918,128 @@ _policy_zone_layout_splash(E_Border *bd, E_Illume_Config_Zone *cz) } /* make sure it's the required width & height */ - if ((bd->w != mw) || (bd->h != mh)) - _policy_border_resize(bd, mw, mh); + if ((ec->w != mw) || (ec->h != mh)) + _policy_border_resize(ec, mw, mh); /* make sure it's in the correct position */ - if ((bd->x != nx) || (bd->y != ny)) - _policy_border_move(bd, nx, ny); + if ((ec->x != nx) || (ec->y != ny)) + _policy_border_move(ec, nx, ny); /* set layer if needed */ - if (bd->layer != POL_SPLASH_LAYER) e_border_layer_set(bd, POL_SPLASH_LAYER); + if (ec->layer != POL_SPLASH_LAYER) evas_object_layer_set(ec->frame, POL_SPLASH_LAYER); } static void -_policy_zone_layout_conformant_single(E_Border *bd, E_Illume_Config_Zone *cz) +_policy_zone_layout_conformant_single(E_Client *ec, E_Illume_Config_Zone *cz) { - if ((!bd) || (!cz)) return; - if ((!bd->new_client) && (!bd->visible)) return; + if ((!ec) || (!cz)) return; + if ((!ec->new_client) && (!ec->visible)) return; /* make sure it's the required width & height */ - if ((bd->w != bd->zone->w) || (bd->h != bd->zone->h)) - _policy_border_resize(bd, bd->zone->w, bd->zone->h); + if ((ec->w != ec->zone->w) || (ec->h != ec->zone->h)) + _policy_border_resize(ec, ec->zone->w, ec->zone->h); /* move to correct position (relative to zone) if needed */ - if ((bd->x != bd->zone->x) || (bd->y != bd->zone->y)) - _policy_border_move(bd, bd->zone->x, bd->zone->y); + if ((ec->x != ec->zone->x) || (ec->y != ec->zone->y)) + _policy_border_move(ec, ec->zone->x, ec->zone->y); /* set layer if needed */ - if (bd->layer != POL_CONFORMANT_LAYER) - e_border_layer_set(bd, POL_CONFORMANT_LAYER); + if (ec->layer != POL_CONFORMANT_LAYER) + evas_object_layer_set(ec->frame, POL_CONFORMANT_LAYER); } static void -_policy_zone_layout_conformant_dual_top(E_Border *bd, E_Illume_Config_Zone *cz) +_policy_zone_layout_conformant_dual_top(E_Client *ec, E_Illume_Config_Zone *cz) { int nh, ny; /* according to the docs I have, conformant windows are always on the * bottom in dual-top mode */ - if ((!bd) || (!cz)) return; - if ((!bd->new_client) && (!bd->visible)) return; + if ((!ec) || (!cz)) return; + if ((!ec->new_client) && (!ec->visible)) return; /* set some defaults */ - nh = ((bd->zone->h - cz->indicator.size - cz->softkey.size) / 2); - ny = (bd->zone->y + cz->indicator.size) + nh; + nh = ((ec->zone->h - cz->indicator.size - cz->softkey.size) / 2); + ny = (ec->zone->y + cz->indicator.size) + nh; nh += cz->softkey.size; /* make sure it's the required width & height */ - if ((bd->w != bd->zone->w) || (bd->h != nh)) - _policy_border_resize(bd, bd->zone->w, nh); + if ((ec->w != ec->zone->w) || (ec->h != nh)) + _policy_border_resize(ec, ec->zone->w, nh); /* move to correct position (relative to zone) if needed */ - if ((bd->x != bd->zone->x) || (bd->y != ny)) - _policy_border_move(bd, bd->zone->x, ny); + if ((ec->x != ec->zone->x) || (ec->y != ny)) + _policy_border_move(ec, ec->zone->x, ny); /* set layer if needed */ - if (bd->layer != POL_CONFORMANT_LAYER) - e_border_layer_set(bd, POL_CONFORMANT_LAYER); + if (ec->layer != POL_CONFORMANT_LAYER) + evas_object_layer_set(ec->frame, POL_CONFORMANT_LAYER); } static void -_policy_zone_layout_conformant_dual_custom(E_Border *bd, E_Illume_Config_Zone *cz) +_policy_zone_layout_conformant_dual_custom(E_Client *ec, E_Illume_Config_Zone *cz) { int iy, nh; -// printf("\tLayout Conformant Dual Custom: %s\n", bd->client.icccm.class); +// printf("\tLayout Conformant Dual Custom: %s\n", ec->icccm.class); - if ((!bd) || (!cz)) return; - if ((!bd->new_client) && (!bd->visible)) return; + if ((!ec) || (!cz)) return; + if ((!ec->new_client) && (!ec->visible)) return; /* grab indicator position */ - e_illume_border_indicator_pos_get(bd->zone, NULL, &iy); + e_illume_client_indicator_pos_get(ec->zone, NULL, &iy); /* set some defaults */ - nh = ((bd->zone->y + bd->zone->h) - iy); + nh = ((ec->zone->y + ec->zone->h) - iy); /* make sure it's the required width & height */ - if ((bd->w != bd->zone->w) || (bd->h != nh)) - _policy_border_resize(bd, bd->zone->w, nh); + if ((ec->w != ec->zone->w) || (ec->h != nh)) + _policy_border_resize(ec, ec->zone->w, nh); /* move to correct position (relative to zone) if needed */ - if ((bd->x != bd->zone->x) || (bd->y != iy)) - _policy_border_move(bd, bd->zone->x, iy); + if ((ec->x != ec->zone->x) || (ec->y != iy)) + _policy_border_move(ec, ec->zone->x, iy); /* set layer if needed */ - if (bd->layer != POL_CONFORMANT_LAYER) - e_border_layer_set(bd, POL_CONFORMANT_LAYER); + if (ec->layer != POL_CONFORMANT_LAYER) + evas_object_layer_set(ec->frame, POL_CONFORMANT_LAYER); } static void -_policy_zone_layout_conformant_dual_left(E_Border *bd, E_Illume_Config_Zone *cz) +_policy_zone_layout_conformant_dual_left(E_Client *ec, E_Illume_Config_Zone *cz) { int nw, nx; /* according to the docs I have, conformant windows are always on the * left in dual-left mode */ - if ((!bd) || (!cz)) return; - if ((!bd->new_client) && (!bd->visible)) return; + if ((!ec) || (!cz)) return; + if ((!ec->new_client) && (!ec->visible)) return; /* set some defaults */ - nw = (bd->zone->w / 2); - nx = (bd->zone->x); + nw = (ec->zone->w / 2); + nx = (ec->zone->x); /* make sure it's the required width & height */ - if ((bd->w != nw) || (bd->h != bd->zone->h)) - _policy_border_resize(bd, nw, bd->zone->h); + if ((ec->w != nw) || (ec->h != ec->zone->h)) + _policy_border_resize(ec, nw, ec->zone->h); /* move to correct position (relative to zone) if needed */ - if ((bd->x != nx) || (bd->y != bd->zone->y)) - _policy_border_move(bd, nx, bd->zone->y); + if ((ec->x != nx) || (ec->y != ec->zone->y)) + _policy_border_move(ec, nx, ec->zone->y); /* set layer if needed */ - if (bd->layer != POL_CONFORMANT_LAYER) - e_border_layer_set(bd, POL_CONFORMANT_LAYER); + if (ec->layer != POL_CONFORMANT_LAYER) + evas_object_layer_set(ec->frame, POL_CONFORMANT_LAYER); } /* policy functions */ void -_policy_border_add(E_Border *bd) +_policy_border_add(E_Client *ec) { - if (!bd) return; + if (!ec) return; -// printf("\nBorder added: %s\n", bd->client.icccm.class); +// printf("\nBorder added: %s\n", ec->icccm.class); /* NB: this call sets an atom on the window that specifices the zone. * the logic here is that any new windows created can access the zone @@ -1084,174 +1049,174 @@ _policy_border_add(E_Border *bd) * that apply to their respective zone only. Example: softkey sends close * messages (or back messages to cycle focus) that should pertain just * to it's current zone */ - ecore_x_e_illume_zone_set(bd->client.win, bd->zone->black_win); + ecore_x_e_illume_zone_set(e_client_util_win_get(ec), ec->zone->black_win); /* ignore stolen borders. These are typically quickpanel or keyboards */ - if (bd->stolen) return; + if (ec->stolen) return; /* if this is a fullscreen window, than we need to hide indicator window */ - /* NB: we could use the e_illume_border_is_fullscreen function here + /* NB: we could use the e_illume_client_is_fullscreen function here * but we save ourselves a function call this way */ - if ((bd->fullscreen) || (bd->need_fullscreen)) + if ((ec->fullscreen) || (ec->need_fullscreen)) { - E_Border *ind, *sft; + E_Client *ind, *sft; /* try to get the Indicator on this zone */ - if ((ind = e_illume_border_indicator_get(bd->zone))) + if ((ind = e_illume_client_indicator_get(ec->zone))) { /* we have the indicator, hide it if needed */ - if (ind->visible) e_illume_border_hide(ind); + if (ind->visible) e_illume_client_hide(ind); } /* conformant - may not need softkey */ - if ((sft = e_illume_border_softkey_get(bd->zone))) + if ((sft = e_illume_client_softkey_get(ec->zone))) { - if (e_illume_border_is_conformant(bd)) + if (e_illume_client_is_conformant(ec)) { - if (sft->visible) e_illume_border_hide(sft); + if (sft->visible) e_illume_client_hide(sft); } else { - if (!sft->visible) e_illume_border_show(sft); + if (!sft->visible) e_illume_client_show(sft); } } } /* Add this border to our focus stack if it can accept or take focus */ - if ((bd->client.icccm.accepts_focus) || (bd->client.icccm.take_focus)) - _pol_focus_stack = eina_list_append(_pol_focus_stack, bd); + if ((ec->icccm.accepts_focus) || (ec->icccm.take_focus)) + _pol_focus_stack = eina_list_append(_pol_focus_stack, ec); - if ((e_illume_border_is_softkey(bd)) || (e_illume_border_is_indicator(bd))) - _policy_zone_layout_update(bd->zone); + if ((e_illume_client_is_softkey(ec)) || (e_illume_client_is_indicator(ec))) + _policy_zone_layout_update(ec->zone); else { /* set focus on new border if we can */ - _policy_border_set_focus(bd); + _policy_border_set_focus(ec); } } void -_policy_border_del(E_Border *bd) +_policy_border_del(E_Client *ec) { -// printf("Policy Border deleted: %s\n", bd->client.icccm.class); +// printf("Policy Border deleted: %s\n", ec->icccm.class); - if (!bd) return; + if (!ec) return; /* if this is a fullscreen window, than we need to show indicator window */ - /* NB: we could use the e_illume_border_is_fullscreen function here + /* NB: we could use the e_illume_client_is_fullscreen function here * but we save ourselves a function call this way */ - if ((bd->fullscreen) || (bd->need_fullscreen)) + if ((ec->fullscreen) || (ec->need_fullscreen)) { - E_Border *ind; + E_Client *ind; /* try to get the Indicator on this zone */ - if ((ind = e_illume_border_indicator_get(bd->zone))) + if ((ind = e_illume_client_indicator_get(ec->zone))) { /* we have the indicator, show it if needed */ - if (!ind->visible) e_illume_border_show(ind); + if (!ind->visible) e_illume_client_show(ind); } - _policy_zone_layout_update(bd->zone); + _policy_zone_layout_update(ec->zone); } /* remove from our focus stack */ - if ((bd->client.icccm.accepts_focus) || (bd->client.icccm.take_focus)) - _pol_focus_stack = eina_list_remove(_pol_focus_stack, bd); + if ((ec->icccm.accepts_focus) || (ec->icccm.take_focus)) + _pol_focus_stack = eina_list_remove(_pol_focus_stack, ec); - if (e_illume_border_is_softkey(bd)) + if (e_illume_client_is_softkey(ec)) { E_Illume_Config_Zone *cz; /* get the config for this zone */ - cz = e_illume_zone_config_get(bd->zone->num); + cz = e_illume_zone_config_get(ec->zone->num); cz->softkey.size = 0; - _policy_zone_layout_update(bd->zone); + _policy_zone_layout_update(ec->zone); } - else if (e_illume_border_is_indicator(bd)) + else if (e_illume_client_is_indicator(ec)) { E_Illume_Config_Zone *cz; /* get the config for this zone */ - cz = e_illume_zone_config_get(bd->zone->num); + cz = e_illume_zone_config_get(ec->zone->num); cz->indicator.size = 0; - _policy_zone_layout_update(bd->zone); + _policy_zone_layout_update(ec->zone); } else { /* show the border below this one */ - _policy_border_show_below(bd); + _policy_border_show_below(ec); } } void -_policy_border_focus_in(E_Border *bd) +_policy_border_focus_in(E_Client *ec) { - E_Border *ind; + E_Client *ind; -// printf("Border focus in: %s\n", bd->client.icccm.name); - if ((bd->fullscreen) || (bd->need_fullscreen)) +// printf("Border focus in: %s\n", ec->icccm.name); + if ((ec->fullscreen) || (ec->need_fullscreen)) { /* try to get the Indicator on this zone */ - if ((ind = e_illume_border_indicator_get(bd->zone))) + if ((ind = e_illume_client_indicator_get(ec->zone))) { /* we have the indicator, hide it if needed */ - if (ind->visible) e_illume_border_hide(ind); + if (ind->visible) e_illume_client_hide(ind); } } else { /* try to get the Indicator on this zone */ - if ((ind = e_illume_border_indicator_get(bd->zone))) + if ((ind = e_illume_client_indicator_get(ec->zone))) { /* we have the indicator, show it if needed */ - if (!ind->visible) e_illume_border_show(ind); + if (!ind->visible) e_illume_client_show(ind); } } - _policy_zone_layout_update(bd->zone); + _policy_zone_layout_update(ec->zone); } void -_policy_border_focus_out(E_Border *bd) +_policy_border_focus_out(E_Client *ec) { - if (!bd) return; + if (!ec) return; -// printf("Border focus out: %s\n", bd->client.icccm.name); +// printf("Border focus out: %s\n", ec->icccm.name); /* NB: if we got this focus_out event on a deleted border, we check if * it is a transient (child) of another window. If it is, then we * transfer focus back to the parent window */ - if (e_object_is_del(E_OBJECT(bd))) + if (e_object_is_del(E_OBJECT(ec))) { - if (e_illume_border_is_dialog(bd)) + if (e_illume_client_is_dialog(ec)) { - E_Border *parent; + E_Client *parent; - if ((parent = e_illume_border_parent_get(bd))) + if ((parent = e_illume_client_parent_get(ec))) _policy_border_set_focus(parent); } } } void -_policy_border_activate(E_Border *bd) +_policy_border_activate(E_Client *ec) { - E_Border *sft; + E_Client *sft; - if (!bd) return; + if (!ec) return; - printf("Border Activate: %s\n", bd->client.icccm.name); + printf("Border Activate: %s\n", ec->icccm.name); /* NB: stolen borders may or may not need focus call...have to test */ - if (bd->stolen) return; + if (ec->stolen) return; /* conformant windows hide the softkey */ - if ((sft = e_illume_border_softkey_get(bd->zone))) + if ((sft = e_illume_client_softkey_get(ec->zone))) { - if (e_illume_border_is_conformant(bd)) + if (e_illume_client_is_conformant(ec)) { - if (sft->visible) e_illume_border_hide(sft); + if (sft->visible) e_illume_client_hide(sft); } else { - if (!sft->visible) e_illume_border_show(sft); + if (!sft->visible) e_illume_client_show(sft); } } @@ -1260,18 +1225,18 @@ _policy_border_activate(E_Border *bd) * parts and use here :) */ /* if the border is iconified then uniconify if allowed */ - if ((bd->iconic) && (!bd->lock_user_iconify)) - e_border_uniconify(bd); + if ((ec->iconic) && (!ec->lock_user_iconify)) + e_client_uniconify(ec); /* set very high layer for this window as it needs attention and thus * should show above everything */ - e_border_layer_set(bd, POL_ACTIVATE_LAYER); + evas_object_layer_set(ec->frame, POL_ACTIVATE_LAYER); /* if we can raise the border do it */ - if (!bd->lock_user_stacking) e_border_raise(bd); + if (!ec->lock_user_stacking) evas_object_raise(ec->frame); /* focus the border */ - e_border_focus_set(bd, 1, 1); + evas_object_focus_set(ec->frame, 1); /* NB: since we skip needless border evals when container layout * is called (to save cpu cycles), we need to @@ -1281,86 +1246,86 @@ _policy_border_activate(E_Border *bd) * This is potentially useless as THIS policy * makes all windows borderless anyway, but it's in here for * completeness - e_border_focus_latest_set(bd); - if (bd->bg_object) - edje_object_signal_emit(bd->bg_object, "e,state,focused", "e"); - if (bd->icon_object) - edje_object_signal_emit(bd->icon_object, "e,state,focused", "e"); - e_focus_event_focus_in(bd); + e_client_focus_latest_set(ec); + if (ec->bg_object) + edje_object_signal_emit(ec->bg_object, "e,state,focused", "e"); + if (ec->icon_object) + edje_object_signal_emit(ec->icon_object, "e,state,focused", "e"); + e_focus_event_focus_in(ec); */ } void -_policy_border_post_fetch(E_Border *bd) +_policy_border_post_fetch(E_Client *ec) { // printf("Border post fetch\n"); - if (!bd) return; + if (!ec) return; /* NB: for this policy we disable all remembers set on a border */ - if (bd->remember) e_remember_del(bd->remember); - bd->remember = NULL; + if (ec->remember) e_remember_del(ec->remember); + ec->remember = NULL; /* set this border to borderless */ #ifdef DIALOG_USES_PIXEL_BORDER - if ((e_illume_border_is_dialog(bd)) && (e_illume_border_parent_get(bd))) - eina_stringshare_replace(&bd->bordername, "pixel"); + if ((e_illume_client_is_dialog(ec)) && (e_illume_client_parent_get(ec))) + eina_stringshare_replace(&ec->bordername, "pixel"); else - bd->borderless = 1; + ec->borderless = 1; #else - bd->borderless = 1; + ec->borderless = 1; #endif /* tell E the border has changed */ - bd->client.border.changed = 1; + ec->border.changed = 1; } void -_policy_border_post_assign(E_Border *bd) +_policy_border_post_assign(E_Client *ec) { // printf("Border post assign\n"); - if (!bd) return; + if (!ec) return; - bd->internal_no_remember = 1; + ec->internal_no_remember = 1; /* do not allow client to change these properties */ - bd->lock_client_size = 1; - bd->lock_client_shade = 1; - bd->lock_client_maximize = 1; - bd->lock_client_location = 1; - bd->lock_client_stacking = 1; + ec->lock_client_size = 1; + ec->lock_client_shade = 1; + ec->lock_client_maximize = 1; + ec->lock_client_location = 1; + ec->lock_client_stacking = 1; /* do not allow the user to change these properties */ - bd->lock_user_location = 1; - bd->lock_user_size = 1; - bd->lock_user_shade = 1; + ec->lock_user_location = 1; + ec->lock_user_size = 1; + ec->lock_user_shade = 1; /* clear any centered states */ /* NB: this is mainly needed for E's main config dialog */ - bd->client.e.state.centered = 0; + ec->e.state.centered = 0; /* lock the border type so user/client cannot change */ - bd->lock_border = 1; + ec->lock_border = 1; } void -_policy_border_show(E_Border *bd) +_policy_border_show(E_Client *ec) { - if (!bd) return; + if (!ec) return; /* make sure we have a name so that we don't handle windows like E's root */ - if (!bd->client.icccm.name) return; + if (!ec->icccm.name) return; -// printf("Border Show: %s\n", bd->client.icccm.class); +// printf("Border Show: %s\n", ec->icccm.class); /* trap for special windows so we can ignore hides below them */ - if (e_illume_border_is_indicator(bd)) return; - if (e_illume_border_is_softkey(bd)) return; - if (e_illume_border_is_quickpanel(bd)) return; - if (e_illume_border_is_keyboard(bd)) return; + if (e_illume_client_is_indicator(ec)) return; + if (e_illume_client_is_softkey(ec)) return; + if (e_illume_client_is_quickpanel(ec)) return; + if (e_illume_client_is_keyboard(ec)) return; - _policy_border_hide_below(bd); + _policy_border_hide_below(ec); } void @@ -1368,7 +1333,7 @@ _policy_zone_layout(E_Zone *zone) { E_Illume_Config_Zone *cz; Eina_List *l; - E_Border *bd; + E_Client *ec; if (!zone) return; @@ -1378,40 +1343,41 @@ _policy_zone_layout(E_Zone *zone) cz = e_illume_zone_config_get(zone->num); /* loop through border list and update layout */ - EINA_LIST_FOREACH(e_border_client_list(), l, bd) + EINA_LIST_FOREACH(zone->comp->clients, l, ec) { + if (e_client_util_ignored_get(ec)) continue; /* skip borders that are being deleted */ - if (e_object_is_del(E_OBJECT(bd))) continue; + if (e_object_is_del(E_OBJECT(ec))) continue; /* skip borders not on this zone */ - if (bd->zone != zone) continue; + if (ec->zone != zone) continue; /* only update layout for this border if it really needs it */ - if ((!bd->new_client) && (!bd->changes.pos) && (!bd->changes.size) && - (!bd->changes.visible) && (!bd->pending_move_resize) && - (!bd->need_shape_export) && (!bd->need_shape_merge)) continue; + if ((!ec->new_client) && (!ec->changes.pos) && (!ec->changes.size) && + (!ec->changes.visible) && + (!ec->need_shape_export) && (!ec->need_shape_merge)) continue; /* are we laying out an indicator ? */ - if (e_illume_border_is_indicator(bd)) - _policy_zone_layout_indicator(bd, cz); + if (e_illume_client_is_indicator(ec)) + _policy_zone_layout_indicator(ec, cz); /* are we layout out a quickpanel ? */ - else if (e_illume_border_is_quickpanel(bd)) - _policy_zone_layout_quickpanel(bd); + else if (e_illume_client_is_quickpanel(ec)) + _policy_zone_layout_quickpanel(ec); /* are we laying out a softkey ? */ - else if (e_illume_border_is_softkey(bd)) - _policy_zone_layout_softkey(bd, cz); + else if (e_illume_client_is_softkey(ec)) + _policy_zone_layout_softkey(ec, cz); /* are we laying out a keyboard ? */ - else if (e_illume_border_is_keyboard(bd)) - _policy_zone_layout_keyboard(bd, cz); + else if (e_illume_client_is_keyboard(ec)) + _policy_zone_layout_keyboard(ec, cz); /* are we layout out a home window ? */ - else if (e_illume_border_is_home(bd)) + else if (e_illume_client_is_home(ec)) { if (!cz->mode.dual) - _policy_zone_layout_home_single(bd, cz); + _policy_zone_layout_home_single(ec, cz); else { /* we are in dual-mode, check orientation */ @@ -1419,38 +1385,38 @@ _policy_zone_layout(E_Zone *zone) { int ty; - e_illume_border_indicator_pos_get(bd->zone, NULL, &ty); - if (ty <= bd->zone->y) - _policy_zone_layout_home_dual_top(bd, cz); + e_illume_client_indicator_pos_get(ec->zone, NULL, &ty); + if (ty <= ec->zone->y) + _policy_zone_layout_home_dual_top(ec, cz); else - _policy_zone_layout_home_dual_custom(bd, cz); + _policy_zone_layout_home_dual_custom(ec, cz); } else - _policy_zone_layout_home_dual_left(bd, cz); + _policy_zone_layout_home_dual_left(ec, cz); } } /* are we laying out a fullscreen window ? */ - /* NB: we could use the e_illume_border_is_fullscreen function here + /* NB: we could use the e_illume_client_is_fullscreen function here * but we save ourselves a function call this way. */ - else if ((bd->fullscreen) || (bd->need_fullscreen)) - _policy_zone_layout_fullscreen(bd); + else if ((ec->fullscreen) || (ec->need_fullscreen)) + _policy_zone_layout_fullscreen(ec); /* are we laying out a splash screen ? */ /* NB: we check splash before dialog so if a splash screen does not * register as a splash, than the dialog trap should catch it */ - else if (e_illume_border_is_splash(bd)) - _policy_zone_layout_splash(bd, cz); + else if (e_illume_client_is_splash(ec)) + _policy_zone_layout_splash(ec, cz); /* are we laying out a dialog ? */ - else if (e_illume_border_is_dialog(bd)) - _policy_zone_layout_dialog(bd, cz); + else if (e_illume_client_is_dialog(ec)) + _policy_zone_layout_dialog(ec, cz); /* are we layout out a conformant window ? */ - else if (e_illume_border_is_conformant(bd)) + else if (e_illume_client_is_conformant(ec)) { if (!cz->mode.dual) - _policy_zone_layout_conformant_single(bd, cz); + _policy_zone_layout_conformant_single(ec, cz); else { /* we are in dual-mode, check orientation */ @@ -1458,14 +1424,14 @@ _policy_zone_layout(E_Zone *zone) { int ty; - e_illume_border_indicator_pos_get(bd->zone, NULL, &ty); - if (ty <= bd->zone->y) - _policy_zone_layout_conformant_dual_top(bd, cz); + e_illume_client_indicator_pos_get(ec->zone, NULL, &ty); + if (ty <= ec->zone->y) + _policy_zone_layout_conformant_dual_top(ec, cz); else - _policy_zone_layout_conformant_dual_custom(bd, cz); + _policy_zone_layout_conformant_dual_custom(ec, cz); } else - _policy_zone_layout_conformant_dual_left(bd, cz); + _policy_zone_layout_conformant_dual_left(ec, cz); } } @@ -1474,7 +1440,7 @@ _policy_zone_layout(E_Zone *zone) { /* are we in single mode ? */ if (!cz->mode.dual) - _policy_zone_layout_app_single(bd, cz); + _policy_zone_layout_app_single(ec, cz); else { /* we are in dual-mode, check orientation */ @@ -1484,14 +1450,14 @@ _policy_zone_layout(E_Zone *zone) /* grab the indicator position so we can tell if it * is in a custom position or not (user dragged it) */ - e_illume_border_indicator_pos_get(bd->zone, NULL, &ty); - if (ty <= bd->zone->y) - _policy_zone_layout_app_dual_top(bd, cz); + e_illume_client_indicator_pos_get(ec->zone, NULL, &ty); + if (ty <= ec->zone->y) + _policy_zone_layout_app_dual_top(ec, cz); else - _policy_zone_layout_app_dual_custom(bd, cz); + _policy_zone_layout_app_dual_custom(ec, cz); } else - _policy_zone_layout_app_dual_left(bd, cz); + _policy_zone_layout_app_dual_left(ec, cz); } } } @@ -1501,20 +1467,21 @@ void _policy_zone_move_resize(E_Zone *zone) { Eina_List *l; - E_Border *bd; + E_Client *ec; // printf("Zone move resize\n"); if (!zone) return; - EINA_LIST_FOREACH(e_border_client_list(), l, bd) + EINA_LIST_FOREACH(zone->comp->clients, l, ec) { + if (e_client_util_ignored_get(ec)) continue; /* skip borders not on this zone */ - if (bd->zone != zone) continue; + if (ec->zone != zone) continue; /* signal a changed pos here so layout gets updated */ - bd->changes.pos = 1; - BD_CHANGED(bd); + ec->changes.pos = 1; + EC_CHANGED(ec); } } @@ -1523,7 +1490,7 @@ _policy_zone_mode_change(E_Zone *zone, Ecore_X_Atom mode) { E_Illume_Config_Zone *cz; Eina_List *homes = NULL; - E_Border *bd; + E_Client *ec; int count; // printf("Zone mode change: %d\n", zone->num); @@ -1547,25 +1514,25 @@ _policy_zone_mode_change(E_Zone *zone, Ecore_X_Atom mode) e_config_save_queue(); /* lock indicator window from dragging if we need to */ - bd = e_illume_border_indicator_get(zone); - if (bd) + ec = e_illume_client_indicator_get(zone); + if (ec) { /* only dual-top mode can drag */ if ((cz->mode.dual == 1) && (cz->mode.side == 0)) { /* only set locked if we need to */ - if (bd->client.illume.drag.locked != 0) - ecore_x_e_illume_drag_locked_set(bd->client.win, 0); + if (ec->illume.drag.locked != 0) + ecore_x_e_illume_drag_locked_set(e_client_util_win_get(ec), 0); } else { /* only set locked if we need to */ - if (bd->client.illume.drag.locked != 1) - ecore_x_e_illume_drag_locked_set(bd->client.win, 1); + if (ec->illume.drag.locked != 1) + ecore_x_e_illume_drag_locked_set(e_client_util_win_get(ec), 1); } } - if (!(homes = e_illume_border_home_borders_get(zone))) return; + if (!(homes = e_illume_client_home_borders_get(zone))) return; count = eina_list_count(homes); @@ -1580,11 +1547,11 @@ _policy_zone_mode_change(E_Zone *zone, Ecore_X_Atom mode) /* if we went to single mode, delete any extra home windows */ if (count >= 2) { - E_Border *home; + E_Client *home; /* try to get a home window on this zone and remove it */ - if ((home = e_illume_border_home_get(zone))) - ecore_x_e_illume_home_del_send(home->client.win); + if ((home = e_illume_client_home_get(zone))) + ecore_x_e_illume_home_del_send(e_client_util_win_get(home)); } } @@ -1595,79 +1562,79 @@ _policy_zone_mode_change(E_Zone *zone, Ecore_X_Atom mode) void _policy_zone_close(E_Zone *zone) { - E_Border *bd; + E_Client *ec; if (!zone) return; /* make sure we have a focused border */ - if (!(bd = e_border_focused_get())) return; + if (!(ec = e_client_focused_get())) return; /* make sure focused border is on this zone */ - if (bd->zone != zone) return; + if (ec->zone != zone) return; /* close this border */ - e_border_act_close_begin(bd); + e_client_act_close_begin(ec); } void -_policy_drag_start(E_Border *bd) +_policy_drag_start(E_Client *ec) { // printf("Drag start\n"); - if (!bd) return; + if (!ec) return; /* ignore stolen borders */ - if (bd->stolen) return; + if (ec->stolen) return; /* set property on this border to say we are dragging */ - ecore_x_e_illume_drag_set(bd->client.win, 1); + ecore_x_e_illume_drag_set(e_client_util_win_get(ec), 1); /* set property on zone window that a drag is happening */ - ecore_x_e_illume_drag_set(bd->zone->black_win, 1); + ecore_x_e_illume_drag_set(ec->zone->black_win, 1); } void -_policy_drag_end(E_Border *bd) +_policy_drag_end(E_Client *ec) { // printf("Drag end\n"); - if (!bd) return; + if (!ec) return; /* ignore stolen borders */ - if (bd->stolen) return; + if (ec->stolen) return; /* set property on this border to say we are done dragging */ - ecore_x_e_illume_drag_set(bd->client.win, 0); + ecore_x_e_illume_drag_set(e_client_util_win_get(ec), 0); /* set property on zone window that a drag is finished */ - ecore_x_e_illume_drag_set(bd->zone->black_win, 0); + ecore_x_e_illume_drag_set(ec->zone->black_win, 0); } void _policy_focus_back(E_Zone *zone) { Eina_List *l, *fl = NULL; - E_Border *bd, *fbd; + E_Client *ec, *fbd; if (!zone) return; if (eina_list_count(_pol_focus_stack) < 1) return; // printf("Focus back\n"); - EINA_LIST_REVERSE_FOREACH(_pol_focus_stack, l, bd) + EINA_LIST_REVERSE_FOREACH(_pol_focus_stack, l, ec) { - if (bd->zone != zone) continue; - fl = eina_list_append(fl, bd); + if (ec->zone != zone) continue; + fl = eina_list_append(fl, ec); } - if (!(fbd = e_border_focused_get())) return; + if (!(fbd = e_client_focused_get())) return; if (fbd->parent) return; - EINA_LIST_REVERSE_FOREACH(fl, l, bd) + EINA_LIST_REVERSE_FOREACH(fl, l, ec) { - if ((fbd) && (bd == fbd)) + if ((fbd) && (ec == fbd)) { - E_Border *b; + E_Client *b; if ((l->next) && (b = l->next->data)) { @@ -1692,27 +1659,27 @@ void _policy_focus_forward(E_Zone *zone) { Eina_List *l, *fl = NULL; - E_Border *bd, *fbd; + E_Client *ec, *fbd; if (!zone) return; if (eina_list_count(_pol_focus_stack) < 1) return; // printf("Focus forward\n"); - EINA_LIST_FOREACH(_pol_focus_stack, l, bd) + EINA_LIST_FOREACH(_pol_focus_stack, l, ec) { - if (bd->zone != zone) continue; - fl = eina_list_append(fl, bd); + if (ec->zone != zone) continue; + fl = eina_list_append(fl, ec); } - if (!(fbd = e_border_focused_get())) return; + if (!(fbd = e_client_focused_get())) return; if (fbd->parent) return; - EINA_LIST_FOREACH(fl, l, bd) + EINA_LIST_FOREACH(fl, l, ec) { - if ((fbd) && (bd == fbd)) + if ((fbd) && (ec == fbd)) { - E_Border *b; + E_Client *b; if ((l->next) && (b = l->next->data)) { @@ -1736,24 +1703,24 @@ _policy_focus_forward(E_Zone *zone) void _policy_focus_home(E_Zone *zone) { - E_Border *bd; + E_Client *ec; if (!zone) return; - if (!(bd = e_illume_border_home_get(zone))) return; + if (!(ec = e_illume_client_home_get(zone))) return; /* if the border was hidden due to layout, we need to unhide */ - if (!bd->visible) e_illume_border_show(bd); + if (!ec->visible) e_illume_client_show(ec); - if ((bd->iconic) && (!bd->lock_user_iconify)) - e_border_uniconify(bd); + if ((ec->iconic) && (!ec->lock_user_iconify)) + e_client_uniconify(ec); - if (!bd->lock_user_stacking) e_border_raise(bd); + if (!ec->lock_user_stacking) evas_object_raise(ec->frame); /* hide the border(s) above this one */ - _policy_border_hide_above(bd); + _policy_border_hide_above(ec); /* focus the border */ - e_border_focus_set(bd, 1, 1); + evas_object_focus_set(ec->frame, 1); } void @@ -1764,43 +1731,43 @@ _policy_property_change(Ecore_X_Event_Window_Property *event) /* we are interested in state changes here */ if (event->atom == ECORE_X_ATOM_NET_WM_STATE) { - E_Border *bd, *ind; + E_Client *ec, *ind; - if (!(bd = e_border_find_by_client_window(event->win))) return; + if (!(ec = e_pixmap_find_client(E_PIXMAP_TYPE_X, event->win))) return; /* not interested in stolen or invisible borders */ - if ((bd->stolen) || (!bd->visible)) return; + if ((ec->stolen) || (!ec->visible)) return; /* make sure the border has a name or class */ /* NB: this check is here because some E borders get State Changes * but do not have a name/class associated with them. Not entirely sure * which ones they are, but I would guess Managers, Containers, or Zones. * At any rate, we're not interested in those types of borders */ - if ((!bd->client.icccm.name) || (!bd->client.icccm.class)) return; + if ((!ec->icccm.name) || (!ec->icccm.class)) return; /* NB: If we have reached this point, then it should be a fullscreen * border that has toggled fullscreen on/off */ /* try to get the Indicator on this zone */ - if (!(ind = e_illume_border_indicator_get(bd->zone))) return; + if (!(ind = e_illume_client_indicator_get(ec->zone))) return; /* if we are fullscreen, hide the indicator...else we show it */ - /* NB: we could use the e_illume_border_is_fullscreen function here + /* NB: we could use the e_illume_client_is_fullscreen function here * but we save ourselves a function call this way */ - if ((bd->fullscreen) || (bd->need_fullscreen)) + if ((ec->fullscreen) || (ec->need_fullscreen)) { if (ind->visible) { - e_illume_border_hide(ind); - _policy_zone_layout_update(bd->zone); + e_illume_client_hide(ind); + _policy_zone_layout_update(ec->zone); } } else { if (!ind->visible) { - e_illume_border_show(ind); - _policy_zone_layout_update(bd->zone); + e_illume_client_show(ind); + _policy_zone_layout_update(ec->zone); } } } @@ -1808,57 +1775,59 @@ _policy_property_change(Ecore_X_Event_Window_Property *event) { Eina_List *l; E_Zone *zone; - E_Border *bd; + E_Client *ec; int x, y, w, h; /* make sure this property changed on a zone */ if (!(zone = e_util_zone_window_find(event->win))) return; /* get the geometry */ - if (!(bd = e_illume_border_indicator_get(zone))) return; - x = bd->x; - y = bd->y; - w = bd->w; - h = bd->h; + if (!(ec = e_illume_client_indicator_get(zone))) return; + x = ec->x; + y = ec->y; + w = ec->w; + h = ec->h; /* look for conformant borders */ - EINA_LIST_FOREACH(e_border_client_list(), l, bd) + EINA_LIST_FOREACH(zone->comp->clients, l, ec) { - if (bd->zone != zone) continue; - if (!e_illume_border_is_conformant(bd)) continue; + if (e_client_util_ignored_get(ec)) continue; + if (ec->zone != zone) continue; + if (!e_illume_client_is_conformant(ec)) continue; /* set indicator geometry on conformant window */ /* NB: This is needed so that conformant apps get told about * the indicator size/position...else they have no way of * knowing that the geometry has been updated */ - ecore_x_e_illume_indicator_geometry_set(bd->client.win, x, y, w, h); + ecore_x_e_illume_indicator_geometry_set(e_client_util_win_get(ec), x, y, w, h); } } else if (event->atom == ECORE_X_ATOM_E_ILLUME_SOFTKEY_GEOMETRY) { Eina_List *l; E_Zone *zone; - E_Border *bd; + E_Client *ec; int x, y, w, h; /* make sure this property changed on a zone */ if (!(zone = e_util_zone_window_find(event->win))) return; - if (!(bd = e_illume_border_softkey_get(zone))) return; - x = bd->x; - y = bd->y; - w = bd->w; - h = bd->h; + if (!(ec = e_illume_client_softkey_get(zone))) return; + x = ec->x; + y = ec->y; + w = ec->w; + h = ec->h; /* look for conformant borders */ - EINA_LIST_FOREACH(e_border_client_list(), l, bd) + EINA_LIST_FOREACH(zone->comp->clients, l, ec) { - if (bd->zone != zone) continue; - if (!e_illume_border_is_conformant(bd)) continue; + if (e_client_util_ignored_get(ec)) continue; + if (ec->zone != zone) continue; + if (!e_illume_client_is_conformant(ec)) continue; /* set softkey geometry on conformant window */ /* NB: This is needed so that conformant apps get told about * the softkey size/position...else they have no way of * knowing that the geometry has been updated */ - ecore_x_e_illume_softkey_geometry_set(bd->client.win, x, y, w, h); + ecore_x_e_illume_softkey_geometry_set(e_client_util_win_get(ec), x, y, w, h); } } else if (event->atom == ECORE_X_ATOM_E_ILLUME_KEYBOARD_GEOMETRY) @@ -1866,7 +1835,7 @@ _policy_property_change(Ecore_X_Event_Window_Property *event) Eina_List *l; E_Zone *zone; E_Illume_Keyboard *kbd; - E_Border *bd; + E_Client *ec; int x, y, w, h; /* make sure this property changed on a zone */ @@ -1874,50 +1843,48 @@ _policy_property_change(Ecore_X_Event_Window_Property *event) /* get the keyboard */ if (!(kbd = e_illume_keyboard_get())) return; - if (!kbd->border) return; + if (!kbd->client) return; /* get the geometry */ - x = kbd->border->x; - w = kbd->border->w; - h = kbd->border->h; + x = kbd->client->x; + w = kbd->client->w; + h = kbd->client->h; /* adjust for keyboard visibility because keyboard uses fx_offset */ y = 0; - if (kbd->border->cw && - (!e_util_strcmp(edje_object_part_state_get(kbd->border->cw->effect_obj, "mover", NULL), "custom"))) - y = kbd->border->y; +#warning this is totally broken on so many levels + //if (kbd->client->frame && + //(!e_util_strcmp(edje_object_part_state_get(kbd->client->cw->effect_obj, "mover", NULL), "custom"))) + //y = kbd->client->y; /* look for conformant borders */ - EINA_LIST_FOREACH(e_border_client_list(), l, bd) + EINA_LIST_FOREACH(zone->comp->clients, l, ec) { - if (bd->zone != zone) continue; - if (!e_illume_border_is_conformant(bd)) continue; + if (e_client_util_ignored_get(ec)) continue; + if (ec->zone != zone) continue; + if (!e_illume_client_is_conformant(ec)) continue; /* set keyboard geometry on conformant window */ /* NB: This is needed so that conformant apps get told about * the keyboard size/position...else they have no way of * knowing that the geometry has been updated */ - ecore_x_e_illume_keyboard_geometry_set(bd->client.win, x, y, w, h); + ecore_x_e_illume_keyboard_geometry_set(e_client_util_win_get(ec), x, y, w, h); } } else if (event->atom == ATM_ENLIGHTENMENT_SCALE) { - Eina_List *ml; - E_Manager *man; + const Eina_List *l; + E_Comp *comp; - EINA_LIST_FOREACH(e_manager_list(), ml, man) + + EINA_LIST_FOREACH(e_comp_list(), l, comp) { - Eina_List *cl; - E_Container *con; + Eina_List *zl; + E_Zone *zone; - if (event->win != man->root) continue; - EINA_LIST_FOREACH(man->containers, cl, con) - { - Eina_List *zl; - E_Zone *zone; + if (event->win != comp->man->root) continue; - EINA_LIST_FOREACH(con->zones, zl, zone) - _policy_zone_layout_update(zone); - } + EINA_LIST_FOREACH(comp->zones, zl, zone) + _policy_zone_layout_update(zone); } } } |