Enlightenment CVS committal
Author : sebastid
Project : e17
Module : apps/e
Dir : e17/apps/e/src/bin
Modified Files:
e_border.c
Log Message:
Maximize update. Only zoom fullscreen is lacking, but that is more a
fullscreen mode, not a maximize mode.
Please comment the implementation!
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_border.c,v
retrieving revision 1.269
retrieving revision 1.270
diff -u -3 -r1.269 -r1.270
--- e_border.c 18 Jun 2005 13:03:00 -0000 1.269
+++ e_border.c 18 Jun 2005 14:31:17 -0000 1.270
@@ -1079,6 +1079,8 @@
if (!bd->maximized)
{
Evas_List *l;
+ E_Border_List *bl;
+ E_Border *bd2;
int x1, y1, x2, y2;
int w, h;
@@ -1088,8 +1090,6 @@
bd->saved.w = bd->w;
bd->saved.h = bd->h;
- e_hints_window_maximized_set(bd, 1);
-
e_border_raise(bd);
switch (e_config->maximize_policy)
{
@@ -1098,9 +1098,9 @@
break;
case E_MAXIMIZE_ZOOM:
/* FIXME */
+ bd->maximized = E_MAXIMIZE_ZOOM;
break;
case E_MAXIMIZE_FULLSCREEN:
- /* FIXME: Care about step size */
if (bd->bg_object)
{
Evas_Coord cx, cy, cw, ch;
@@ -1127,7 +1127,10 @@
/* center x-direction */
_e_border_resize_limit(bd, &w, &h);
x1 = bd->zone->x + (bd->zone->w - w) / 2;
- e_border_move_resize(bd, x1, bd->zone->y, w, h);
+ /* center y-direction */
+ y1 = bd->zone->y + (bd->zone->h - h) / 2;
+ e_border_move_resize(bd, x1, y1, w, h);
+ bd->maximized = E_MAXIMIZE_FULLSCREEN;
break;
case E_MAXIMIZE_SMART:
x1 = bd->zone->x;
@@ -1167,21 +1170,127 @@
}
}
/* FIXME: walk through docks and toolbars */
- e_border_move_resize(bd, x1, y1, x2 - x1, y2 - y1);
+ w = x2 - x1;
+ h = y2 - y1;
+ _e_border_resize_limit(bd, &w, &h);
+ e_border_move_resize(bd, x1, y1, w, h);
+ bd->maximized = E_MAXIMIZE_SMART;
break;
case E_MAXIMIZE_EXPAND:
- /* FIXME */
+ x1 = bd->zone->x;
+ y1 = bd->zone->y;
+ x2 = bd->zone->x + bd->zone->w;
+ y2 = bd->zone->y + bd->zone->h;
+
+ /* walk through all gadgets */
+ /* FIXME: Should we care about clients that aren't aligned to */
+ /* one edge? */
+ for (l = bd->zone->container->gadman->clients; l; l = l->next)
+ {
+ E_Gadman_Client *gmc;
+
+ gmc = l->data;
+ if ((gmc->zone != bd->zone) ||
+ ((gmc->policy & 0xff) != E_GADMAN_POLICY_EDGES))
+ continue;
+ switch (gmc->edge)
+ {
+ case E_GADMAN_EDGE_LEFT:
+ if ((gmc->x + gmc->w) > x1)
+ x1 = (gmc->x + gmc->w);
+ break;
+ case E_GADMAN_EDGE_RIGHT:
+ if (gmc->x < x2)
+ x2 = gmc->x;
+ break;
+ case E_GADMAN_EDGE_TOP:
+ if ((gmc->y + gmc->h) > y1)
+ y1 = (gmc->y + gmc->h);
+ break;
+ case E_GADMAN_EDGE_BOTTOM:
+ if (gmc->y < y2)
+ y2 = gmc->y;
+ break;
+ }
+ }
+ /* FIXME: walk through docks and toolbars */
+ w = x2 - x1;
+ h = y2 - y1;
+ _e_border_resize_limit(bd, &w, &h);
+ e_border_move_resize(bd, x1, y1, w, h);
+ /* Don't set bd->maximized, no need to return from this state */
break;
case E_MAXIMIZE_FILL:
- /* FIXME */
+ x1 = bd->zone->x;
+ y1 = bd->zone->y;
+ x2 = bd->zone->x + bd->zone->w;
+ y2 = bd->zone->y + bd->zone->h;
+
+ /* walk through all gadgets */
+ /* FIXME: Should we care about clients that aren't aligned to */
+ /* one edge? */
+ for (l = bd->zone->container->gadman->clients; l; l = l->next)
+ {
+ E_Gadman_Client *gmc;
+
+ gmc = l->data;
+ if ((gmc->zone != bd->zone) ||
+ ((gmc->policy & 0xff) != E_GADMAN_POLICY_EDGES))
+ continue;
+ switch (gmc->edge)
+ {
+ case E_GADMAN_EDGE_LEFT:
+ if ((gmc->x + gmc->w) > x1)
+ x1 = (gmc->x + gmc->w);
+ break;
+ case E_GADMAN_EDGE_RIGHT:
+ if (gmc->x < x2)
+ x2 = gmc->x;
+ break;
+ case E_GADMAN_EDGE_TOP:
+ if ((gmc->y + gmc->h) > y1)
+ y1 = (gmc->y + gmc->h);
+ break;
+ case E_GADMAN_EDGE_BOTTOM:
+ if (gmc->y < y2)
+ y2 = gmc->y;
+ break;
+ }
+ }
+ /* walk through all windows */
+ bl = e_container_border_list_first(bd->zone->container);
+ while ((bd2 = e_container_border_list_next(bl)))
+ {
+ if (bd2->zone != bd->zone) continue;
+
+ if ((bd2->x < x2) && (bd2->x >= (bd->x + bd->w)))
+ x2 = bd2->x;
+ if (((bd2->x + bd2->w) > x1) && ((bd2->x + bd2->w) <= bd->x))
+ x1 = (bd2->x + bd2->w);
+ if ((bd2->y < y2) && (bd2->y >= (bd->y + bd->w)))
+ y2 = bd2->y;
+ if (((bd2->y + bd2->h) > y1) && ((bd2->y + bd2->h) <= bd->y))
+ y1 = (bd2->y + bd2->h);
+ }
+ e_container_border_list_free(bl);
+
+ w = x2 - x1;
+ h = y2 - y1;
+ _e_border_resize_limit(bd, &w, &h);
+ e_border_move_resize(bd, x1, y1, w, h);
+ /* Don't set bd->maximized, no need to return from this state */
break;
}
- bd->maximized = e_config->maximize_policy;
bd->changes.pos = 1;
bd->changes.size = 1;
bd->changed = 1;
- edje_object_signal_emit(bd->bg_object, "maximize", "");
+ if (bd->maximized)
+ {
+ edje_object_signal_emit(bd->bg_object, "maximize", "");
+ e_hints_window_maximized_set(bd, 1);
+ }
+
}
}
@@ -1205,7 +1314,6 @@
/* FIXME */
break;
case E_MAXIMIZE_FULLSCREEN:
- /* FIXME */
if (bd->bg_object)
{
Evas_Coord cx, cy, cw, ch;
@@ -1229,13 +1337,13 @@
}
break;
case E_MAXIMIZE_SMART:
- /* FIXME */
+ /* Don't have to do anything special */
break;
case E_MAXIMIZE_EXPAND:
- /* FIXME */
+ /* Ignore */
break;
case E_MAXIMIZE_FILL:
- /* FIXME */
+ /* Ignore */
break;
}
bd->maximized = E_MAXIMIZE_NONE;
@@ -1275,9 +1383,11 @@
w = bd->zone->w + bd->client_inset.l + bd->client_inset.r;
h = bd->zone->h + bd->client_inset.t + bd->client_inset.b;
_e_border_resize_limit(bd, &w, &h);
- /* center x */
+ /* center */
x = x + (bd->zone->w + bd->client_inset.l + bd->client_inset.r - w) / 2;
+ y = y + (bd->zone->h + bd->client_inset.t + bd->client_inset.b - h) / 2;
e_border_move_resize(bd, x, y, w, h);
+ ecore_evas_hide(bd->bg_ecore_evas);
bd->fullscreen = 1;
bd->changes.pos = 1;
@@ -1302,6 +1412,7 @@
bd->fullscreen = 0;
e_border_move_resize(bd, bd->saved.x, bd->saved.y, bd->saved.w,
bd->saved.h);
+ ecore_evas_show(bd->bg_ecore_evas);
bd->changes.pos = 1;
bd->changes.size = 1;
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs