Enlightenment CVS committal Author : raster Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_container.c e_shelf.c e_shelf.h e_utils.c Log Message: and fully handle dynamic screen add/del with xinerama (xrandr 1.2). seems to work for me adding/removing screens. e moves windows from the old screen to existing one(s) and creates new zones and any shelves etc. for that zone if needed etc. etc. =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_container.c,v retrieving revision 1.120 retrieving revision 1.121 diff -u -3 -r1.120 -r1.121 --- e_container.c 17 Oct 2007 11:06:59 -0000 1.120 +++ e_container.c 18 Oct 2007 09:06:30 -0000 1.121 @@ -1212,29 +1212,69 @@ } else { + Evas_List *ll; + zone = e_zone_new(con, scr->screen, scr->escreen, scr->x, scr->y, scr->w, scr->h); - // ... - // ... - /* FIXME: if there were shelves for this zone - create them */ - // .... - // ... - // ... + /* find any shelves configured for this zone and add them in */ + for (ll = e_config->shelves; ll; ll = ll->next) + { + E_Config_Shelf *cf_es; + + cf_es = ll->data; + if (e_util_container_zone_id_get(cf_es->container, cf_es->zone) == zone) + e_shelf_config_new(zone, cf_es); + } } } if (zones) { + E_Zone *spare_zone = NULL; + Evas_List *ll; + + for (ll = con->zones; ll; ll = ll->next) + { + spare_zone = ll->data; + if (evas_list_find(zones, spare_zone)) + spare_zone = NULL; + else break; + } while (zones) { E_Zone *zone; + Evas_List *shelves, *ll, *del_shelves; + E_Border_List *bl; + E_Border *bd; zone = zones->data; - /* FIXME: any shelves for this zone - kill them */ - /* FIXME: take all borders in the zone and move elsewhere */ - // ... - // ... - //e_border_zone_set(bd, new_zone); - // ... - // ... + /* delete any shelves on this zone */ + shelves = e_shelf_list(); + del_shelves = NULL; + for (ll = shelves; ll; ll = ll->next) + { + E_Shelf *es; + + es = ll->data; + if (es->zone == zone) + del_shelves = evas_list_append(del_shelves, es); + } + while (del_shelves) + { + e_object_del(E_OBJECT(del_shelves->data)); + del_shelves = evas_list_remove_list(del_shelves, del_shelves); + } + bl = e_container_border_list_first(zone->container); + while ((bd = e_container_border_list_next(bl))) + { + if (bd->zone == zone) + { + if (spare_zone) e_border_zone_set(bd, spare_zone); + else + printf("EEEK! should not be here - but no\n" + "spare zones exist to move this\n" + "window to!!! help!\n"); + } + } + e_container_border_list_free(bl); e_object_del(E_OBJECT(zone)); zones = evas_list_remove_list(zones, zones); } =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_shelf.c,v retrieving revision 1.73 retrieving revision 1.74 diff -u -3 -r1.73 -r1.74 --- e_shelf.c 7 Oct 2007 16:39:58 -0000 1.73 +++ e_shelf.c 18 Oct 2007 09:06:30 -0000 1.74 @@ -71,50 +71,9 @@ cf_es = l->data; if (cf_es->id <= 0) cf_es->id = id + 1; - zone = e_util_container_zone_number_get(cf_es->container, cf_es->zone); + zone = e_util_container_zone_id_get(cf_es->container, cf_es->zone); id = cf_es->id; - if (zone) - { - E_Shelf *es; - - es = e_shelf_zone_new(zone, cf_es->name, cf_es->style, - cf_es->popup, cf_es->layer, cf_es->id); - if (es) - { - if (!cf_es->hide_timeout) cf_es->hide_timeout = 1.0; - if (!cf_es->hide_duration) cf_es->hide_duration = 1.0; - es->cfg = cf_es; - es->fit_along = cf_es->fit_along; - es->fit_size = cf_es->fit_size; - - e_shelf_orient(es, cf_es->orient); - e_shelf_position_calc(es); - e_shelf_populate(es); - - if (cf_es->desk_show_mode) - { - E_Desk *desk; - Evas_List *ll; - - desk = e_desk_current_get(zone); - for (ll = cf_es->desk_list; ll; ll = ll->next) - { - E_Config_Shelf_Desk *sd; - - sd = ll->data; - if ((desk->x == sd->x) && (desk->y == sd->y)) - { - e_shelf_show(es); - break; - } - } - } - else - e_shelf_show(es); - - e_shelf_toggle(es, 0); - } - } + if (zone) e_shelf_config_new(zone, cf_es); } } @@ -655,6 +614,50 @@ evas_object_layer_set(es->o_event, es->cfg->layer); evas_object_layer_set(es->o_base, es->cfg->layer); } +} + +EAPI E_Shelf * +e_shelf_config_new(E_Zone *zone, E_Config_Shelf *cf_es) +{ + E_Shelf *es; + + es = e_shelf_zone_new(zone, cf_es->name, cf_es->style, + cf_es->popup, cf_es->layer, cf_es->id); + if (!es) return NULL; + + if (!cf_es->hide_timeout) cf_es->hide_timeout = 1.0; + if (!cf_es->hide_duration) cf_es->hide_duration = 1.0; + es->cfg = cf_es; + es->fit_along = cf_es->fit_along; + es->fit_size = cf_es->fit_size; + + e_shelf_orient(es, cf_es->orient); + e_shelf_position_calc(es); + e_shelf_populate(es); + + if (cf_es->desk_show_mode) + { + E_Desk *desk; + Evas_List *ll; + + desk = e_desk_current_get(zone); + for (ll = cf_es->desk_list; ll; ll = ll->next) + { + E_Config_Shelf_Desk *sd; + + sd = ll->data; + if ((desk->x == sd->x) && (desk->y == sd->y)) + { + e_shelf_show(es); + break; + } + } + } + else + e_shelf_show(es); + + e_shelf_toggle(es, 0); + return es; } /* local subsystem functions */ =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_shelf.h,v retrieving revision 1.24 retrieving revision 1.25 diff -u -3 -r1.24 -r1.25 --- e_shelf.h 10 May 2007 08:49:14 -0000 1.24 +++ e_shelf.h 18 Oct 2007 09:06:30 -0000 1.25 @@ -64,6 +64,7 @@ EAPI void e_shelf_position_calc(E_Shelf *es); EAPI void e_shelf_style_set(E_Shelf *es, const char *style); EAPI void e_shelf_popup_set(E_Shelf *es, int popup); +EAPI E_Shelf *e_shelf_config_new(E_Zone *zone, E_Config_Shelf *cf_es); #endif #endif =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_utils.c,v retrieving revision 1.76 retrieving revision 1.77 diff -u -3 -r1.76 -r1.77 --- e_utils.c 10 Oct 2007 10:53:09 -0000 1.76 +++ e_utils.c 18 Oct 2007 09:06:30 -0000 1.77 @@ -185,6 +185,16 @@ return e_container_zone_number_get(con, zone_num); } +EAPI E_Zone * +e_util_container_zone_id_get(int con_num, int id) +{ + E_Container *con; + + con = e_util_container_number_get(con_num); + if (!con) return NULL; + return e_container_zone_id_get(con, id); +} + EAPI int e_util_head_exec(int head, const char *cmd) { ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs