Enlightenment CVS committal Author : raster Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_error.c e_main.c e_xinerama.c e_xinerama.h Log Message: fix pager to work when windows are moved from zone to zone :) add xinerama faking command-line options and help. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_error.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- e_error.c 15 Mar 2005 10:23:01 -0000 1.10 +++ e_error.c 19 Mar 2005 17:31:42 -0000 1.11 @@ -59,12 +59,14 @@ int error_w, error_h; Evas_List *l, *shapelist = NULL; Evas_Coord maxw, maxh; + E_Container *con; + int x, y; error_w = 400; error_h = 200; - ee = ecore_evas_software_x11_new(NULL, man->win, - (man->w - error_w) / 2, (man->h - error_h) / 2, - error_w, error_h); + x = (man->w - error_w) / 2; + y = (man->h - error_h) / 2; + ee = ecore_evas_software_x11_new(NULL, man->win, x, y, error_w, error_h); ecore_evas_software_x11_direct_resize_set(ee, 1); e_canvas_add(ee); @@ -83,8 +85,7 @@ Evas_Coord tw, th; char *newstr; - if (o) - evas_object_del(o); + if (o) evas_object_del(o); maxw = 0; maxh = 0; @@ -207,17 +208,30 @@ evas_object_layer_set(o, -10); evas_object_show(o); - ecore_evas_move(ee, (man->w - error_w) / 2, (man->h - error_h) / 2); + x = (man->w - error_w) / 2; + y = (man->h - error_h) / 2; + con = e_manager_container_current_get(man); + if (con) + { + E_Zone *zone; + + zone = e_container_zone_number_get(con, 0); + if (zone) + { + x = zone->x + ((zone->w - error_w) / 2); + y = zone->y + ((zone->h - error_h) / 2); + } + } + ecore_evas_move(ee, x, y); ecore_evas_resize(ee, error_w, error_h); for (l = man->containers; l; l = l->next) { - E_Container *con; E_Container_Shape *es; con = l->data; es = e_container_shape_add(con); - e_container_shape_move(es, (man->w - error_w) / 2, (man->h - error_h) / 2); + e_container_shape_move(es, x, y); e_container_shape_resize(es, error_w, error_h); e_container_shape_show(es); shapelist = evas_list_append(shapelist, es); @@ -279,7 +293,21 @@ evas_object_resize(o, error_w, error_h); evas_object_show(o); - ecore_evas_move(ee, (man->w - error_w) / 2, (man->h - error_h) / 2); + x = (man->w - error_w) / 2; + y = (man->h - error_h) / 2; + con = e_manager_container_current_get(man); + if (con) + { + E_Zone *zone; + + zone = e_container_zone_number_get(con, 0); + if (zone) + { + x = zone->x + ((zone->w - error_w) / 2); + y = zone->y + ((zone->h - error_h) / 2); + } + } + ecore_evas_move(ee, x, y); ecore_evas_resize(ee, error_w, error_h); for (l = man->containers; l; l = l->next) @@ -289,7 +317,7 @@ con = l->data; es = e_container_shape_add(con); - e_container_shape_move(es, (man->w - error_w) / 2, (man->h - error_h) / 2); + e_container_shape_move(es, x, y); e_container_shape_resize(es, error_w, error_h); e_container_shape_show(es); shapelist = evas_list_append(shapelist, es); =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_main.c,v retrieving revision 1.53 retrieving revision 1.54 diff -u -3 -r1.53 -r1.54 --- e_main.c 15 Mar 2005 10:26:05 -0000 1.53 +++ e_main.c 19 Mar 2005 17:31:42 -0000 1.54 @@ -90,6 +90,33 @@ snprintf(buf, sizeof(buf), "DISPLAY=%s", argv[i]); putenv(buf); } + else if ((!strcmp(argv[i], "-fake-xinerama-screen")) && (i < (argc - 1))) + { + int x, y, w, h; + + i++; + /* WWxHH+XX+YY */ + if (sscanf(argv[i], "%ix%i+%i+%i", &w, &h, &x, &y) == 4) + e_xinerama_fake_screen_add(x, y, w, h); + } + else if ((!strcmp(argv[i], "-h")) || + (!strcmp(argv[i], "-help")) || + (!strcmp(argv[i], "--help"))) + { + printf + ("Options:\n" + "\t-display DISPLAY\n" + "\t\tConnect to display named DISPLAY.\n" + "\t\tEG: -display :1.0\n" + "\t-fake-xinerama-screen WxH+X+Y\n" + "\t\tAdd a FAKE xinerama screen (instead of the real ones)\n" + "\t\tgiven the geometry. Add as many as you like. They all\n" + "\t\treplace the real xinerama screens, if any. This can\n" + "\t\tbe used to simulate xinerama.\n" + "\t\tEG: -fake-xinerama-screen 800x600+0+0 -fake-xinerama-screen 800x600+800+0\n" + ); + exit(0); + } } /* fix up DISPLAY to be :N.0 if no .screen is in it */ =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_xinerama.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- e_xinerama.c 18 Mar 2005 16:30:48 -0000 1.3 +++ e_xinerama.c 19 Mar 2005 17:31:42 -0000 1.4 @@ -8,6 +8,7 @@ static Evas_List *all_screens = NULL; static Evas_List *chosen_screens = NULL; +static Evas_List *fake_screens = NULL; int e_xinerama_init(void) @@ -33,15 +34,31 @@ const Evas_List * e_xinerama_screens_get(void) { + if (fake_screens) return fake_screens; return chosen_screens; } const Evas_List * e_xinerama_screens_all_get(void) { + if (fake_screens) return fake_screens; return all_screens; } +void +e_xinerama_fake_screen_add(int x, int y, int w, int h) +{ + E_Screen *scr; + + scr = calloc(1, sizeof(E_Screen)); + scr->screen = evas_list_count(fake_screens); + scr->x = x; + scr->y = y; + scr->w = w; + scr->h = h; + fake_screens = evas_list_append(fake_screens, scr); +} + /* local subsystem functions */ static void _e_xinerama_clean(void) =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_xinerama.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- e_xinerama.h 7 Mar 2005 09:56:49 -0000 1.2 +++ e_xinerama.h 19 Mar 2005 17:31:42 -0000 1.3 @@ -20,6 +20,7 @@ EAPI void e_xinerama_update(void); EAPI const Evas_List *e_xinerama_screens_get(void); EAPI const Evas_List *e_xinerama_screens_all_get(void); +EAPI void e_xinerama_fake_screen_add(int x, int y, int w, int h); #endif #endif ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs