Enlightenment CVS committal Author : kwo Project : e16 Module : e
Dir : e16/e/src Modified Files: ecompmgr.c eobj.h Log Message: The beginnings of fading (OR fade-in for now). =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/ecompmgr.c,v retrieving revision 1.54 retrieving revision 1.55 diff -u -3 -r1.54 -r1.55 --- ecompmgr.c 4 Sep 2005 07:33:32 -0000 1.54 +++ ecompmgr.c 4 Sep 2005 21:17:31 -0000 1.55 @@ -130,7 +130,13 @@ int shadow_radius; struct { - char mode; + int enable; + int dt_us; /* us between updates */ + unsigned int step; + } fading; + struct + { + int mode; int opacity; } override_redirect; } Conf_compmgr; @@ -974,6 +980,62 @@ cw->mode = mode; } +static void +doECompMgrWinFade(int val, void *data) +{ + EObj *eo = data; + ECmWinInfo *cw; + unsigned int op = (unsigned int)val; + + /* May be gone */ + if (!EobjListStackFind(eo->win)) + return; + + cw = eo->cmhook; + if (cw->opacity == op) + return; + + if (op > cw->opacity) + { + if (op - cw->opacity > Conf_compmgr.fading.step) + { + DoIn("Fade", 1e-6 * Conf_compmgr.fading.dt_us, doECompMgrWinFade, + op, eo); + op = cw->opacity + Conf_compmgr.fading.step; + } + } + else + { + if (cw->opacity - op > Conf_compmgr.fading.step) + { + DoIn("Fade", 1e-6 * Conf_compmgr.fading.dt_us, doECompMgrWinFade, + op, eo); + op = cw->opacity - Conf_compmgr.fading.step; + } + } + +#if 0 + Eprintf("doECompMgrWinFade %#x\n", op); +#endif + ECompMgrWinChangeOpacity(eo, op); +} + +static void +ECompMgrWinFadeIn(EObj * eo) +{ + DoIn("Fade", 1e-6 * Conf_compmgr.fading.dt_us, doECompMgrWinFade, + eo->opacity, eo); + ECompMgrWinChangeOpacity(eo, 0x10000000); +} + +static void +ECompMgrWinFadeOut(EObj * eo) +{ + DoIn("Fade", 1e-6 * Conf_compmgr.fading.dt_us, doECompMgrWinFade, + 0x10000000, eo); + ECompMgrWinChangeOpacity(eo, eo->opacity); +} + void ECompMgrWinMap(EObj * eo) { @@ -994,6 +1056,8 @@ ECompMgrDamageMergeObject(eo, cw->extents, 0); ECompMgrWinSetPicts(eo); + if (Conf_compmgr.fading.enable && eo->fade) + ECompMgrWinFadeIn(eo); } void @@ -1006,7 +1070,10 @@ if (cw->extents != None) ECompMgrDamageMergeObject(eo, cw->extents, 0); - ECompMgrWinInvalidate(eo, INV_PIXMAP); + if (Conf_compmgr.fading.enable && eo->fade) + ECompMgrWinFadeOut(eo); + else + ECompMgrWinInvalidate(eo, INV_PIXMAP); } static void @@ -2018,6 +2085,8 @@ if (eo && eo->type == EOBJ_TYPE_EXT && eo->cmhook) { eo->shown = 1; + eo->fade = 1; + EobjListStackRaise(eo); ECompMgrWinMap(eo); } break; @@ -2184,7 +2253,10 @@ CFG_ITEM_INT(Conf_compmgr, shadow_radius, 12), CFG_ITEM_BOOL(Conf_compmgr, resize_fix_enable, 0), CFG_ITEM_BOOL(Conf_compmgr, use_name_pixmap, 0), - CFG_ITEM_BOOL(Conf_compmgr, override_redirect.mode, 1), + CFG_ITEM_BOOL(Conf_compmgr, fading.enable, 0), + CFG_ITEM_INT(Conf_compmgr, fading.dt_us, 10000), + CFG_ITEM_INT(Conf_compmgr, fading.step, 0x10000000), + CFG_ITEM_INT(Conf_compmgr, override_redirect.mode, 1), CFG_ITEM_INT(Conf_compmgr, override_redirect.opacity, 240), }; #define N_CFG_ITEMS (sizeof(CompMgrCfgItems)/sizeof(CfgItem)) =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/eobj.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- eobj.h 4 Sep 2005 07:27:18 -0000 1.7 +++ eobj.h 4 Sep 2005 21:17:32 -0000 1.8 @@ -42,8 +42,9 @@ char shown; char gone; #if USE_COMPOSITE - char shadow; /* Enable shadows */ - char noredir; /* Do not redirect */ + unsigned noredir:1; /* Do not redirect */ + unsigned shadow:1; /* Enable shadows */ + unsigned fade:1; unsigned int opacity; void *cmhook; #endif ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs