Enlightenment CVS committal
Author : kwo
Project : e16
Module : e
Dir : e16/e/src
Modified Files:
ecompmgr.c
Log Message:
Cleanups.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ecompmgr.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -3 -r1.60 -r1.61
--- ecompmgr.c 17 Sep 2005 14:22:05 -0000 1.60
+++ ecompmgr.c 17 Sep 2005 15:39:05 -0000 1.61
@@ -228,6 +228,17 @@
return rgn;
}
+static XserverRegion
+ERegionClone(XserverRegion src)
+{
+ XserverRegion rgn;
+
+ rgn = XFixesCreateRegion(disp, NULL, 0);
+ XFixesCopyRegion(disp, rgn, src);
+
+ return rgn;
+}
+
static void
ERegionLimit(XserverRegion rgn)
{
@@ -241,6 +252,37 @@
}
static void
+ERegionSubtractOffset(XserverRegion dst, int dx, int dy, XserverRegion src)
+{
+ Display *dpy = disp;
+ XserverRegion reg;
+
+ reg = src;
+ if (dx != 0 || dy != 0)
+ {
+ reg = ERegionClone(src);
+ XFixesTranslateRegion(dpy, reg, dx, dy);
+ }
+ XFixesSubtractRegion(dpy, dst, dst, reg);
+ if (reg != src)
+ XFixesDestroyRegion(dpy, reg);
+}
+
+#if 0 /* Unused (for debug) */
+static int
+ERegionIsEmpty(XserverRegion rgn)
+{
+ int nr;
+ XRectangle *pr;
+
+ pr = XFixesFetchRegion(disp, rgn, &nr);
+ if (pr)
+ XFree(pr);
+ return nr == 0;
+}
+#endif
+
+static void
ERegionShow(const char *txt, XserverRegion rgn)
{
int i, nr;
@@ -471,8 +513,7 @@
}
else if (!destroy)
{
- allDamage = XFixesCreateRegion(disp, 0, 0);
- XFixesCopyRegion(disp, allDamage, damage);
+ allDamage = ERegionClone(damage);
}
else
{
@@ -500,13 +541,7 @@
if (EoGetX(dsk) != 0 || EoGetY(dsk) != 0)
{
if (!destroy)
- {
- XserverRegion region;
-
- region = XFixesCreateRegion(disp, 0, 0);
- XFixesCopyRegion(disp, region, damage);
- damage = region;
- }
+ damage = ERegionClone(damage);
XFixesTranslateRegion(disp, damage, EoGetX(dsk), EoGetY(dsk));
}
}
@@ -1204,9 +1239,6 @@
cw->picture = None;
cw->pixmap = None;
-#if 0 /* FIXME - Remove? */
- ECompMgrWinSetPicts(eo);
-#endif
cw->alphaPict = None;
cw->borderSize = None;
@@ -1221,11 +1253,6 @@
cw->shadow_height = 0;
#endif
-#if 0 /* FIXME - Do we need this? */
- if (Conf_compmgr.mode == ECM_MODE_WINDOW)
- ESelectInputAdd(eo->win, StructureNotifyMask);
-#endif
-
cw->opacity = 0xdeadbeef;
ECompMgrWinSetOpacity(eo, eo->opacity);
@@ -1435,8 +1462,7 @@
{
XserverRegion o;
- o = XFixesCreateRegion(dpy, 0, 0);
- XFixesCopyRegion(dpy, o, parts);
+ o = ERegionClone(parts);
XFixesTranslateRegion(dpy, o, cw->shadow_dx, cw->shadow_dy);
XFixesUnionRegion(dpy, parts, parts, o);
XFixesDestroyRegion(dpy, o);
@@ -1546,24 +1572,6 @@
}
static void
-ERegionSubtractOffset(XserverRegion dst, int dx, int dy, XserverRegion src)
-{
- Display *dpy = disp;
- XserverRegion reg;
-
- reg = src;
- if (dx != 0 || dy != 0)
- {
- reg = XFixesCreateRegion(dpy, 0, 0);
- XFixesCopyRegion(dpy, reg, src);
- XFixesTranslateRegion(dpy, reg, dx, dy);
- }
- XFixesSubtractRegion(dpy, dst, dst, reg);
- if (reg != src)
- XFixesDestroyRegion(dpy, reg);
-}
-
-static void
ECompMgrRepaintObj(Picture pbuf, XserverRegion region, EObj * eo, int mode)
{
Display *dpy = disp;
@@ -1598,8 +1606,7 @@
{
/* Painting opaque windows top down, updating clip regions. */
- cw->clip = XFixesCreateRegion(dpy, 0, 0);
- XFixesCopyRegion(dpy, cw->clip, region);
+ cw->clip = ERegionClone(region);
switch (cw->mode)
{
@@ -1689,8 +1696,7 @@
if (!Mode_compmgr.active || allDamage == None)
return;
- region = XFixesCreateRegion(disp, 0, 0);
- XFixesCopyRegion(disp, region, allDamage);
+ region = ERegionClone(allDamage);
D2printf("ECompMgrRepaint rootBuffer=%#lx rootPicture=%#lx\n",
rootBuffer, rootPicture);
@@ -1906,13 +1912,6 @@
}
allDamage = None;
- if (Conf_compmgr.mode != ECM_MODE_AUTO)
- {
-#if 0 /* FIXME - Remove? */
- ECompMgrDamageAll();
- ECompMgrRepaint();
-#endif
- }
EventCallbackRegister(VRoot.win, 0, ECompMgrHandleRootEvent, NULL);
@@ -2127,7 +2126,6 @@
if (eo && eo->type == EOBJ_TYPE_EXT && eo->cmhook)
{
eo->shown = 1;
- eo->fade = 1;
EobjListStackRaise(eo);
ECompMgrWinMap(eo);
}
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs