Enlightenment CVS committal Author : kwo Project : e16 Module : e
Dir : e16/e/src Modified Files: desktops.c ecompmgr.c eobj.c eobj.h x.c xwin.h Log Message: Eliminate redundant geometry caching in top-level objects. =================================================================== RCS file: /cvs/e/e16/e/src/desktops.c,v retrieving revision 1.250 retrieving revision 1.251 diff -u -3 -r1.250 -r1.251 --- desktops.c 2 Sep 2006 14:33:29 -0000 1.250 +++ desktops.c 8 Sep 2006 23:13:57 -0000 1.251 @@ -714,11 +714,7 @@ dsk = _DeskGet(desk); - if (dsk->num == 0) - { - EoSync(dsk); - } - else + if (dsk->num != 0) { x = (dsk->viewable) ? EoGetX(dsk) : VRoot.w; EoMoveResize(dsk, x, 0, w, h); =================================================================== RCS file: /cvs/e/e16/e/src/ecompmgr.c,v retrieving revision 1.125 retrieving revision 1.126 diff -u -3 -r1.125 -r1.126 --- ecompmgr.c 2 Sep 2006 15:23:04 -0000 1.125 +++ ecompmgr.c 8 Sep 2006 23:13:57 -0000 1.126 @@ -88,7 +88,6 @@ EObj *prev; /* Paint order */ Pixmap pixmap; int rcx, rcy, rcw, rch; - int bw; int mode; unsigned damaged:1; unsigned fading:1; @@ -932,7 +931,7 @@ unsigned int bw; /* FIXME - Get this right */ - bw = cw->bw; + bw = EobjGetBW(eo); if (Mode_compmgr.use_pixmap) { cw->rcx = EobjGetX(eo); @@ -1051,7 +1050,6 @@ static XserverRegion win_shape(EObj * eo) { - ECmWinInfo *cw = eo->cmhook; XserverRegion border; int x, y; @@ -1068,8 +1066,8 @@ } /* translate this */ - x = EobjGetX(eo) + cw->bw; - y = EobjGetY(eo) + cw->bw; + x = EobjGetX(eo) + EobjGetBW(eo); + y = EobjGetY(eo) + EobjGetBW(eo); ERegionTranslate(border, x, y); D2printf("shape %#lx: %d %d\n", EobjGetXwin(eo), x, y); @@ -1444,8 +1442,6 @@ eo->cmhook = cw; - cw->bw = WinGetBorderWidth(eo->win); - if (eo->type == EOBJ_TYPE_EXT && Conf_compmgr.override_redirect.mode == ECM_OR_UNREDIRECTED) { @@ -1549,7 +1545,6 @@ static void ECompMgrWinConfigure(EObj * eo, XEvent * ev) { - ECmWinInfo *cw = eo->cmhook; int x, y, w, h, bw; int change_xy, change_wh, change_bw; @@ -1561,13 +1556,9 @@ change_xy = EobjGetX(eo) != x || EobjGetY(eo) != y; change_wh = EobjGetW(eo) != w || EobjGetH(eo) != h; - change_bw = cw->bw != bw; + change_bw = EobjGetBW(eo) != bw; - eo->x = x; - eo->y = y; - eo->w = w; - eo->h = h; - cw->bw = bw; + EWindowSetGeometry(eo->win, x, y, w, h, bw); ECompMgrWinMoveResize(eo, change_xy, change_wh, change_bw); } @@ -1697,7 +1688,8 @@ { parts = ERegionCreate(); XDamageSubtract(dpy, cw->damage, None, parts); - ERegionTranslate(parts, EobjGetX(eo) + cw->bw, EobjGetY(eo) + cw->bw); + ERegionTranslate(parts, EobjGetX(eo) + EobjGetBW(eo), + EobjGetY(eo) + EobjGetBW(eo)); #if 0 /* ENABLE_SHADOWS - FIXME - This is not right, remove? */ if (Mode_compmgr.shadow_mode == ECM_SHADOWS_SHARP) { =================================================================== RCS file: /cvs/e/e16/e/src/eobj.c,v retrieving revision 1.82 retrieving revision 1.83 diff -u -3 -r1.82 -r1.83 --- eobj.c 13 Aug 2006 09:17:03 -0000 1.82 +++ eobj.c 8 Sep 2006 23:13:57 -0000 1.83 @@ -179,10 +179,6 @@ } eo->type = type; eo->win = win; - eo->x = x; - eo->y = y; - eo->w = w; - eo->h = h; eo->shaped = -1; if (type == EOBJ_TYPE_EXT) @@ -250,18 +246,6 @@ Efree(eo); } -void -EobjSync(EObj * eo) -{ - int x, y, w, h; - - EGetGeometry(eo->win, NULL, &x, &y, &w, &h, NULL, NULL); - eo->x = x; - eo->y = y; - eo->w = w; - eo->h = h; -} - EObj * EobjWindowCreate(int type, int x, int y, int w, int h, int su, const char *name) { @@ -387,10 +371,6 @@ move = x != EobjGetX(eo) || y != EobjGetY(eo); resize = w != EobjGetW(eo) || h != EobjGetH(eo); - eo->x = x; - eo->y = y; - eo->w = w; - eo->h = h; #if USE_COMPOSITE if (eo->type == EOBJ_TYPE_EWIN) { @@ -436,8 +416,6 @@ int move; move = x != EobjGetX(eo) || y != EobjGetY(eo); - eo->x = x; - eo->y = y; EReparentWindow(eo->win, dst->win, x, y); if (dst->type == EOBJ_TYPE_DESK) =================================================================== RCS file: /cvs/e/e16/e/src/eobj.h,v retrieving revision 1.32 retrieving revision 1.33 diff -u -3 -r1.32 -r1.33 --- eobj.h 28 Aug 2006 22:46:22 -0000 1.32 +++ eobj.h 8 Sep 2006 23:13:57 -0000 1.33 @@ -35,8 +35,6 @@ short ilayer; /* Internal stacking layer */ short layer; /* Stacking layer */ Desk *desk; /* Belongs on desk */ - int x, y; - int w, h; signed char stacked; signed char shaped; char sticky; @@ -68,13 +66,14 @@ #define EobjGetWin(eo) ((eo)->win) #define EobjGetXwin(eo) WinGetXwin((eo)->win) +#define EobjGetX(eo) WinGetX((eo)->win) +#define EobjGetY(eo) WinGetY((eo)->win) +#define EobjGetW(eo) WinGetW((eo)->win) +#define EobjGetH(eo) WinGetH((eo)->win) +#define EobjGetBW(eo) WinGetBorderWidth((eo)->win) #define EobjGetDesk(eo) ((eo)->desk) #define EobjGetName(eo) ((eo)->name) #define EobjGetType(eo) ((eo)->type) -#define EobjGetX(eo) ((eo)->x) -#define EobjGetY(eo) ((eo)->y) -#define EobjGetW(eo) ((eo)->w) -#define EobjGetH(eo) ((eo)->h) #define EoObj(eo) (&((eo)->o)) #define EoGetWin(eo) EobjGetWin(EoObj(eo)) @@ -116,7 +115,6 @@ #define EoInit(eo, type, win, x, y, w, h, su, name) \ EobjInit(EoObj(eo), type, win, x, y, w, h, su, name) #define EoFini(eo) EobjFini(EoObj(eo)); -#define EoSync(eo) EobjSync(EoObj(eo)) #define EoMap(eo, raise) EobjMap(EoObj(eo), raise) #define EoUnmap(eo) EobjUnmap(EoObj(eo)) #define EoMove(eo, x, y) EobjMove(EoObj(eo), x, y) @@ -132,7 +130,6 @@ int w, int h, int su, const char *name); void EobjFini(EObj * eo); void EobjDestroy(EObj * eo); -void EobjSync(EObj * eo); EObj *EobjWindowCreate(int type, int x, int y, int w, int h, int su, const char *name); =================================================================== RCS file: /cvs/e/e16/e/src/x.c,v retrieving revision 1.148 retrieving revision 1.149 diff -u -3 -r1.148 -r1.149 --- x.c 24 Aug 2006 21:52:28 -0000 1.148 +++ x.c 8 Sep 2006 23:13:57 -0000 1.149 @@ -21,6 +21,7 @@ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#define DECLARE_WIN 1 #include "E.h" #ifdef USE_ECORE_X #include <Ecore_X.h> @@ -40,41 +41,6 @@ static Colormap argb_cmap = None; #endif -typedef struct -{ - EventCallbackFunc *func; - void *prm; -} EventCallbackItem; - -typedef struct -{ - int num; - EventCallbackItem *lst; -} EventCallbackList; - -struct _xwin -{ - struct _xwin *next; - struct _xwin *prev; - EventCallbackList cbl; - Window xwin; - Win parent; - int x, y, w, h; - int bw; - char mapped; - char in_use; - signed char do_del; - char attached; - int num_rect; - int ord; - XRectangle *rects; - Visual *visual; - int depth; - Colormap cmap; - Pixmap bgpmap; - unsigned int bgcol; -}; - typedef struct _xwin EXID; /* FIXME - Remove */ static XContext xid_context = 0; @@ -82,6 +48,7 @@ static EXID *xid_first = NULL; static EXID *xid_last = NULL; +#if !EXPOSE_WIN Window WinGetXwin(const Win win) { @@ -89,6 +56,30 @@ } int +WinGetX(const Win win) +{ + return win->x; +} + +int +WinGetY(const Win win) +{ + return win->y; +} + +int +WinGetW(const Win win) +{ + return win->w; +} + +int +WinGetH(const Win win) +{ + return win->h; +} + +int WinGetBorderWidth(const Win win) { return win->bw; @@ -111,6 +102,7 @@ { return win->cmap; } +#endif static EXID * EXidCreate(void) @@ -638,6 +630,21 @@ xid->w = w; xid->h = h; xid->depth = depth; +} + +void +EWindowSetGeometry(Win win, int x, int y, int w, int h, int bw) +{ + EXID *xid = win; + + if (!xid) + return; + + xid->x = x; + xid->y = y; + xid->w = w; + xid->h = h; + xid->bw = bw; } void =================================================================== RCS file: /cvs/e/e16/e/src/xwin.h,v retrieving revision 1.25 retrieving revision 1.26 diff -u -3 -r1.25 -r1.26 --- xwin.h 24 Aug 2006 21:52:28 -0000 1.25 +++ xwin.h 8 Sep 2006 23:13:57 -0000 1.26 @@ -24,10 +24,6 @@ #ifndef _XWIN_H_ #define _XWIN_H_ -typedef struct _xwin *Win; - -#define NoWin ((Win)0) - Display *EDisplayOpen(const char *dstr, int scr); void EDisplayClose(void); void EDisplayDisconnect(void); @@ -45,13 +41,72 @@ Time EGetTimestamp(void); +typedef struct _xwin *Win; +typedef void (EventCallbackFunc) (Win win, XEvent * ev, void *prm); + +#define NoWin ((Win)0) + +#define EXPOSE_WIN 1 +#if EXPOSE_WIN || DECLARE_WIN +typedef struct +{ + EventCallbackFunc *func; + void *prm; +} EventCallbackItem; + +typedef struct +{ + int num; + EventCallbackItem *lst; +} EventCallbackList; + +struct _xwin +{ + struct _xwin *next; + struct _xwin *prev; + EventCallbackList cbl; + Window xwin; + Win parent; + int x, y, w, h; + int bw; + char mapped; + char in_use; + signed char do_del; + char attached; + int num_rect; + int ord; + XRectangle *rects; + Visual *visual; + int depth; + Colormap cmap; + Pixmap bgpmap; + unsigned int bgcol; +}; +#endif + Win ELookupXwin(Window xwin); +#if EXPOSE_WIN +#define WinGetXwin(win) ((win)->xwin) +#define WinGetX(win) ((win)->x) +#define WinGetY(win) ((win)->y) +#define WinGetW(win) ((win)->w) +#define WinGetH(win) ((win)->h) +#define WinGetBorderWidth(win) ((win)->bw) +#define WinGetDepth(win) ((win)->depth) +#define WinGetVisual(win) ((win)->visual) +#define WinGetCmap(win) ((win)->cmap) +#else Window WinGetXwin(const Win win); +int WinGetX(const Win win); +int WinGetY(const Win win); +int WinGetW(const Win win); +int WinGetH(const Win win); int WinGetBorderWidth(const Win win); int WinGetDepth(const Win win); Visual *WinGetVisual(const Win win); Colormap WinGetCmap(const Win win); +#endif Win ECreateWinFromXwin(Window xwin); void EDestroyWin(Win win); @@ -59,7 +114,6 @@ Win ERegisterWindow(Window xwin, XWindowAttributes * pxwa); void EUnregisterWindow(Win win); void EUnregisterXwin(Window xwin); -typedef void (EventCallbackFunc) (Win win, XEvent * ev, void *prm); void EventCallbackRegister(Win win, int type, EventCallbackFunc * func, void *prm); void EventCallbackUnregister(Win win, int type, @@ -78,6 +132,8 @@ Win ECreateEventWindow(Win parent, int x, int y, int w, int h); Win ECreateFocusWindow(Win parent, int x, int y, int w, int h); void EWindowSync(Win win); +void EWindowSetGeometry(Win win, int x, int y, int w, int h, + int bw); void EWindowSetMapped(Win win, int mapped); void ESelectInputAdd(Win win, long mask); ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs