Enlightenment CVS committal Author : kwo Project : e16 Module : e
Dir : e16/e/src Modified Files: E.h dialog.c emodule.h ewin-ops.c ewins.c iclass.c iconify.c menus.c mod-trans.c Log Message: Pseudo-trans update fixes (Tres Melton). =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v retrieving revision 1.447 retrieving revision 1.448 diff -u -3 -r1.447 -r1.448 --- E.h 4 Jun 2005 08:33:51 -0000 1.447 +++ E.h 4 Jun 2005 23:57:58 -0000 1.448 @@ -1866,13 +1866,17 @@ /* iclass.c */ int ImageclassConfigLoad(FILE * fs); + +#ifdef ENABLE_THEME_TRANSPARENCY void TransparencySet(int transparency); int TransparencyEnabled(void); +int TransparencyUpdateNeeded(void); +int ImageclassIsTransparent(ImageClass * ic); +#endif ImageState *ImageclassGetImageState(ImageClass * ic, int state, int active, int sticky); ImageClass *ImageclassCreateSimple(const char *name, const char *image); ImageClass *ImageclassFind(const char *name, int fallback); -int ImageclassIsTransparent(ImageClass * ic); Imlib_Image *ImageclassGetImage(ImageClass * ic, int active, int sticky, int state); void ImageclassApply(ImageClass * ic, Window win, int w, int h, =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/dialog.c,v retrieving revision 1.116 retrieving revision 1.117 diff -u -3 -r1.116 -r1.117 --- dialog.c 28 May 2005 20:23:25 -0000 1.116 +++ dialog.c 4 Jun 2005 23:58:07 -0000 1.117 @@ -524,7 +524,7 @@ if (!d || Mode.mode != MODE_NONE) return; - if (TransparencyEnabled() || ImageclassIsTransparent(d->iclass)) + if (TransparencyUpdateNeeded() || ImageclassIsTransparent(d->iclass)) DialogRedraw(d); } =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/emodule.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- emodule.h 19 Mar 2005 16:40:01 -0000 1.4 +++ emodule.h 4 Jun 2005 23:58:07 -0000 1.5 @@ -71,6 +71,7 @@ ESIGNAL_EWIN_DEICONIFY, ESIGNAL_EWIN_CHANGE_ICON, ESIGNAL_EWIN_CHANGE, + ESIGNAL_THEME_TRANS_CHANGE, } e_signal_t; #if 0 /* Maybe later */ =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/ewin-ops.c,v retrieving revision 1.45 retrieving revision 1.46 diff -u -3 -r1.45 -r1.46 --- ewin-ops.c 29 May 2005 14:59:16 -0000 1.45 +++ ewin-ops.c 4 Jun 2005 23:58:07 -0000 1.46 @@ -473,7 +473,7 @@ if (Mode.mode == MODE_NONE) { - if (TransparencyEnabled()) + if (TransparencyUpdateNeeded()) EwinBorderDraw(ewin, resize, 1); /* Update the border */ SnapshotEwinUpdate(ewin, SNAP_USE_POS | SNAP_USE_SIZE); =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/ewins.c,v retrieving revision 1.71 retrieving revision 1.72 diff -u -3 -r1.71 -r1.72 --- ewins.c 2 Jun 2005 22:11:07 -0000 1.71 +++ ewins.c 4 Jun 2005 23:58:08 -0000 1.72 @@ -1905,6 +1905,10 @@ static void EwinsSighan(int sig, void *prm __UNUSED__) { + EWin *ewin; + EWin **ewin_lst; + int win_cnt, i; + switch (sig) { case ESIGNAL_INIT: @@ -1923,6 +1927,18 @@ case ESIGNAL_DESK_RESIZE: EwinsTouch(); break; + case ESIGNAL_THEME_TRANS_CHANGE: + case ESIGNAL_BACKGROUND_CHANGE: + /* FIXME - Only visible windows */ + /* FIXME - BG: Only affected desk */ + ewin_lst = (EWin **) EwinListStackGet(&win_cnt); + for (i = 0; i < win_cnt; i++) + { + ewin = ewin_lst[i]; + if (EwinIsMapped(ewin)) + ResizeEwin(ewin, ewin->client.w, ewin->client.h); + } + break; } } =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/iclass.c,v retrieving revision 1.64 retrieving revision 1.65 diff -u -3 -r1.64 -r1.65 --- iclass.c 14 May 2005 19:40:34 -0000 1.64 +++ iclass.c 4 Jun 2005 23:58:08 -0000 1.65 @@ -24,17 +24,28 @@ #include "E.h" #include "conf.h" +#ifdef ENABLE_THEME_TRANSPARENCY + +static Imlib_Color_Modifier *icm = NULL; +static DATA8 gray[256]; +static DATA8 alpha[256]; + +static int prev_alpha = -1; + int TransparencyEnabled(void) { return Conf.trans.alpha; } -#ifdef ENABLE_THEME_TRANSPARENCY - -static Imlib_Color_Modifier *icm = NULL; -static DATA8 gray[256]; -static DATA8 alpha[256]; +int +TransparencyUpdateNeeded(void) +{ + /* For this to work right prev_alpha needs set to zero on initialization */ + /* if transparency is disabled (by being set to zero). */ + /* FIXME - Check this. We call TransparencySet(Conf.trans.alpha) at startup */ + return Conf.trans.alpha || prev_alpha; +} static void TransparencyMakeColorModifier(void) @@ -69,14 +80,24 @@ else if (transparency > 255) transparency = 255; - changed = Conf.trans.alpha != transparency; - Conf.trans.alpha = transparency; - - /* Generate the color modifier tables */ - TransparencyMakeColorModifier(); - - if (changed) - DesksRefresh(); + /* This will render the initial startup stuff correctly since !changed */ + if (prev_alpha == -1) + { + prev_alpha = Conf.trans.alpha = transparency; + /* Generate the color modifier tables */ + TransparencyMakeColorModifier(); + ModulesSignal(ESIGNAL_THEME_TRANS_CHANGE, NULL); + } + else + { + changed = Conf.trans.alpha != transparency; + prev_alpha = Conf.trans.alpha; + Conf.trans.alpha = transparency; + /* Generate the color modifier tables */ + TransparencyMakeColorModifier(); + if (changed) + ModulesSignal(ESIGNAL_THEME_TRANS_CHANGE, NULL); + } } #else =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/iconify.c,v retrieving revision 1.155 retrieving revision 1.156 diff -u -3 -r1.155 -r1.156 --- iconify.c 28 May 2005 21:08:56 -0000 1.155 +++ iconify.c 4 Jun 2005 23:58:08 -0000 1.156 @@ -501,7 +501,7 @@ { Iconbox *ib = ewin->data; - if (!resize && !ib->do_update && !TransparencyEnabled()) + if (!resize && !ib->do_update && !TransparencyUpdateNeeded()) return; ib->w = ewin->client.w; =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/menus.c,v retrieving revision 1.198 retrieving revision 1.199 diff -u -3 -r1.198 -r1.199 --- menus.c 29 May 2005 14:59:17 -0000 1.198 +++ menus.c 4 Jun 2005 23:58:08 -0000 1.199 @@ -183,7 +183,7 @@ if (!m || Mode.mode != MODE_NONE) return; - if (TransparencyEnabled()) + if (TransparencyUpdateNeeded()) m->redraw = 1; if ((!m->style->use_item_bg && m->pmm.pmap == 0) || m->redraw) =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/mod-trans.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- mod-trans.c 19 Mar 2005 16:40:07 -0000 1.4 +++ mod-trans.c 4 Jun 2005 23:58:08 -0000 1.5 @@ -87,6 +87,9 @@ tmp_theme_transparency); DialogItemTextSetText(di, s); DialogDrawItems(tr_sel_dialog, di, 0, 0, 99999, 99999); + + /* FIXME - We may not want to do this unless things are speeded up */ + TransparencySet(tmp_theme_transparency); } static void ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput a projector? How fast can you ride your desk chair down the office luge track? If you want to score the big prize, get to know the little guy. Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs