e: More y1 to yy1 renaming thanks to y1 global

SVN revision: 72525
devs/princeamd/enlightenment-0.17-elive
Stefan Schmidt 11 years ago
parent 8503f0b041
commit e793c4d769
  1. 30
      src/bin/e_border.c
  2. 56
      src/bin/e_maximize.c

@ -2466,7 +2466,7 @@ _e_border_client_inset_calc(E_Border *bd)
static void
_e_border_maximize(E_Border *bd, E_Maximize max)
{
int x1, y1, x2, y2;
int x1, yy1, x2, y2;
int w, h, pw, ph;
int zx, zy, zw, zh;
@ -2491,12 +2491,12 @@ _e_border_maximize(E_Border *bd, E_Maximize max)
/* center x-direction */
x1 = bd->zone->x + (bd->zone->w - w) / 2;
/* center y-direction */
y1 = bd->zone->y + (bd->zone->h - h) / 2;
yy1 = bd->zone->y + (bd->zone->h - h) / 2;
if ((max & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_BOTH)
e_border_move_resize(bd, x1, y1, w, h);
e_border_move_resize(bd, x1, yy1, w, h);
else if ((max & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_VERTICAL)
e_border_move_resize(bd, bd->x, y1, bd->w, h);
e_border_move_resize(bd, bd->x, yy1, bd->w, h);
else if ((max & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_HORIZONTAL)
e_border_move_resize(bd, x1, bd->y, w, bd->h);
break;
@ -2524,46 +2524,46 @@ _e_border_maximize(E_Border *bd, E_Maximize max)
x1 = bd->x;
if (bd->y < zy) // window top not useful coordinates
y1 = zy;
yy1 = zy;
else if (bd->y + bd->h > zy + zh) // window bottom not useful coordinates
y1 = zy + zh - bd->h;
yy1 = zy + zh - bd->h;
else // window normal position
y1 = bd->y;
yy1 = bd->y;
if ((max & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_BOTH)
e_border_move_resize(bd, zx, zy, zw, zh);
else if ((max & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_VERTICAL)
e_border_move_resize(bd, x1, zy, w, zh);
else if ((max & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_HORIZONTAL)
e_border_move_resize(bd, zx, y1, zw, h);
e_border_move_resize(bd, zx, yy1, zw, h);
edje_object_signal_emit(bd->bg_object, "e,action,maximize", "e");
break;
case E_MAXIMIZE_FILL:
x1 = bd->zone->x;
y1 = bd->zone->y;
yy1 = bd->zone->y;
x2 = bd->zone->x + bd->zone->w;
y2 = bd->zone->y + bd->zone->h;
/* walk through all shelves */
e_maximize_border_shelf_fill(bd, &x1, &y1, &x2, &y2, max);
e_maximize_border_shelf_fill(bd, &x1, &yy1, &x2, &y2, max);
/* walk through all windows */
e_maximize_border_border_fill(bd, &x1, &y1, &x2, &y2, max);
e_maximize_border_border_fill(bd, &x1, &yy1, &x2, &y2, max);
w = x2 - x1;
h = y2 - y1;
h = y2 - yy1;
pw = w;
ph = h;
e_border_resize_limit(bd, &w, &h);
/* center x-direction */
x1 = x1 + (pw - w) / 2;
/* center y-direction */
y1 = y1 + (ph - h) / 2;
yy1 = yy1 + (ph - h) / 2;
if ((max & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_BOTH)
e_border_move_resize(bd, x1, y1, w, h);
e_border_move_resize(bd, x1, yy1, w, h);
else if ((max & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_VERTICAL)
e_border_move_resize(bd, bd->x, y1, bd->w, h);
e_border_move_resize(bd, bd->x, yy1, bd->w, h);
else if ((max & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_HORIZONTAL)
e_border_move_resize(bd, x1, bd->y, w, bd->h);
break;

@ -4,29 +4,29 @@ typedef struct _E_Maximize_Rect E_Maximize_Rect;
struct _E_Maximize_Rect
{
int x1, y1, x2, y2;
int x1, yy1, x2, y2;
};
#define OBSTACLE(_x1, _y1, _x2, _y2) \
{ \
r = E_NEW(E_Maximize_Rect, 1); \
r->x1 = (_x1); r->y1 = (_y1); r->x2 = (_x2); r->y2 = (_y2); \
r->x1 = (_x1); r->yy1 = (_y1); r->x2 = (_x2); r->y2 = (_y2); \
rects = eina_list_append(rects, r); \
}
static void _e_maximize_border_rects_fill(E_Border *bd, Eina_List *list, int *x1, int *y1, int *x2, int *y2, E_Maximize dir);
static void _e_maximize_border_rects_fill_both(E_Border *bd, Eina_List *rects, int *x1, int *y1, int *x2, int *y2);
static void _e_maximize_border_rects_fill(E_Border *bd, Eina_List *list, int *x1, int *yy1, int *x2, int *y2, E_Maximize dir);
static void _e_maximize_border_rects_fill_both(E_Border *bd, Eina_List *rects, int *x1, int *yy1, int *x2, int *y2);
static void _e_maximize_border_rects_fill_horiz(E_Border *bd, Eina_List *rects, int *x1, int *x2, int *bx, int *by, int *bw, int *bh);
static void _e_maximize_border_rects_fill_vert(E_Border *bd, Eina_List *rects, int *y1, int *y2, int *bx, int *by, int *bw, int *bh);
static void _e_maximize_border_rects_fill_vert(E_Border *bd, Eina_List *rects, int *yy1, int *y2, int *bx, int *by, int *bw, int *bh);
EAPI void
e_maximize_border_shelf_fit(E_Border *bd, int *x1, int *y1, int *x2, int *y2, E_Maximize dir)
e_maximize_border_shelf_fit(E_Border *bd, int *x1, int *yy1, int *x2, int *y2, E_Maximize dir)
{
e_maximize_border_shelf_fill(bd, x1, y1, x2, y2, dir);
e_maximize_border_shelf_fill(bd, x1, yy1, x2, y2, dir);
}
EAPI void
e_maximize_border_dock_fit(E_Border *bd, int *x1, int *y1, int *x2, int *y2)
e_maximize_border_dock_fit(E_Border *bd, int *x1, int *yy1, int *x2, int *y2)
{
E_Border_List *bl;
E_Border *bd2;
@ -36,7 +36,7 @@ e_maximize_border_dock_fit(E_Border *bd, int *x1, int *y1, int *x2, int *y2)
if (x1) cx1 = *x1;
cy1 = bd->zone->y;
if (y1) cy1 = *y1;
if (yy1) cy1 = *yy1;
cx2 = bd->zone->x + bd->zone->w;
if (x2) cx2 = *x2;
@ -116,13 +116,13 @@ e_maximize_border_dock_fit(E_Border *bd, int *x1, int *y1, int *x2, int *y2)
e_container_border_list_free(bl);
if (x1) *x1 = cx1;
if (y1) *y1 = cy1;
if (yy1) *yy1 = cy1;
if (x2) *x2 = cx2;
if (y2) *y2 = cy2;
}
EAPI void
e_maximize_border_shelf_fill(E_Border *bd, int *x1, int *y1, int *x2, int *y2, E_Maximize dir)
e_maximize_border_shelf_fill(E_Border *bd, int *x1, int *yy1, int *x2, int *y2, E_Maximize dir)
{
Eina_List *l, *rects = NULL;
E_Shelf *es;
@ -156,13 +156,13 @@ e_maximize_border_shelf_fill(E_Border *bd, int *x1, int *y1, int *x2, int *y2, E
}
if (rects)
{
_e_maximize_border_rects_fill(bd, rects, x1, y1, x2, y2, dir);
_e_maximize_border_rects_fill(bd, rects, x1, yy1, x2, y2, dir);
E_FREE_LIST(rects, free);
}
}
EAPI void
e_maximize_border_border_fill(E_Border *bd, int *x1, int *y1, int *x2, int *y2, E_Maximize dir)
e_maximize_border_border_fill(E_Border *bd, int *x1, int *yy1, int *x2, int *y2, E_Maximize dir)
{
Eina_List *rects = NULL;
E_Border_List *bl;
@ -179,17 +179,17 @@ e_maximize_border_border_fill(E_Border *bd, int *x1, int *y1, int *x2, int *y2,
e_container_border_list_free(bl);
if (rects)
{
_e_maximize_border_rects_fill(bd, rects, x1, y1, x2, y2, dir);
_e_maximize_border_rects_fill(bd, rects, x1, yy1, x2, y2, dir);
E_FREE_LIST(rects, free);
}
}
static void
_e_maximize_border_rects_fill(E_Border *bd, Eina_List *rects, int *x1, int *y1, int *x2, int *y2, E_Maximize dir)
_e_maximize_border_rects_fill(E_Border *bd, Eina_List *rects, int *x1, int *yy1, int *x2, int *y2, E_Maximize dir)
{
if ((dir & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_BOTH)
{
_e_maximize_border_rects_fill_both(bd, rects, x1, y1, x2, y2);
_e_maximize_border_rects_fill_both(bd, rects, x1, yy1, x2, y2);
}
else
{
@ -203,12 +203,12 @@ _e_maximize_border_rects_fill(E_Border *bd, Eina_List *rects, int *x1, int *y1,
if ((dir & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_HORIZONTAL)
_e_maximize_border_rects_fill_horiz(bd, rects, x1, x2, &bx, &by, &bw, &bh);
else if ((dir & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_VERTICAL)
_e_maximize_border_rects_fill_vert(bd, rects, y1, y2, &bx, &by, &bw, &bh);
_e_maximize_border_rects_fill_vert(bd, rects, yy1, y2, &bx, &by, &bw, &bh);
}
}
static void
_e_maximize_border_rects_fill_both(E_Border *bd, Eina_List *rects, int *x1, int *y1, int *x2, int *y2)
_e_maximize_border_rects_fill_both(E_Border *bd, Eina_List *rects, int *x1, int *yy1, int *x2, int *y2)
{
int hx1, hy1, hx2, hy2;
int vx1, vy1, vx2, vy2;
@ -218,7 +218,7 @@ _e_maximize_border_rects_fill_both(E_Border *bd, Eina_List *rects, int *x1, int
if (x1) hx1 = vx1 = *x1;
hy1 = vy1 = bd->zone->y;
if (y1) hy1 = vy1 = *y1;
if (yy1) hy1 = vy1 = *yy1;
hx2 = vx2 = bd->zone->x + bd->zone->w;
if (x2) hx2 = vx2 = *x2;
@ -246,14 +246,14 @@ _e_maximize_border_rects_fill_both(E_Border *bd, Eina_List *rects, int *x1, int
if (((hx2 - hx1) * (hy2 - hy1)) > ((vx2 - vx1) * (vy2 - vy1)))
{
if (x1) *x1 = hx1;
if (y1) *y1 = hy1;
if (yy1) *yy1 = hy1;
if (x2) *x2 = hx2;
if (y2) *y2 = hy2;
}
else
{
if (x1) *x1 = vx1;
if (y1) *y1 = vy1;
if (yy1) *yy1 = vy1;
if (x2) *x2 = vx2;
if (y2) *y2 = vy2;
}
@ -276,7 +276,7 @@ _e_maximize_border_rects_fill_horiz(E_Border *bd, Eina_List *rects, int *x1, int
EINA_LIST_FOREACH(rects, l, rect)
{
if ((rect->x2 > cx1) && (rect->x2 <= *bx) &&
E_INTERSECTS(0, rect->y1, bd->zone->w, (rect->y2 - rect->y1), 0, *by, bd->zone->w, *bh))
E_INTERSECTS(0, rect->yy1, bd->zone->w, (rect->y2 - rect->yy1), 0, *by, bd->zone->w, *bh))
{
cx1 = rect->x2;
}
@ -288,7 +288,7 @@ _e_maximize_border_rects_fill_horiz(E_Border *bd, Eina_List *rects, int *x1, int
EINA_LIST_FOREACH(rects, l, rect)
{
if ((rect->x1 < cx2) && (rect->x1 >= (*bx + *bw)) &&
E_INTERSECTS(0, rect->y1, bd->zone->w, (rect->y2 - rect->y1), 0, *by, bd->zone->w, *bh))
E_INTERSECTS(0, rect->yy1, bd->zone->w, (rect->y2 - rect->yy1), 0, *by, bd->zone->w, *bh))
{
cx2 = rect->x1;
}
@ -300,14 +300,14 @@ _e_maximize_border_rects_fill_horiz(E_Border *bd, Eina_List *rects, int *x1, int
}
static void
_e_maximize_border_rects_fill_vert(E_Border *bd, Eina_List *rects, int *y1, int *y2, int *bx, int *by, int *bw, int *bh)
_e_maximize_border_rects_fill_vert(E_Border *bd, Eina_List *rects, int *yy1, int *y2, int *bx, int *by, int *bw, int *bh)
{
Eina_List *l;
E_Maximize_Rect *rect;
int cy1, cy2;
cy1 = bd->zone->y;
if (y1) cy1 = *y1;
if (yy1) cy1 = *yy1;
cy2 = bd->zone->y + bd->zone->h;
if (y2) cy2 = *y2;
@ -327,15 +327,15 @@ _e_maximize_border_rects_fill_vert(E_Border *bd, Eina_List *rects, int *y1, int
/* Expand down */
EINA_LIST_FOREACH(rects, l, rect)
{
if ((rect->y1 < cy2) && (rect->y1 >= (*by + *bh)) &&
if ((rect->yy1 < cy2) && (rect->yy1 >= (*by + *bh)) &&
E_INTERSECTS(rect->x1, 0, (rect->x2 - rect->x1), bd->zone->h, *bx, 0, *bw, bd->zone->h))
{
cy2 = rect->y1;
cy2 = rect->yy1;
}
}
*bh = (cy2 - cy1);
if (y1) *y1 = cy1;
if (yy1) *yy1 = cy1;
if (y2) *y2 = cy2;
}

Loading…
Cancel
Save