Enlightenment CVS committal Author : kwo Project : e16 Module : e
Dir : e16/e/src Modified Files: dialog.c x.c xwin.h Log Message: Fix dialog updates when text is changed (properly this time). =================================================================== RCS file: /cvs/e/e16/e/src/dialog.c,v retrieving revision 1.147 retrieving revision 1.148 diff -u -3 -r1.147 -r1.148 --- dialog.c 16 Apr 2006 22:27:06 -0000 1.147 +++ dialog.c 17 Apr 2006 08:43:09 -0000 1.148 @@ -184,7 +184,8 @@ char *text; int num_buttons; Window win; - PmapMask pmm; + Pixmap pmap; + PmapMask pmm_bg; DButton **button; TextClass *tclass; ImageClass *iclass; @@ -302,7 +303,8 @@ if (d->keybindings) Efree(d->keybindings); - FreePmapMask(&(d->pmm)); + FreePmapMask(&(d->pmm_bg)); + EFreePixmap(d->pmap); EDestroyWindow(d->win); Efree(d); @@ -492,13 +494,21 @@ return; #if DEBUG_DIALOGS - Eprintf("DialogRedraw win=%#lx pmap=%#lx\n", d->win, d->pmm.pmap); + Eprintf("DialogRedraw win=%#lx pmap=%#lx\n", d->win, d->pmap); #endif - FreePmapMask(&(d->pmm)); + FreePmapMask(&(d->pmm_bg)); ImageclassApplyCopy(d->iclass, d->win, d->w, d->h, 0, 0, STATE_NORMAL, - &(d->pmm), 0, ST_DIALOG); - ESetWindowBackgroundPixmap(d->win, d->pmm.pmap); + &(d->pmm_bg), 0, ST_DIALOG); + if (d->pmm_bg.pmap == None) + return; + + if (d->pmap == None) + { + d->pmap = ECreatePixmap(d->win, d->w, d->h, VRoot.depth); + ESetWindowBackgroundPixmap(d->win, d->pmap); + } + ECopyArea(d->pmm_bg.pmap, d->pmap, 0, 0, d->w, d->h, 0, 0); d->redraw = 1; @@ -507,7 +517,7 @@ if (d->text) { - TextclassApply(d->iclass, d->pmm.pmap, d->w, d->h, 0, 0, STATE_NORMAL, + TextclassApply(d->iclass, d->pmap, d->w, d->h, 0, 0, STATE_NORMAL, d->tclass, d->text); } else if (d->item) @@ -1516,12 +1526,6 @@ d->update = 1; di->update = 1; -#if 1 /* FIXME - Gross hack to get text items redrawn when changed */ - /* ...either keep full bg image/pixmap around or render text to separate window... */ - if (di->type == DITEM_TEXT) - d->redraw = 1; -#endif - if (d->xu1 > x) d->xu1 = x; if (d->yu1 > y) @@ -1670,7 +1674,8 @@ case DITEM_TEXT: if (!d->redraw) - break; + ECopyArea(d->pmm_bg.pmap, d->pmap, di->x, di->y, di->w, di->h, + di->x, di->y); x = di->x; w = di->w; goto draw_text; @@ -1709,7 +1714,7 @@ break; draw_text: - TextDraw(di->tclass, d->pmm.pmap, 0, 0, STATE_NORMAL, di->text, + TextDraw(di->tclass, d->pmap, 0, 0, STATE_NORMAL, di->text, x, di->y, w, 99999, 17, TextclassGetJustification(di->tclass)); break; } @@ -1742,10 +1747,6 @@ ECORE_LIST_FOR_EACH(dialog_list, d) { -#if 1 /* FIXME - Gross hack to get text items redrawn when changed */ - if (d->redraw) - DialogRedraw(d); -#endif if (d->update) DialogUpdate(d); d->redraw = 0; =================================================================== RCS file: /cvs/e/e16/e/src/x.c,v retrieving revision 1.121 retrieving revision 1.122 diff -u -3 -r1.121 -r1.122 --- x.c 29 Mar 2006 19:13:17 -0000 1.121 +++ x.c 17 Apr 2006 08:43:09 -0000 1.122 @@ -1345,6 +1345,17 @@ return pmap; } +void +ECopyArea(Drawable src, Drawable dst, int sx, int sy, unsigned int w, + unsigned int h, int dx, int dy) +{ + GC gc; + + gc = ECreateGC(src, 0, NULL); + XCopyArea(disp, src, dst, gc, sx, sy, w, h, dx, dy); + EFreeGC(gc); +} + GC ECreateGC(Drawable d, unsigned long mask, XGCValues * val) { =================================================================== RCS file: /cvs/e/e16/e/src/xwin.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- xwin.h 22 Jan 2006 18:25:41 -0000 1.10 +++ xwin.h 17 Apr 2006 08:43:09 -0000 1.11 @@ -112,6 +112,8 @@ #define EFreePixmap(pmap) XFreePixmap(disp, pmap) Pixmap ECreatePixmapCopy(Pixmap src, unsigned int w, unsigned int h, unsigned int depth); +void ECopyArea(Drawable src, Drawable dst, int sx, int sy, + unsigned int w, unsigned int h, int dx, int dy); GC ECreateGC(Drawable d, unsigned long mask, XGCValues * val); int EFreeGC(GC gc); ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs