Enlightenment CVS committal
Author : kwo
Project : e16
Module : e
Dir : e16/e/src
Modified Files:
E.h actions.c areas.c arrange.c borders.c comms.c desktops.c
ewmh.c finders.c focus.c icccm.c iconify.c ipc.c menus.c
pager.c session.c settings.c size.c stacking.c
Log Message:
Use new static stacking list wherever possible.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.232
retrieving revision 1.233
diff -u -3 -r1.232 -r1.233
--- E.h 22 Mar 2004 16:46:52 -0000 1.232
+++ E.h 26 Mar 2004 21:21:44 -0000 1.233
@@ -2535,8 +2535,10 @@
void EwinListDelete(EWinList * ewl, EWin * ewin);
int EwinListRaise(EWinList * ewl, EWin * ewin, int mode);
int EwinListLower(EWinList * ewl, EWin * ewin, int mode);
-EWin **EwinListGetForDesktop(int desk, int *num);
-EWin **EwinListGetStacking(int *num);
+EWin *const *EwinListGetForDesktop(int desk, int *num);
+EWin *const *EwinListGetStacking(int *num);
+
+#define EwinListGet EwinListGetStacking
int EwinListStackingRaise(EWin * ewin);
int EwinListStackingLower(EWin * ewin);
int EwinListFocusRaise(EWin * ewin);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/actions.c,v
retrieving revision 1.149
retrieving revision 1.150
diff -u -3 -r1.149 -r1.150
--- actions.c 21 Mar 2004 01:39:39 -0000 1.149
+++ actions.c 26 Mar 2004 21:21:44 -0000 1.150
@@ -1171,7 +1171,7 @@
static int
DoRaiseLower(EWin * ewin, const void *params, int nogroup)
{
- EWin **gwins, **lst;
+ EWin **gwins, *const *lst;
int gnum, j, raise = 0;
int i, num;
@@ -1233,11 +1233,10 @@
{
char *type;
int method;
- void **lst;
int i, j, k, num, speed;
RectBox *fixed, *ret, *floating;
char doslide;
- EWin *ewin;
+ EWin *const *lst, *ewin;
Button **blst;
EDBUG(6, "doCleanup");
@@ -1258,7 +1257,7 @@
method = ARRANGE_BY_POSITION;
}
}
- lst = ListItemType(&num, LIST_TYPE_EWIN);
+ lst = EwinListGet(&num);
if (lst)
{
fixed = NULL;
@@ -1268,36 +1267,35 @@
k = 0;
for (i = 0; i < num; i++)
{
- if ((((EWin *) lst[i])->desktop == desks.current)
- && (!((EWin *) lst[i])->sticky)
- && (!((EWin *) lst[i])->floating)
- && (!((EWin *) lst[i])->iconified)
- && (!((EWin *) lst[i])->ignorearrange)
- && (!((EWin *) lst[i])->menu)
- && (((EWin *) lst[i])->area_x ==
- desks.desk[((EWin *) lst[i])->desktop].current_area_x)
- && (((EWin *) lst[i])->area_y ==
- desks.desk[((EWin *) lst[i])->desktop].current_area_y))
+ ewin = lst[i];
+ if ((ewin->desktop == desks.current)
+ && (!ewin->sticky)
+ && (!ewin->floating)
+ && (!ewin->iconified)
+ && (!ewin->ignorearrange)
+ && (!ewin->menu)
+ && (ewin->area_x ==
+ desks.desk[ewin->desktop].current_area_x)
+ && (ewin->area_y == desks.desk[ewin->desktop].current_area_y))
{
floating[j].data = lst[i];
- floating[j].x = ((EWin *) lst[i])->x;
- floating[j].y = ((EWin *) lst[i])->y;
- floating[j].w = ((EWin *) lst[i])->w;
- floating[j].p = ((EWin *) lst[i])->layer;
- floating[j++].h = ((EWin *) lst[i])->h;
+ floating[j].x = ewin->x;
+ floating[j].y = ewin->y;
+ floating[j].w = ewin->w;
+ floating[j].p = ewin->layer;
+ floating[j++].h = ewin->h;
}
- else if (((((EWin *) lst[i])->desktop == desks.current)
- || (((EWin *) lst[i])->sticky))
- && (((EWin *) lst[i])->layer != 4)
- && (((EWin *) lst[i])->layer != 0)
- && (!((EWin *) lst[i])->menu))
+ else if (((ewin->desktop == desks.current)
+ || (ewin->sticky))
+ && (ewin->layer != 4)
+ && (ewin->layer != 0) && (!ewin->menu))
{
fixed = Erealloc(fixed, sizeof(RectBox) * (k + 1));
fixed[k].data = lst[i];
- fixed[k].x = ((EWin *) lst[i])->x;
- fixed[k].y = ((EWin *) lst[i])->y;
- fixed[k].w = ((EWin *) lst[i])->w;
- fixed[k].h = ((EWin *) lst[i])->h;
+ fixed[k].x = ewin->x;
+ fixed[k].y = ewin->y;
+ fixed[k].w = ewin->w;
+ fixed[k].h = ewin->h;
if (fixed[k].x < 0)
{
fixed[k].x += fixed[k].w;
@@ -1314,8 +1312,8 @@
fixed[k].h = root.h - fixed[k].y;
if ((fixed[k].w > 0) && (fixed[k].h > 0))
{
- if (!((EWin *) lst[i])->never_use_area)
- fixed[k].p = ((EWin *) lst[i])->layer;
+ if (!ewin->never_use_area)
+ fixed[k].p = ewin->layer;
else
fixed[k].p = 99;
k++;
@@ -1398,8 +1396,6 @@
Efree(ret);
if (floating)
Efree(floating);
- if (lst)
- Efree(lst);
}
EDBUG_RETURN(0);
edummy = NULL;
@@ -2351,7 +2347,7 @@
doScrollWindows(EWin * edummy, const void *params)
{
int x, y, num, i;
- EWin **lst;
+ EWin *const *lst;
EDBUG(6, "doScrollWindows");
if (!params)
@@ -2361,17 +2357,12 @@
y = 0;
sscanf((char *)params, "%i %i", &x, &y);
- lst = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
-
- if ((lst) && (num > 0))
+ lst = EwinListGet(&num);
+ for (i = 0; i < num; i++)
{
- for (i = 0; i < num; i++)
- {
- if ((lst[i]->desktop == desks.current) && (!lst[i]->sticky)
- && (!lst[i]->floating) && (!lst[i]->fixedpos))
- MoveEwin(lst[i], lst[i]->x + x, lst[i]->y + y);
- }
- Efree(lst);
+ if ((lst[i]->desktop == desks.current) && (!lst[i]->sticky)
+ && (!lst[i]->floating) && (!lst[i]->fixedpos))
+ MoveEwin(lst[i], lst[i]->x + x, lst[i]->y + y);
}
EDBUG_RETURN(0);
edummy = NULL;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/areas.c,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -3 -r1.64 -r1.65
--- areas.c 22 Mar 2004 16:46:52 -0000 1.64
+++ areas.c 26 Mar 2004 21:21:45 -0000 1.65
@@ -83,7 +83,7 @@
{
int a, b, i, num;
- EWin **lst;
+ EWin *const *lst;
if (ax <= 0)
return;
@@ -96,20 +96,16 @@
SetAreaSize(ax, ay);
- lst = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
- if (lst)
+ lst = EwinListGet(&num);
+ for (i = 0; i < num; i++)
{
- for (i = 0; i < num; i++)
+ if ((!(lst[i]->sticky)) && (!(lst[i]->fixedpos)))
{
- if ((!(lst[i]->sticky)) && (!(lst[i]->fixedpos)))
- {
- if (lst[i]->area_x >= ax)
- MoveEwinToArea(lst[i], ax - 1, lst[i]->area_x);
- if (lst[i]->area_y >= ay)
- MoveEwinToArea(lst[i], lst[i]->area_x, ay - 1);
- }
+ if (lst[i]->area_x >= ax)
+ MoveEwinToArea(lst[i], ax - 1, lst[i]->area_x);
+ if (lst[i]->area_y >= ay)
+ MoveEwinToArea(lst[i], lst[i]->area_x, ay - 1);
}
- Efree(lst);
}
GetCurrentArea(&a, &b);
@@ -246,7 +242,7 @@
void
SetCurrentArea(int ax, int ay)
{
- EWin *ewin, **lst;
+ EWin *const *lst, *ewin;
int i, num, a1, a2, x, y, dx, dy;
ToolTip *tt;
@@ -287,54 +283,92 @@
desks.desk[desks.current].current_area_y = ay;
/* move all the windows around */
- lst = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
- if (lst)
+ lst = EwinListGet(&num);
+ if (Conf.desks.slidein)
{
- if (Conf.desks.slidein)
+ int wnum = 0;
+ Window *wl = NULL;
+
+ /* create the list of windwos to move */
+ for (i = 0; i < num; i++)
{
- int wnum = 0;
- Window *wl = NULL;
+ ewin = lst[i];
+ if (ewin->desktop != desks.current || ewin->sticky ||
+ ewin->fixedpos || ewin->iconified)
+ continue;
- /* create the list of windwos to move */
- for (i = 0; i < num; i++)
+ if ((ewin->floating) && (Conf.movemode > 0))
{
- ewin = lst[i];
- if (ewin->desktop != desks.current || ewin->sticky ||
- ewin->fixedpos || ewin->iconified)
- continue;
-
- if ((ewin->floating) && (Conf.movemode > 0))
- {
- wnum++;
- wl = Erealloc(wl, sizeof(Window) * wnum);
- wl[wnum - 1] = ewin->win;
- }
- else if (!ewin->floating)
- {
- wnum++;
- wl = Erealloc(wl, sizeof(Window) * wnum);
- wl[wnum - 1] = ewin->win;
- }
+ wnum++;
+ wl = Erealloc(wl, sizeof(Window) * wnum);
+ wl[wnum - 1] = ewin->win;
}
-
- /* slide them */
- if (wl)
+ else if (!ewin->floating)
{
- SlideWindowsBy(wl, wnum, -dx, -dy, Conf.desks.slidespeed);
- Efree(wl);
+ wnum++;
+ wl = Erealloc(wl, sizeof(Window) * wnum);
+ wl[wnum - 1] = ewin->win;
}
+ }
+
+ /* slide them */
+ if (wl)
+ {
+ SlideWindowsBy(wl, wnum, -dx, -dy, Conf.desks.slidespeed);
+ Efree(wl);
+ }
- /* move the windows to their final positions */
- for (i = 0; i < num; i++)
+ /* move the windows to their final positions */
+ for (i = 0; i < num; i++)
+ {
+ char setflip = 0;
+
+ ewin = lst[i];
+ if (ewin->desktop != desks.current || ewin->sticky ||
+ ewin->fixedpos || ewin->floating || ewin->client.transient_for)
+ continue;
+
+ a1 = ewin->area_x;
+ a2 = ewin->area_y;
+ if (!Mode.flipp)
+ {
+ setflip = 1;
+ Mode.flipp = 1;
+ }
+ MoveEwin(ewin, ewin->x - dx, ewin->y - dy);
+ if (setflip)
+ Mode.flipp = 0;
+ ewin->area_x = a1;
+ ewin->area_y = a2;
+ HintsSetWindowArea(ewin);
+ }
+ }
+ else
+ {
+ /* move all windows across.... */
+ for (i = 0; i < num; i++)
+ {
+ ewin = lst[i];
+ if (ewin->desktop != desks.current || ewin->sticky ||
+ ewin->fixedpos)
+ continue;
+
+ /* if we're moving this window and its not opaque move */
+ /* warp it across without remebering the xy stuff */
+ /* well work out the xy stuff later when the move finishes */
+ if (ewin->floating)
+ {
+ if (Conf.movemode > 0)
+ {
+ GetWinXY(ewin->win, &x, &y);
+ EMoveWindow(disp, ewin->win, x - dx, y - dy);
+ }
+ }
+ /* if we're not moving it... move it across */
+ else if (!ewin->client.transient_for)
{
char setflip = 0;
- ewin = lst[i];
- if (ewin->desktop != desks.current || ewin->sticky ||
- ewin->fixedpos || ewin->floating ||
- ewin->client.transient_for)
- continue;
-
a1 = ewin->area_x;
a2 = ewin->area_y;
if (!Mode.flipp)
@@ -350,49 +384,6 @@
HintsSetWindowArea(ewin);
}
}
- else
- {
- /* move all windows across.... */
- for (i = 0; i < num; i++)
- {
- ewin = lst[i];
- if (ewin->desktop != desks.current || ewin->sticky ||
- ewin->fixedpos)
- continue;
-
- /* if we're moving this window and its not opaque move */
- /* warp it across without remebering the xy stuff */
- /* well work out the xy stuff later when the move finishes */
- if (ewin->floating)
- {
- if (Conf.movemode > 0)
- {
- GetWinXY(ewin->win, &x, &y);
- EMoveWindow(disp, ewin->win, x - dx, y - dy);
- }
- }
- /* if we're not moving it... move it across */
- else if (!ewin->client.transient_for)
- {
- char setflip = 0;
-
- a1 = ewin->area_x;
- a2 = ewin->area_y;
- if (!Mode.flipp)
- {
- setflip = 1;
- Mode.flipp = 1;
- }
- MoveEwin(ewin, ewin->x - dx, ewin->y - dy);
- if (setflip)
- Mode.flipp = 0;
- ewin->area_x = a1;
- ewin->area_y = a2;
- HintsSetWindowArea(ewin);
- }
- }
- }
- Efree(lst);
}
/* set hints up for it */
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/arrange.c,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -3 -r1.65 -r1.66
--- arrange.c 20 Mar 2004 15:49:04 -0000 1.65
+++ arrange.c 26 Mar 2004 21:21:45 -0000 1.66
@@ -821,7 +821,7 @@
void
ArrangeEwinXY(EWin * ewin, int *px, int *py)
{
- EWin **lst;
+ EWin *const *lst;
Button **blst;
int i, j, num;
RectBox *fixed, *ret, newrect;
@@ -829,7 +829,7 @@
fixed = NULL;
ret = NULL;
- lst = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
+ lst = EwinListGet(&num);
if ((lst) && (num > 0))
{
fixed = Emalloc(sizeof(RectBox) * num);
@@ -924,7 +924,6 @@
break;
}
}
- Efree(lst);
if (ret)
Efree(ret);
if (fixed)
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/borders.c,v
retrieving revision 1.153
retrieving revision 1.154
diff -u -3 -r1.153 -r1.154
--- borders.c 22 Mar 2004 16:46:52 -0000 1.153
+++ borders.c 26 Mar 2004 21:21:45 -0000 1.154
@@ -114,17 +114,13 @@
SetEInfoOnAll()
{
int i, num;
- EWin **lst;
+ EWin *const *lst;
EDBUG(5, "SetEInfoOnAll");
- lst = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
- if ((lst) && (num > 0))
- {
- for (i = 0; i < num; i++)
- ICCCM_SetEInfo(lst[i]);
- Efree(lst);
- }
+ lst = EwinListGet(&num);
+ for (i = 0; i < num; i++)
+ ICCCM_SetEInfo(lst[i]);
ICCCM_SetMainEInfo();
EDBUG_RETURN_;
@@ -150,7 +146,7 @@
{
Window rt, ch;
int dum, px, py, d;
- EWin **lst;
+ EWin *const *lst;
int i, num;
EDBUG(5, "GetEwinPointerInClient");
@@ -341,7 +337,7 @@
AddToFamily(Window win)
{
EWin *ewin, *ewin2;
- EWin **lst;
+ EWin *const *lst;
int i, k, num, speed, fx, fy, x, y;
char doslide, manplace;
char pq;
@@ -408,7 +404,7 @@
if (!ewin2)
{
- lst = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
+ lst = EwinListGet(&num);
for (i = 0; i < num; i++)
{
if ((lst[i]->iconified) ||
@@ -418,8 +414,6 @@
ewin2 = lst[i];
break;
}
- if (lst)
- Efree(lst);
}
if (ewin2)
@@ -3235,10 +3229,10 @@
BordersEvent(XEvent * ev, border_event_func_t * func)
{
Window win = ev->xany.window;
- EWin **ewins;
+ EWin *const *ewins;
int i, j, num, used = 0;
- ewins = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
+ ewins = EwinListGet(&num);
for (i = 0; i < num; i++)
{
for (j = 0; j < ewins[i]->border->num_winparts; j++)
@@ -3254,8 +3248,6 @@
}
done:
- if (ewins)
- Efree(ewins);
return used;
}
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/comms.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -3 -r1.55 -r1.56
--- comms.c 21 Mar 2004 01:39:39 -0000 1.55
+++ comms.c 26 Mar 2004 21:21:45 -0000 1.56
@@ -1570,22 +1570,18 @@
else
{
int i, num;
- EWin **lst;
+ EWin *const *lst;
Conf.desks.num = atoi(w);
if (Conf.desks.num <= 0)
Conf.desks.num = 1;
else if (Conf.desks.num > ENLIGHTENMENT_CONF_NUM_DESKTOPS)
Conf.desks.num = ENLIGHTENMENT_CONF_NUM_DESKTOPS;
- lst = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
- if (lst)
+ lst = EwinListGet(&num);
+ for (i = 0; i < num; i++)
{
- for (i = 0; i < num; i++)
- {
- if (lst[i]->desktop >= Conf.desks.num)
- MoveEwinToDesktop(lst[i], Conf.desks.num - 1);
- }
- Efree(lst);
+ if (lst[i]->desktop >= Conf.desks.num)
+ MoveEwinToDesktop(lst[i], Conf.desks.num - 1);
}
if (desks.current >= Conf.desks.num)
GotoDesktop(Conf.desks.num - 1);
@@ -1819,10 +1815,10 @@
{
char buf[FILEPATH_LEN_MAX], *ret = NULL, none[] =
"-NONE-";
- EWin **lst;
+ EWin *const *lst;
int i, num;
- lst = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
+ lst = EwinListGet(&num);
for (i = 0; i < num; i++)
{
if (!lst[i]->icccm.wm_name)
@@ -2031,8 +2027,6 @@
CommsSend(c, ret);
Efree(ret);
}
- if (lst)
- Efree(lst);
}
else
unknown = 1;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/desktops.c,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -3 -r1.76 -r1.77
--- desktops.c 22 Mar 2004 16:42:31 -0000 1.76
+++ desktops.c 26 Mar 2004 21:21:45 -0000 1.77
@@ -117,7 +117,7 @@
ChangeNumberOfDesktops(int quantity)
{
int pnum, i, num;
- EWin **lst;
+ EWin *const *lst;
pnum = Conf.desks.num;
for (i = quantity; i < ENLIGHTENMENT_CONF_NUM_DESKTOPS; i++)
@@ -129,16 +129,13 @@
else if (Conf.desks.num > ENLIGHTENMENT_CONF_NUM_DESKTOPS)
Conf.desks.num = ENLIGHTENMENT_CONF_NUM_DESKTOPS;
- lst = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
- if (lst)
+ lst = EwinListGet(&num);
+ for (i = 0; i < num; i++)
{
- for (i = 0; i < num; i++)
- {
- if (lst[i]->desktop >= Conf.desks.num)
- MoveEwinToDesktop(lst[i], Conf.desks.num - 1);
- }
- Efree(lst);
+ if (lst[i]->desktop >= Conf.desks.num)
+ MoveEwinToDesktop(lst[i], Conf.desks.num - 1);
}
+
if (Conf.desks.num > pnum)
{
for (i = pnum; i < Conf.desks.num; i++)
@@ -1179,7 +1176,7 @@
static void
MoveStickyWindowsToCurrentDesk(void)
{
- EWin **lst, *ewin, *last_ewin;
+ EWin *const *lst, *ewin, *last_ewin;
int i, num;
lst = EwinListGetStacking(&num);
@@ -1322,7 +1319,7 @@
MoveDesktop(int desk, int x, int y)
{
int i;
- EWin **lst;
+ EWin *const *lst;
int n, v, dx, dy;
EDBUG(3, "MoveDesktop");
@@ -1414,16 +1411,12 @@
desks.desk[desk].x = x;
desks.desk[desk].y = y;
- lst = (EWin **) ListItemType(&n, LIST_TYPE_EWIN);
- if (lst)
- {
- for (i = 0; i < n; i++)
- if (lst[i]->desktop == desk)
- ICCCM_Configure(lst[i]);
- Efree(lst);
- }
- EDBUG_RETURN_;
+ lst = EwinListGet(&n);
+ for (i = 0; i < n; i++)
+ if (lst[i]->desktop == desk)
+ ICCCM_Configure(lst[i]);
+ EDBUG_RETURN_;
}
void
@@ -1464,7 +1457,6 @@
XSync(disp, False);
EDBUG_RETURN_;
-
}
void
@@ -1494,7 +1486,6 @@
XSync(disp, False);
EDBUG_RETURN_;
-
}
void
@@ -1513,7 +1504,6 @@
EMoveWindow(disp, desks.desk[desk].win, root.w, 0);
EDBUG_RETURN_;
-
}
void
@@ -1566,7 +1556,7 @@
{
Window *wl, *wl2;
int i, wnum, tot, bnum;
- EWin **lst, *ewin;
+ EWin *const *lst, *ewin;
Button **blst;
EDBUG(2, "StackDesktop");
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewmh.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -3 -r1.40 -r1.41
--- ewmh.c 21 Mar 2004 01:39:40 -0000 1.40
+++ ewmh.c 26 Mar 2004 21:21:46 -0000 1.41
@@ -386,7 +386,7 @@
}
/* Stacking order */
- lst = EwinListGetStacking(&num);
+ lst = (EWin **) EwinListGetStacking(&num);
/* FIXME: num must be unchanged here! Check! */
if (num != nwin)
printf("*** ERROR: %s %d\n", __FILE__, __LINE__);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/finders.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -3 -r1.27 -r1.28
--- finders.c 20 Mar 2004 15:49:05 -0000 1.27
+++ finders.c 26 Mar 2004 21:21:46 -0000 1.28
@@ -25,57 +25,43 @@
EWin *
FindEwinByBase(Window win)
{
- EWin **ewins;
- EWin *ewin;
+ EWin *const *ewins;
int i, num;
EDBUG(6, "FindEwinByBase");
- ewins = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
+ ewins = EwinListGet(&num);
for (i = 0; i < num; i++)
{
if (win == ewins[i]->win)
- {
- ewin = ewins[i];
- Efree(ewins);
- EDBUG_RETURN(ewin);
- }
+ return ewins[i];
}
- if (ewins)
- Efree(ewins);
EDBUG_RETURN(NULL);
}
EWin *
FindEwinByChildren(Window win)
{
- EWin *ewin;
- EWin **ewins;
+ EWin *const *ewins;
int i, j, num;
EDBUG(6, "FindEwinByChildren");
- ewins = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
+ ewins = EwinListGet(&num);
for (i = 0; i < num; i++)
{
if ((win == ewins[i]->client.win) || (win == ewins[i]->win_container))
{
- ewin = ewins[i];
- Efree(ewins);
- EDBUG_RETURN(ewin);
+ return ewins[i];
}
else
{
for (j = 0; j < ewins[i]->border->num_winparts; j++)
if (win == ewins[i]->bits[j].win)
{
- ewin = ewins[i];
- Efree(ewins);
- EDBUG_RETURN(ewin);
+ return ewins[i];
}
}
}
- if (ewins)
- Efree(ewins);
EDBUG_RETURN(NULL);
}
@@ -83,7 +69,7 @@
FindEwinByPartial(const char *match, int type)
{
EWin *ewin = NULL;
- EWin **ewins;
+ EWin *const *ewins;
int i, num, len;
char ewinid[FILEPATH_LEN_MAX];
@@ -93,7 +79,7 @@
if (len <= 0)
goto done;
- ewins = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
+ ewins = EwinListGet(&num);
if (ewins == NULL)
goto done;
@@ -118,7 +104,6 @@
ewin = ewins[i];
break;
}
- Efree(ewins);
done:
EDBUG_RETURN(ewin);
@@ -127,27 +112,21 @@
EWin *
FindEwinByDecoration(Window win)
{
- EWin *ewin;
- EWin **ewins;
+ EWin *const *ewins;
int i, j, num;
EDBUG(6, "FindEwinByDecoration");
- ewins = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
+ ewins = EwinListGet(&num);
for (i = 0; i < num; i++)
{
for (j = 0; j < ewins[i]->border->num_winparts; j++)
{
if (win == ewins[i]->bits[j].win)
- {
- ewin = ewins[i];
- Efree(ewins);
- EDBUG_RETURN(ewin);
- }
+ return ewins[i];
}
}
- if (ewins)
- Efree(ewins);
+
EDBUG_RETURN(NULL);
}
@@ -190,24 +169,19 @@
EWin *
FindEwinByMenu(Menu * m)
{
- EWin *ewin = NULL;
- EWin **ewins;
+ EWin *const *ewins;
int i, num;
EDBUG(6, "FindEwinByMenu");
- ewins = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
+ ewins = EwinListGet(&num);
for (i = 0; i < num; i++)
{
- if (ewins[i]->menu != m)
- continue;
- ewin = ewins[i];
- break;
+ if (ewins[i]->menu == m)
+ return ewins[i];
}
- if (ewins)
- Efree(ewins);
- EDBUG_RETURN(ewin);
+ EDBUG_RETURN(NULL);
}
Group **
@@ -366,12 +340,12 @@
EWin **
ListTransientsFor(Window win, int *num)
{
- EWin **ewins, **lst = NULL;
+ EWin *const *ewins, **lst = NULL;
int i, j, n;
EDBUG(6, "ListTransientsFor");
- ewins = (EWin **) ListItemType(&n, LIST_TYPE_EWIN);
+ ewins = EwinListGet(&n);
j = 0;
for (i = 0; i < n; i++)
{
@@ -382,8 +356,6 @@
lst[j - 1] = ewins[i];
}
}
- if (ewins)
- Efree(ewins);
*num = j;
EDBUG_RETURN(lst);
}
@@ -391,12 +363,12 @@
EWin **
ListGroupMembers(Window win, int *num)
{
- EWin **ewins, **lst = NULL;
+ EWin *const *ewins, **lst = NULL;
int i, j, n;
EDBUG(6, "ListGroupMembers");
- ewins = (EWin **) ListItemType(&n, LIST_TYPE_EWIN);
+ ewins = EwinListGet(&n);
j = 0;
for (i = 0; i < n; i++)
{
@@ -407,8 +379,6 @@
lst[j - 1] = ewins[i];
}
}
- if (ewins)
- Efree(ewins);
*num = j;
EDBUG_RETURN(lst);
}
@@ -416,40 +386,35 @@
EWin *
FindEwinByDialog(Dialog * d)
{
- EWin *ewin;
- EWin **ewins;
+ EWin *const *ewins;
int i, num;
EDBUG(6, "FindEwinByDialog");
- ewins = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
+
+ ewins = EwinListGet(&num);
for (i = 0; i < num; i++)
{
if (ewins[i]->dialog == d)
- {
- ewin = ewins[i];
- Efree(ewins);
- EDBUG_RETURN(ewin);
- }
+ return ewins[i];
}
- if (ewins)
- Efree(ewins);
+
EDBUG_RETURN(NULL);
}
int
FindADialog(void)
{
- EWin **ewins;
+ EWin *const *ewins;
int i, num, n;
EDBUG(6, "FindADialog");
- ewins = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
+
+ ewins = EwinListGet(&num);
for (i = n = 0; i < num; i++)
{
if (ewins[i]->dialog)
n++;
}
- if (ewins)
- Efree(ewins);
+
EDBUG_RETURN(n);
}
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/focus.c,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -3 -r1.59 -r1.60
--- focus.c 22 Mar 2004 16:36:03 -0000 1.59
+++ focus.c 26 Mar 2004 21:21:46 -0000 1.60
@@ -183,23 +183,18 @@
void
FocusFix(void)
{
- EWin **lst, *ewin;
+ EWin *const *lst, *ewin;
int i, num;
EDBUG(5, "FocusFix");
- num = 0;
- lst = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
- if (lst == NULL)
- EDBUG_RETURN_;
-
+ lst = EwinListGet(&num);
for (i = 0; i < num; i++)
{
ewin = lst[i];
XUngrabButton(disp, AnyButton, AnyModifier, ewin->win_container);
FocusEwinSetGrabs(ewin);
}
- Efree(lst);
EDBUG_RETURN_;
}
@@ -329,7 +324,7 @@
void
FocusNewDeskBegin(void)
{
- EWin *ewin, **lst;
+ EWin *const *lst, *ewin;
int i, j, num;
if (new_desk_focus_nesting++)
@@ -340,51 +335,47 @@
/* we are about to flip desktops or areas - disable enter and leave events
* temporarily */
- lst = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
- if (lst)
+ lst = EwinListGet(&num);
+ for (i = 0; i < num; i++)
{
- for (i = 0; i < num; i++)
- {
- ewin = lst[i];
+ ewin = lst[i];
- XSelectInput(disp, ewin->win,
- FocusChangeMask | SubstructureNotifyMask |
- SubstructureRedirectMask | PropertyChangeMask |
- ResizeRedirectMask);
+ XSelectInput(disp, ewin->win,
+ FocusChangeMask | SubstructureNotifyMask |
+ SubstructureRedirectMask | PropertyChangeMask |
+ ResizeRedirectMask);
- if (ewin->pager)
- {
+ if (ewin->pager)
+ {
#if 0 /* ??? */
- XSelectInput(disp, ewin->client.win,
- PropertyChangeMask | FocusChangeMask |
- ResizeRedirectMask | StructureNotifyMask |
- ColormapChangeMask | ButtonPressMask |
- ButtonReleaseMask | PointerMotionMask);
+ XSelectInput(disp, ewin->client.win,
+ PropertyChangeMask | FocusChangeMask |
+ ResizeRedirectMask | StructureNotifyMask |
+ ColormapChangeMask | ButtonPressMask |
+ ButtonReleaseMask | PointerMotionMask);
#endif
- }
- else if (ewin->dialog)
- XSelectInput(disp, ewin->client.win,
- PropertyChangeMask | FocusChangeMask |
- ResizeRedirectMask | StructureNotifyMask |
- ColormapChangeMask | ExposureMask | KeyPressMask);
+ }
+ else if (ewin->dialog)
+ XSelectInput(disp, ewin->client.win,
+ PropertyChangeMask | FocusChangeMask |
+ ResizeRedirectMask | StructureNotifyMask |
+ ColormapChangeMask | ExposureMask | KeyPressMask);
+ else
+ XSelectInput(disp, ewin->client.win,
+ PropertyChangeMask | FocusChangeMask |
+ ResizeRedirectMask | StructureNotifyMask |
+ ColormapChangeMask);
+
+ for (j = 0; j < ewin->border->num_winparts; j++)
+ {
+ if (ewin->border->part[j].flags & FLAG_TITLE)
+ XSelectInput(disp, ewin->bits[j].win,
+ ExposureMask | ButtonPressMask |
+ ButtonReleaseMask);
else
- XSelectInput(disp, ewin->client.win,
- PropertyChangeMask | FocusChangeMask |
- ResizeRedirectMask | StructureNotifyMask |
- ColormapChangeMask);
-
- for (j = 0; j < ewin->border->num_winparts; j++)
- {
- if (ewin->border->part[j].flags & FLAG_TITLE)
- XSelectInput(disp, ewin->bits[j].win,
- ExposureMask | ButtonPressMask |
- ButtonReleaseMask);
- else
- XSelectInput(disp, ewin->bits[j].win,
- ButtonPressMask | ButtonReleaseMask);
- }
+ XSelectInput(disp, ewin->bits[j].win,
+ ButtonPressMask | ButtonReleaseMask);
}
- Efree(lst);
}
for (i = 0; i < ENLIGHTENMENT_CONF_NUM_DESKTOPS; i++)
@@ -396,7 +387,7 @@
void
FocusNewDesk(void)
{
- EWin *ewin, **lst;
+ EWin *const *lst, *ewin;
int i, j, num;
EDBUG(4, "FocusNewDesk");
@@ -405,60 +396,56 @@
return;
/* we flipped - re-enable enter and leave events */
- lst = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
- if (lst)
+ lst = EwinListGet(&num);
+ for (i = 0; i < num; i++)
{
- for (i = 0; i < num; i++)
- {
- ewin = lst[i];
+ ewin = lst[i];
- XSelectInput(disp, ewin->win,
- FocusChangeMask | SubstructureNotifyMask |
- SubstructureRedirectMask | EnterWindowMask |
- LeaveWindowMask | PointerMotionMask |
- PropertyChangeMask | ResizeRedirectMask |
- ButtonPressMask | ButtonReleaseMask);
-
- if (ewin->pager)
- XSelectInput(disp, ewin->client.win,
- PropertyChangeMask | EnterWindowMask |
- LeaveWindowMask | FocusChangeMask |
- ResizeRedirectMask | StructureNotifyMask |
- ColormapChangeMask | ButtonPressMask |
- ButtonReleaseMask | PointerMotionMask);
- else if (ewin->dialog)
- XSelectInput(disp, ewin->client.win,
- PropertyChangeMask | EnterWindowMask |
- LeaveWindowMask | FocusChangeMask |
- ResizeRedirectMask | StructureNotifyMask |
- ColormapChangeMask | ExposureMask | KeyPressMask);
- else
- XSelectInput(disp, ewin->client.win,
- PropertyChangeMask | EnterWindowMask |
- LeaveWindowMask | FocusChangeMask |
- ResizeRedirectMask | StructureNotifyMask |
- ColormapChangeMask);
-
- for (j = 0; j < ewin->border->num_winparts; j++)
- {
- if (ewin->border->part[j].flags & FLAG_TITLE)
- XSelectInput(disp, ewin->bits[j].win,
- ExposureMask | KeyPressMask | KeyReleaseMask |
- ButtonPressMask | ButtonReleaseMask |
- EnterWindowMask | LeaveWindowMask |
- PointerMotionMask);
- else
- XSelectInput(disp, ewin->bits[j].win,
- KeyPressMask | KeyReleaseMask |
- ButtonPressMask | ButtonReleaseMask |
- EnterWindowMask | LeaveWindowMask |
- PointerMotionMask);
- }
+ XSelectInput(disp, ewin->win,
+ FocusChangeMask | SubstructureNotifyMask |
+ SubstructureRedirectMask | EnterWindowMask |
+ LeaveWindowMask | PointerMotionMask |
+ PropertyChangeMask | ResizeRedirectMask |
+ ButtonPressMask | ButtonReleaseMask);
+
+ if (ewin->pager)
+ XSelectInput(disp, ewin->client.win,
+ PropertyChangeMask | EnterWindowMask |
+ LeaveWindowMask | FocusChangeMask |
+ ResizeRedirectMask | StructureNotifyMask |
+ ColormapChangeMask | ButtonPressMask |
+ ButtonReleaseMask | PointerMotionMask);
+ else if (ewin->dialog)
+ XSelectInput(disp, ewin->client.win,
+ PropertyChangeMask | EnterWindowMask |
+ LeaveWindowMask | FocusChangeMask |
+ ResizeRedirectMask | StructureNotifyMask |
+ ColormapChangeMask | ExposureMask | KeyPressMask);
+ else
+ XSelectInput(disp, ewin->client.win,
+ PropertyChangeMask | EnterWindowMask |
+ LeaveWindowMask | FocusChangeMask |
+ ResizeRedirectMask | StructureNotifyMask |
+ ColormapChangeMask);
- if (Mode.mode == MODE_DESKSWITCH && ewin->sticky && ewin->visible)
- EwinRefresh(ewin);
+ for (j = 0; j < ewin->border->num_winparts; j++)
+ {
+ if (ewin->border->part[j].flags & FLAG_TITLE)
+ XSelectInput(disp, ewin->bits[j].win,
+ ExposureMask | KeyPressMask | KeyReleaseMask |
+ ButtonPressMask | ButtonReleaseMask |
+ EnterWindowMask | LeaveWindowMask |
+ PointerMotionMask);
+ else
+ XSelectInput(disp, ewin->bits[j].win,
+ KeyPressMask | KeyReleaseMask |
+ ButtonPressMask | ButtonReleaseMask |
+ EnterWindowMask | LeaveWindowMask |
+ PointerMotionMask);
}
- Efree(lst);
+
+ if (Mode.mode == MODE_DESKSWITCH && ewin->sticky && ewin->visible)
+ EwinRefresh(ewin);
}
for (i = 0; i < ENLIGHTENMENT_CONF_NUM_DESKTOPS; i++)
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/icccm.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -3 -r1.55 -r1.56
--- icccm.c 20 Mar 2004 15:58:44 -0000 1.55
+++ icccm.c 26 Mar 2004 21:21:46 -0000 1.56
@@ -769,23 +769,20 @@
}
else if (XGetCommand(disp, ewin->client.group, &cargv, &cargc))
{
- EWin **lst;
+ EWin *const *lst;
int lnum, ok = 1;
- lst = (EWin **) ListItemType(&lnum, LIST_TYPE_EWIN);
- if (lst)
+ lst = EwinListGet(&lnum);
+ for (i = 0; i < lnum; i++)
{
- for (i = 0; i < lnum; i++)
+ if ((lst[i] != ewin)
+ && (lst[i]->client.group == ewin->client.group))
{
- if ((lst[i] != ewin)
- && (lst[i]->client.group == ewin->client.group))
- {
- ok = 0;
- i = lnum;
- }
+ ok = 0;
+ i = lnum;
}
- Efree(lst);
}
+
if (cargc > 0)
{
if (ok)
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/iconify.c,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -3 -r1.96 -r1.97
--- iconify.c 21 Mar 2004 01:39:40 -0000 1.96
+++ iconify.c 26 Mar 2004 21:21:46 -0000 1.97
@@ -2255,7 +2255,7 @@
void
IB_Setup(void)
{
- EWin **lst;
+ EWin *const *lst;
int i, num;
Iconbox **ibl;
@@ -2267,15 +2267,11 @@
IconboxShow(ibl[i]);
Efree(ibl);
}
- lst = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
- if (lst)
+ lst = EwinListGet(&num);
+ for (i = 0; i < num; i++)
{
- for (i = 0; i < num; i++)
- {
- if (lst[i]->client.start_iconified)
- IconifyEwin(lst[i]);
- }
- Efree(lst);
+ if (lst[i]->client.start_iconified)
+ IconifyEwin(lst[i]);
}
}
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ipc.c,v
retrieving revision 1.145
retrieving revision 1.146
diff -u -3 -r1.145 -r1.146
--- ipc.c 21 Mar 2004 01:39:40 -0000 1.145
+++ ipc.c 26 Mar 2004 21:21:46 -0000 1.146
@@ -2584,10 +2584,10 @@
if (params)
{
- EWin **lst;
+ EWin *const *lst;
int num, i;
- lst = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
+ lst = EwinListGet(&num);
if (!strcmp(params, "pagers"))
{
for (i = 0; i < num; i++)
@@ -2641,9 +2641,6 @@
Esnprintf(buf, sizeof(buf),
"Error: unknown internal list specified");
}
-
- if (lst)
- Efree(lst);
}
if (buf[0])
CommsSend(c, buf);
@@ -3469,11 +3466,11 @@
{
char *ret = NULL;
char buf[FILEPATH_LEN_MAX];
- EWin **lst, *e;
+ EWin *const *lst, *e;
int num, i;
char none[] = "-NONE-";
- lst = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
+ lst = EwinListGet(&num);
if (lst)
{
for (i = 0; i < num; i++)
@@ -3515,9 +3512,6 @@
{
CommsSend(c, "");
}
- if (lst)
- Efree(lst);
-
}
static void
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/menus.c,v
retrieving revision 1.114
retrieving revision 1.115
diff -u -3 -r1.114 -r1.115
--- menus.c 21 Mar 2004 01:39:40 -0000 1.114
+++ menus.c 26 Mar 2004 21:21:47 -0000 1.115
@@ -88,21 +88,17 @@
FindEwinSpawningMenu(Menu * m)
{
EWin *ewin = NULL;
- EWin **ewins;
+ EWin *const *ewins;
int i, num;
EDBUG(6, "FindEwinSpawningMenu");
- ewins = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
+ ewins = EwinListGet(&num);
for (i = 0; i < num; i++)
{
- if (ewins[i]->shownmenu != m->win)
- continue;
- ewin = ewins[i];
- break;
+ if (ewins[i]->shownmenu == m->win)
+ return ewins[i];
}
- if (ewins)
- Efree(ewins);
EDBUG_RETURN(ewin);
}
@@ -1762,7 +1758,7 @@
MenuCreateFromAllEWins(const char *name, MenuStyle * ms)
{
Menu *m;
- EWin **lst;
+ EWin *const *lst;
int i, num;
char s[256];
@@ -1772,22 +1768,19 @@
m = MenuCreate(name);
m->style = ms;
- lst = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
- if (lst)
+ lst = EwinListGet(&num);
+ for (i = 0; i < num; i++)
{
- for (i = 0; i < num; i++)
+ if ((!lst[i]->menu) && (!lst[i]->pager) && (!lst[i]->skipwinlist)
+ && (EwinGetTitle(lst[i])) && (!lst[i]->ibox))
{
- if ((!lst[i]->menu) && (!lst[i]->pager) && (!lst[i]->skipwinlist)
- && (EwinGetTitle(lst[i])) && (!lst[i]->ibox))
- {
- Esnprintf(s, sizeof(s), "%i", (int)(lst[i]->client.win));
- mi = MenuItemCreate(EwinGetTitle(lst[i]), NULL,
- ACTION_FOCUS_SET, s, NULL);
- MenuAddItem(m, mi);
- }
+ Esnprintf(s, sizeof(s), "%i", (int)(lst[i]->client.win));
+ mi = MenuItemCreate(EwinGetTitle(lst[i]), NULL,
+ ACTION_FOCUS_SET, s, NULL);
+ MenuAddItem(m, mi);
}
- Efree(lst);
}
+
EDBUG_RETURN(m);
}
@@ -1796,7 +1789,7 @@
MenuCreateFromDesktopEWins(char *name, MenuStyle * ms, int desk)
{
Menu *m;
- EWin **lst;
+ EWin *const *lst;
int i, num;
char s[256];
@@ -1806,24 +1799,21 @@
m = MenuCreate(name);
m->style = ms;
- lst = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
- if (lst)
+ lst = EwinListGet(&num);
+ for (i = 0; i < num; i++)
{
- for (i = 0; i < num; i++)
- {
- if (((lst[i]->desktop == desk) || (lst[i]->sticky))
- && (!lst[i]->menu) && (!lst[i]->pager)
- && (!lst[i]->skipwinlist) && (lst[i]->client.title)
- && (!lst[i]->ibox))
- {
- Esnprintf(s, sizeof(s), "%i", (int)(lst[i]->client.win));
- mi = MenuItemCreate(lst[i]->client.title, NULL,
- ACTION_FOCUS_SET, s, NULL);
- MenuAddItem(m, mi);
- }
+ if (((lst[i]->desktop == desk) || (lst[i]->sticky))
+ && (!lst[i]->menu) && (!lst[i]->pager)
+ && (!lst[i]->skipwinlist) && (lst[i]->client.title)
+ && (!lst[i]->ibox))
+ {
+ Esnprintf(s, sizeof(s), "%i", (int)(lst[i]->client.win));
+ mi = MenuItemCreate(lst[i]->client.title, NULL,
+ ACTION_FOCUS_SET, s, NULL);
+ MenuAddItem(m, mi);
}
- Efree(lst);
}
+
EDBUG_RETURN(m);
desk = 0;
}
@@ -1833,16 +1823,16 @@
MenuCreateFromDesktops(const char *name, MenuStyle * ms)
{
Menu *m, *mm;
- EWin **lst;
+ EWin *const *lst;
int j, i, num;
char s[256];
-
MenuItem *mi;
EDBUG(5, "MenuCreateFromDesktops");
+
m = MenuCreate(name);
m->style = ms;
- lst = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
+ lst = EwinListGet(&num);
for (j = 0; j < Conf.desks.num; j++)
{
mm = MenuCreate("__SUBMENUDESK_E");
@@ -1868,8 +1858,7 @@
mi = MenuItemCreate(s, NULL, 0, NULL, mm);
MenuAddItem(m, mi);
}
- if (lst)
- Efree(lst);
+
EDBUG_RETURN(m);
}
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/pager.c,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -3 -r1.78 -r1.79
--- pager.c 21 Mar 2004 01:39:40 -0000 1.78
+++ pager.c 26 Mar 2004 21:21:47 -0000 1.79
@@ -105,11 +105,12 @@
if (p->update_phase >= p->h)
{
int i, num;
- EWin **lst;
+ EWin *const *lst;
lst = EwinListGetForDesktop(p->desktop, &num);
for (i = 0; i < num; i++)
PagerEwinUpdateFromPager(p, lst[i]);
+
p->update_phase = 0;
}
return;
@@ -228,7 +229,7 @@
int ax, ay, cx, cy;
char pq;
ImageClass *ic;
- EWin **lst;
+ EWin *const *lst;
int i, num;
if (!Conf.pagers.enable || !p)
@@ -587,7 +588,7 @@
int x, y, ax, ay, cx, cy;
GC gc;
XGCValues gcv;
- EWin **lst;
+ EWin *const *lst;
int i, num;
if (!Conf.pagers.enable || Mode.mode == MODE_DESKSWITCH)
@@ -756,7 +757,7 @@
PagerForceUpdate(Pager * p)
{
int ww, hh, xx, yy, ax, ay, cx, cy;
- EWin **lst;
+ EWin *const *lst;
int i, num;
if (!Conf.pagers.enable || Mode.mode == MODE_DESKSWITCH)
@@ -879,7 +880,7 @@
EwinInPagerAt(Pager * p, int x, int y)
{
int wx, wy, ww, wh, ax, ay, cx, cy;
- EWin **lst;
+ EWin *const *lst;
int i, num;
if (!Conf.pagers.enable)
@@ -1486,20 +1487,16 @@
PagerSetHiQ(char onoff)
{
Pager **pl;
- EWin **lst;
+ EWin *const *lst;
int i, num;
HIQ = onoff;
- lst = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
- if (lst)
+ lst = EwinListGet(&num);
+ for (i = 0; i < num; i++)
{
- for (i = 0; i < num; i++)
- {
- lst[i]->mini_w = 0;
- lst[i]->mini_h = 0;
- }
- Efree(lst);
+ lst[i]->mini_w = 0;
+ lst[i]->mini_h = 0;
}
pl = (Pager **) ListItemType(&num, LIST_TYPE_PAGER);
@@ -1519,22 +1516,19 @@
PagerSetSnap(char onoff)
{
Pager **pl;
- EWin **lst;
+ EWin *const *lst;
int i, num;
char s[256];
Conf.pagers.snap = onoff;
- lst = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
- if (lst)
+ lst = EwinListGet(&num);
+ for (i = 0; i < num; i++)
{
- for (i = 0; i < num; i++)
- {
- lst[i]->mini_w = 0;
- lst[i]->mini_h = 0;
- }
- Efree(lst);
+ lst[i]->mini_w = 0;
+ lst[i]->mini_h = 0;
}
+
pl = (Pager **) ListItemType(&num, LIST_TYPE_PAGER);
if (pl)
{
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/session.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -3 -r1.61 -r1.62
--- session.c 21 Mar 2004 01:41:00 -0000 1.61
+++ session.c 26 Mar 2004 21:21:47 -0000 1.62
@@ -207,12 +207,12 @@
static void
SaveWindowStates(void)
{
- EWin **lst, *ewin;
+ EWin *const *lst, *ewin;
int i, num, x, y;
FILE *f;
char s[4096], ss[4096];
- lst = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
+ lst = EwinListGet(&num);
if (lst)
{
Etmp(s);
@@ -262,7 +262,6 @@
"to write to your filing system "
"or other similar problems.\n"));
}
- Efree(lst);
}
}
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/settings.c,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -3 -r1.102 -r1.103
--- settings.c 20 Mar 2004 15:58:46 -0000 1.102
+++ settings.c 26 Mar 2004 21:21:47 -0000 1.103
@@ -4631,7 +4631,7 @@
{
Dialog *d;
DItem *table, *di;
- EWin **lst, *ewin;
+ EWin *const *lst, *ewin;
int i, ri, num;
/* init remember window */
@@ -4672,7 +4672,7 @@
/* there's a much more efficient way of doing this, but this will work
* for now */
- lst = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
+ lst = EwinListGet(&num);
rd_ewin_list = Emalloc(sizeof(RememberWinList *) * (num + 1));
ri = 0;
if ((lst) && (num > 0))
@@ -4723,8 +4723,6 @@
}
}
}
- if (lst)
- Efree(lst);
rd_ewin_list[ri] = 0;
/* finish remember window */
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/size.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -3 -r1.33 -r1.34
--- size.c 21 Mar 2004 01:39:40 -0000 1.33
+++ size.c 26 Mar 2004 21:21:47 -0000 1.34
@@ -35,7 +35,7 @@
MaxSizeHV(EWin * ewin, const char *resize_type, int direction)
{
int x, y, w, h, x1, x2, y1, y2, type;
- EWin **lst, *pe;
+ EWin *const *lst, *pe;
int i, num;
if (!ewin)
@@ -102,7 +102,7 @@
}
else
{
- lst = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
+ lst = EwinListGet(&num);
}
if (direction & MAX_VER)
@@ -155,8 +155,6 @@
ewin->border->border.right);
}
- if (lst)
- Efree(lst);
break;
}
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/stacking.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- stacking.c 22 Mar 2004 16:36:03 -0000 1.4
+++ stacking.c 26 Mar 2004 21:21:47 -0000 1.5
@@ -181,14 +181,14 @@
EWinList EwinListFocus = { "Focus", 0, 0, NULL };
EWinList EwinListStack = { "Stack", 0, 0, NULL };
-EWin **
+EWin *const *
EwinListGetStacking(int *num)
{
*num = EwinListStack.nwins;
return EwinListStack.list;
}
-EWin **
+EWin *const *
EwinListGetForDesktop(int desk, int *num)
{
static EWin **lst = NULL;
@@ -200,7 +200,7 @@
nwins = EwinListStack.nwins;
if (nalloc < nwins)
{
- nalloc = nwins;
+ nalloc += 16;
lst = Erealloc(lst, nalloc * sizeof(EWin *));
}
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs