Enlightenment CVS committal
Author : kwo
Project : e16
Module : e
Dir : e16/e/src
Modified Files:
E.h borders.c focus.c ipc.c menus.c slideout.c
Log Message:
Trivial code shuffle and namespace cleanup.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.281
retrieving revision 1.282
diff -u -3 -r1.281 -r1.282
--- E.h 6 Jun 2004 16:38:17 -0000 1.281
+++ E.h 7 Jun 2004 16:46:07 -0000 1.282
@@ -1765,11 +1765,9 @@
void HonorIclass(char *s, int id);
void EwinWithdraw(EWin * ewin);
void SyncBorderToEwin(EWin * ewin);
-void UpdateBorderInfo(EWin * ewin);
-void RealiseEwinWinpart(EWin * ewin, int i);
-void ChangeEwinWinpart(EWin * ewin, int i);
-void EwinBorderDraw(EWin * ewin, int do_shape, int queue_off);
-int ChangeEwinWinpartContents(EWin * ewin, int i);
+void BorderWinpartChange(EWin * ewin, int i);
+void EwinBorderUpdateInfo(EWin * ewin);
+void EwinBorderUpdateState(EWin * ewin);
void EwinEventDestroy(EWin * ewin);
void EwinEventMap(EWin * ewin);
void EwinEventUnmap(EWin * ewin);
@@ -1780,7 +1778,7 @@
const char *EwinGetTitle(const EWin * ewin);
const char *EwinGetIconName(const EWin * ewin);
int EwinIsOnScreen(EWin * ewin);
-int EwinWinpartIndex(EWin * ewin, Window win);
+int BorderWinpartIndex(EWin * ewin, Window win);
void EwinChange(EWin * ewin, unsigned int flag);
void EwinChangesStart(EWin * ewin);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/borders.c,v
retrieving revision 1.191
retrieving revision 1.192
diff -u -3 -r1.191 -r1.192
--- borders.c 6 Jun 2004 16:38:17 -0000 1.191
+++ borders.c 7 Jun 2004 16:46:07 -0000 1.192
@@ -49,6 +49,7 @@
static EWin *Adopt(Window win);
static EWin *AdoptInternal(Window win, Border * border, int type);
static void EwinEventsConfigure(EWin * ewin, int mode);
+static void EwinBorderDraw(EWin * ewin, int do_shape, int queue_off);
void
DetermineEwinFloat(EWin * ewin, int dx, int dy)
@@ -685,97 +686,135 @@
EDBUG_RETURN_;
}
+static int
+BorderWinpartChangeContents(EWin * ewin, int i)
+{
+ int ret = 0;
+ const char *title;
+
+ EDBUG(3, "BorderWinpartChangeContents");
+ ret = 1;
+ switch (ewin->border->part[i].flags)
+ {
+ case FLAG_TITLE:
+ title = EwinGetTitle(ewin);
+ if (title)
+ TclassApply(ewin->border->part[i].iclass, ewin->bits[i].win,
+ ewin->bits[i].w, ewin->bits[i].h, ewin->active,
+ ewin->sticky, ewin->bits[i].state, ewin->bits[i].expose,
+ ewin->border->part[i].tclass, title);
+ break;
+ case FLAG_MINIICON:
+ break;
+ default:
+ break;
+ }
+ EDBUG_RETURN(ret);
+}
+
void
-UpdateBorderInfo(EWin * ewin)
+EwinBorderUpdateInfo(EWin * ewin)
{
int i;
for (i = 0; i < ewin->border->num_winparts; i++)
{
if (ewin->border->part[i].flags == FLAG_TITLE)
- ChangeEwinWinpartContents(ewin, i);
+ BorderWinpartChangeContents(ewin, i);
}
}
void
-RealiseEwinWinpart(EWin * ewin, int i)
+EwinBorderUpdateState(EWin * ewin)
{
- EDBUG(4, "RealiseEwinWinpart");
+ EwinBorderDraw(ewin, 0, 0);
+}
- if ((ewin->bits[i].cx != ewin->bits[i].x)
- || (ewin->bits[i].cy != ewin->bits[i].y)
- || (ewin->bits[i].cw != ewin->bits[i].w)
- || (ewin->bits[i].ch != ewin->bits[i].h))
+static void
+BorderWinpartRealise(EWin * ewin, int i)
+{
+ EWinBit *ewb = &ewin->bits[i];
+
+ EDBUG(4, "BorderWinpartRealise");
+
+ if ((ewb->cx != ewb->x) || (ewb->cy != ewb->y) ||
+ (ewb->cw != ewb->w) || (ewb->ch != ewb->h))
{
- if ((ewin->bits[i].w < 0) || (ewin->bits[i].h < 0))
- EUnmapWindow(disp, ewin->bits[i].win);
+ if ((ewb->w < 0) || (ewb->h < 0))
+ {
+ EUnmapWindow(disp, ewb->win);
+ }
else
- EMapWindow(disp, ewin->bits[i].win);
- if ((ewin->bits[i].w > 0) && (ewin->bits[i].h > 0))
- EMoveResizeWindow(disp, ewin->bits[i].win, ewin->bits[i].x,
- ewin->bits[i].y, ewin->bits[i].w, ewin->bits[i].h);
+ {
+ EMapWindow(disp, ewb->win);
+ EMoveResizeWindow(disp, ewb->win, ewb->x, ewb->y, ewb->w, ewb->h);
+ }
}
EDBUG_RETURN_;
}
static void
-EwinWinpartITclassApply(EWin * ewin, int i)
+BorderWinpartITclassApply(EWin * ewin, int i)
{
+ EWinBit *ewb = &ewin->bits[i];
const char *title;
- IclassApply(ewin->border->part[i].iclass, ewin->bits[i].win,
- ewin->bits[i].w, ewin->bits[i].h, ewin->active,
- ewin->sticky, ewin->bits[i].state, ewin->bits[i].expose,
- ST_BORDER);
+ IclassApply(ewin->border->part[i].iclass, ewb->win,
+ ewb->w, ewb->h, ewin->active,
+ ewin->sticky, ewb->state, ewb->expose, ST_BORDER);
if (ewin->border->part[i].flags == FLAG_TITLE)
{
title = EwinGetTitle(ewin);
if (title)
- TclassApply(ewin->border->part[i].iclass, ewin->bits[i].win,
- ewin->bits[i].w, ewin->bits[i].h, ewin->active,
- ewin->sticky, ewin->bits[i].state, ewin->bits[i].expose,
+ TclassApply(ewin->border->part[i].iclass, ewb->win,
+ ewb->w, ewb->h, ewin->active,
+ ewin->sticky, ewb->state, ewb->expose,
ewin->border->part[i].tclass, title);
}
}
static int
-DrawEwinWinpart(EWin * ewin, int i)
+BorderWinpartDraw(EWin * ewin, int i)
{
+ EWinBit *ewb = &ewin->bits[i];
int move = 0, resize = 0, ret = 0;
- EDBUG(4, "DrawEwinWinpart");
- if ((ewin->bits[i].x != ewin->bits[i].cx) ||
- (ewin->bits[i].y != ewin->bits[i].cy))
- move = 1;
- if ((ewin->bits[i].w != ewin->bits[i].cw) ||
- (ewin->bits[i].h != ewin->bits[i].ch))
- resize = 1;
- if ((resize) || (ewin->bits[i].expose))
+ EDBUG(4, "BorderWinpartDraw");
+
+ if ((ewb->x != ewb->cx) || (ewb->y != ewb->cy))
{
- EwinWinpartITclassApply(ewin, i);
- ewin->bits[i].expose = 0;
+ move = 1;
+ ewb->cx = ewb->x;
+ ewb->cy = ewb->y;
ret = 1;
}
- if ((move) || (resize))
+
+ if ((ewb->w != ewb->cw) || (ewb->h != ewb->ch))
{
+ resize = 1;
+ ewb->cw = ewb->w;
+ ewb->ch = ewb->h;
+ }
+
+ if ((resize) || (ewb->expose))
+ {
+ BorderWinpartITclassApply(ewin, i);
+ ewb->expose = 0;
ret = 1;
- ewin->bits[i].cx = ewin->bits[i].x;
- ewin->bits[i].cy = ewin->bits[i].y;
- ewin->bits[i].cw = ewin->bits[i].w;
- ewin->bits[i].ch = ewin->bits[i].h;
}
+
EDBUG_RETURN(ret);
}
void
-ChangeEwinWinpart(EWin * ewin, int i)
+BorderWinpartChange(EWin * ewin, int i)
{
- EDBUG(3, "ChangeEwinWinpart");
+ EDBUG(3, "BorderWinpartChange");
- EwinWinpartITclassApply(ewin, i);
+ BorderWinpartITclassApply(ewin, i);
if (ewin->bits[i].win)
- ChangeEwinWinpartContents(ewin, i);
+ BorderWinpartChangeContents(ewin, i);
if (!ewin->shapedone || ewin->border->changes_shape)
PropagateShapes(ewin->win);
@@ -784,7 +823,7 @@
EDBUG_RETURN_;
}
-void
+static void
EwinBorderDraw(EWin * ewin, int do_shape, int queue_off)
{
int i, pq;
@@ -799,7 +838,7 @@
Mode.queue_up = 0;
for (i = 0; i < ewin->border->num_winparts; i++)
- EwinWinpartITclassApply(ewin, i);
+ BorderWinpartITclassApply(ewin, i);
if (do_shape || !ewin->shapedone || ewin->border->changes_shape)
PropagateShapes(ewin->win);
@@ -811,45 +850,19 @@
EDBUG_RETURN_;
}
-int
-ChangeEwinWinpartContents(EWin * ewin, int i)
-{
- int state = 0, ret = 0;
- const char *title;
-
- EDBUG(3, "ChangeEwinWinpartContents");
- ret = 1;
- switch (ewin->border->part[i].flags)
- {
- case FLAG_TITLE:
- title = EwinGetTitle(ewin);
- if (title)
- TclassApply(ewin->border->part[i].iclass, ewin->bits[i].win,
- ewin->bits[i].w, ewin->bits[i].h, ewin->active,
- ewin->sticky, state, ewin->bits[i].expose,
- ewin->border->part[i].tclass, title);
- break;
- case FLAG_MINIICON:
- break;
- default:
- break;
- }
- EDBUG_RETURN(ret);
-}
-
static void
-CalcEwinWinpart(EWin * ewin, int i)
+BorderWinpartCalc(EWin * ewin, int i)
{
int x, y, w, h, ox, oy, max, min;
int topleft, bottomright;
- EDBUG(4, "CalcEwinWinpart");
+ EDBUG(4, "BorderWinpartCalc");
topleft = ewin->border->part[i].geom.topleft.originbox;
bottomright = ewin->border->part[i].geom.bottomright.originbox;
if (topleft >= 0)
- CalcEwinWinpart(ewin, topleft);
+ BorderWinpartCalc(ewin, topleft);
if (bottomright >= 0)
- CalcEwinWinpart(ewin, bottomright);
+ BorderWinpartCalc(ewin, bottomright);
x = y = 0;
if (topleft == -1)
{
@@ -1032,14 +1045,14 @@
ewin->bits[i].w = -2;
for (i = 0; i < ewin->border->num_winparts; i++)
if (ewin->bits[i].w == -2)
- CalcEwinWinpart(ewin, i);
+ BorderWinpartCalc(ewin, i);
for (i = 0; i < ewin->border->num_winparts; i++)
- RealiseEwinWinpart(ewin, i);
+ BorderWinpartRealise(ewin, i);
reshape = 0;
for (i = 0; i < ewin->border->num_winparts; i++)
{
- reshape |= DrawEwinWinpart(ewin, i);
+ reshape |= BorderWinpartDraw(ewin, i);
ewin->bits[i].no_expose = 1;
}
@@ -1083,7 +1096,7 @@
&& (!ewin->bits[a->ewin_bit].win) && (id))
{
ewin->bits[a->ewin_bit].win = id;
- RealiseEwinWinpart(ewin, a->ewin_bit);
+ BorderWinpartRealise(ewin, a->ewin_bit);
EMapWindow(disp, id);
ewin->shapedone = 0;
if (!ewin->shapedone)
@@ -2279,7 +2292,7 @@
ewin->sticky = 0;
MoveEwinToDesktopAt(ewin, desks.current, ewin->x, ewin->y);
- EwinBorderDraw(ewin, 0, 0);
+ EwinBorderUpdateState(ewin);
HintsSetWindowState(ewin);
EDBUG_RETURN_;
@@ -2308,7 +2321,7 @@
MoveEwinToDesktopAt(ewin, desks.current, x, y);
ewin->sticky = 1;
- EwinBorderDraw(ewin, 0, 0);
+ EwinBorderUpdateState(ewin);
HintsSetWindowState(ewin);
EDBUG_RETURN_;
@@ -2334,7 +2347,7 @@
ewin->bits[i].w = -2;
for (i = 0; i < ewin->border->num_winparts; i++)
if (ewin->bits[i].w == -2)
- CalcEwinWinpart(ewin, i);
+ BorderWinpartCalc(ewin, i);
switch (ewin->border->shadedir)
{
@@ -2386,7 +2399,7 @@
ewin->bits[i].w = -2;
for (i = 0; i < ewin->border->num_winparts; i++)
if (ewin->bits[i].w == -2)
- CalcEwinWinpart(ewin, i);
+ BorderWinpartCalc(ewin, i);
min_w = 0;
min_h = 0;
@@ -3247,7 +3260,7 @@
}
int
-EwinWinpartIndex(EWin * ewin, Window win)
+BorderWinpartIndex(EWin * ewin, Window win)
{
int i;
@@ -3293,9 +3306,10 @@
if (EWinChanges.flags & EWIN_CHANGE_NAME)
{
- UpdateBorderInfo(ewin);
+ EwinBorderUpdateInfo(ewin);
CalcEwinSizes(ewin);
}
+
if (EWinChanges.flags & EWIN_CHANGE_DESKTOP)
{
int desk = ewin->desktop;
@@ -3306,6 +3320,7 @@
MoveEwinToDesktop(ewin, desk);
}
}
+
if (EWinChanges.flags & EWIN_CHANGE_ICON_PMAP)
{
if (ewin->iconified)
@@ -3408,7 +3423,7 @@
{
ewin->bits[j].no_expose = 0;
ewin->bits[j].expose = 1;
- if (DrawEwinWinpart(ewin, j) && IsPropagateEwinOnQueue(ewin))
+ if (BorderWinpartDraw(ewin, j) && IsPropagateEwinOnQueue(ewin))
PropagateShapes(ewin->win);
return;
ev = NULL;
@@ -3420,7 +3435,7 @@
GrabThePointer(ewin->bits[j].win);
ewin->bits[j].state = STATE_CLICKED;
- ChangeEwinWinpart(ewin, j);
+ BorderWinpartChange(ewin, j);
if (ewin->border->part[j].aclass)
EventAclass(ev, ewin, ewin->border->part[j].aclass);
@@ -3436,7 +3451,7 @@
else
ewin->bits[j].state = STATE_NORMAL;
ewin->bits[j].left = 0;
- ChangeEwinWinpart(ewin, j);
+ BorderWinpartChange(ewin, j);
win2 = WindowAtXY(ev->xbutton.x_root, ev->xbutton.y_root);
if (win2 == Mode.context_win && (ewin->border->part[j].aclass))
@@ -3451,7 +3466,7 @@
else
{
ewin->bits[j].state = STATE_HILITED;
- ChangeEwinWinpart(ewin, j);
+ BorderWinpartChange(ewin, j);
if (ewin->border->part[j].aclass)
EventAclass(ev, ewin, ewin->border->part[j].aclass);
}
@@ -3465,7 +3480,7 @@
else
{
ewin->bits[j].state = STATE_NORMAL;
- ChangeEwinWinpart(ewin, j);
+ BorderWinpartChange(ewin, j);
if (ewin->border->part[j].aclass)
EventAclass(ev, ewin, ewin->border->part[j].aclass);
}
@@ -3476,7 +3491,7 @@
{
ewin->bits[j].left = 0;
ewin->bits[j].state = STATE_NORMAL;
- ChangeEwinWinpart(ewin, j);
+ BorderWinpartChange(ewin, j);
return;
ev = NULL;
}
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/focus.c,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -3 -r1.71 -r1.72
--- focus.c 4 May 2004 19:04:28 -0000 1.71
+++ focus.c 7 Jun 2004 16:46:07 -0000 1.72
@@ -178,7 +178,7 @@
FocusEwinSetActive(EWin * ewin, int active)
{
ewin->active = active;
- EwinBorderDraw(ewin, 0, 0);
+ EwinBorderUpdateState(ewin);
FocusEwinSetGrabs(ewin);
}
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ipc.c,v
retrieving revision 1.161
retrieving revision 1.162
diff -u -3 -r1.161 -r1.162
--- ipc.c 6 Jun 2004 16:38:17 -0000 1.161
+++ ipc.c 7 Jun 2004 16:46:07 -0000 1.162
@@ -3230,7 +3230,7 @@
strcpy(ewin->icccm.wm_name, ptr);
XStoreName(disp, ewin->client.win, ewin->icccm.wm_name);
- EwinBorderDraw(ewin, 0, 0);
+ EwinBorderUpdateInfo(ewin);
}
}
else
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/menus.c,v
retrieving revision 1.136
retrieving revision 1.137
diff -u -3 -r1.136 -r1.137
--- menus.c 4 Jun 2004 19:23:46 -0000 1.136
+++ menus.c 7 Jun 2004 16:46:08 -0000 1.137
@@ -229,7 +229,7 @@
if (Mode.context_win == ewin99->bits[i99].win)
{
ewin99->bits[i99].state = STATE_NORMAL;
- ChangeEwinWinpart(ewin99, i99);
+ BorderWinpartChange(ewin99, i99);
i99 = ewin99->border->num_winparts;
}
}
@@ -386,7 +386,7 @@
if (Mode.context_win == ewin99->bits[i99].win)
{
ewin99->bits[i99].state = STATE_NORMAL;
- ChangeEwinWinpart(ewin99, i99);
+ BorderWinpartChange(ewin99, i99);
i99 = ewin99->border->num_winparts;
}
}
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/slideout.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -3 -r1.21 -r1.22
--- slideout.c 4 May 2004 19:04:41 -0000 1.21
+++ slideout.c 7 Jun 2004 16:46:08 -0000 1.22
@@ -180,7 +180,7 @@
/* If the slideout is associated with an ewin,
* put it on the same virtual desktop. */
dw = VRoot.win;
- if (ewin && EwinWinpartIndex(ewin, win) >= 0 &&
+ if (ewin && BorderWinpartIndex(ewin, win) >= 0 &&
!ewin->floating /* && !ewin->sticky */ )
{
int desk = EwinGetDesk(ewin);
-------------------------------------------------------
This SF.Net email is sponsored by: GNOME Foundation
Hackers Unite! GUADEC: The world's #1 Open Source Desktop Event.
GNOME Users and Developers European Conference, 28-30th June in Norway
http://2004/guadec.org
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs