Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        x.c xwin.h 


Log Message:
Save visual in Win struct.

===================================================================
RCS file: /cvs/e/e16/e/src/x.c,v
retrieving revision 1.133
retrieving revision 1.134
diff -u -3 -r1.133 -r1.134
--- x.c 7 May 2006 16:21:37 -0000       1.133
+++ x.c 10 May 2006 20:44:15 -0000      1.134
@@ -50,7 +50,7 @@
    struct _xwin       *prev;
    EventCallbackList   cbl;
    Window              xwin;
-   Window              parent;
+   Win                 parent;
    int                 x, y, w, h;
    char                mapped;
    char                in_use;
@@ -60,6 +60,7 @@
    int                 ord;
    XRectangle         *rects;
    int                 depth;
+   Visual             *visual;
    Pixmap              bgpmap;
    int                 bgcol;
 };
@@ -77,6 +78,12 @@
    return win->xwin;
 }
 
+Visual             *
+WinGetVisual(const Win win)
+{
+   return win->visual;
+}
+
 static EXID        *
 EXidCreate(void)
 {
@@ -181,7 +188,8 @@
 }
 
 static EXID        *
-EXidSet(Window xwin, Window parent, int x, int y, int w, int h, int depth)
+EXidSet(Window xwin, Win parent, int x, int y, int w, int h, int depth,
+       Visual * visual)
 {
    EXID               *xid;
 
@@ -193,6 +201,7 @@
    xid->w = w;
    xid->h = h;
    xid->depth = depth;
+   xid->visual = visual;
 #if DEBUG_XWIN
    Eprintf("EXidSet: %#lx\n", xid->xwin);
 #endif
@@ -311,12 +320,12 @@
    else
       attr.save_under = False;
 
-   xpar = (parent != NoWin) ? parent->xwin : VRoot.xwin;
+   xpar = (parent) ? parent->xwin : VRoot.xwin;
    xwin = XCreateWindow(disp, xpar, x, y, w, h, 0,
                        VRoot.depth, InputOutput, VRoot.vis,
                        CWOverrideRedirect | CWSaveUnder | CWBackingStore |
                        CWColormap | CWBackPixmap | CWBorderPixel, &attr);
-   win = EXidSet(xwin, xpar, x, y, w, h, VRoot.depth);
+   win = EXidSet(xwin, parent, x, y, w, h, VRoot.depth, VRoot.vis);
 
    return win;
 }
@@ -343,12 +352,12 @@
    else
       attr.save_under = False;
 
-   xpar = (parent != NoWin) ? parent->xwin : VRoot.xwin;
+   xpar = (parent) ? parent->xwin : VRoot.xwin;
    xwin = XCreateWindow(disp, xpar, x, y, w, h, 0,
                        c_attr->depth, InputOutput, c_attr->visual,
                        CWOverrideRedirect | CWSaveUnder | CWBackingStore |
                        CWColormap | CWBackPixmap | CWBorderPixel, &attr);
-   win = EXidSet(xwin, xpar, x, y, w, h, c_attr->depth);
+   win = EXidSet(xwin, parent, x, y, w, h, c_attr->depth, c_attr->visual);
 
    return win;
 }
@@ -362,10 +371,10 @@
 
    attr.override_redirect = False;
 
-   xpar = (parent != NoWin) ? parent->xwin : VRoot.xwin;
+   xpar = (parent) ? parent->xwin : VRoot.xwin;
    xwin = XCreateWindow(disp, xpar, x, y, w, h, 0, 0, InputOnly,
                        CopyFromParent, CWOverrideRedirect, &attr);
-   win = EXidSet(xwin, xpar, x, y, w, h, 0);
+   win = EXidSet(xwin, parent, x, y, w, h, 0, parent->visual);
 
    return win;
 }
@@ -469,16 +478,16 @@
 static int
 ExDelTree(EXID * xid)
 {
-   Window              xwin;
+   Win                 win;
    int                 nsub;
 
    xid->do_del = -1;
 
    nsub = 0;
-   xwin = xid->xwin;
+   win = xid;
    for (xid = xid_first; xid; xid = xid->next)
      {
-       if (xid->parent != xwin)
+       if (xid->parent != win)
           continue;
        ExDelTree(xid);
        nsub++;
@@ -568,7 +577,6 @@
 Window
 EXWindowGetParent(Window xwin)
 {
-   EXID               *xid;
    Window              parent, rt;
    Window             *pch = NULL;
    unsigned int        nch = 0;
@@ -579,9 +587,11 @@
    else if (pch)
       XFree(pch);
 
+#if 0                          /* FIXME - Remove? */
    xid = EXidLookup(xwin);
    if (xid)
       xid->parent = parent;
+#endif
 
    return parent;
 }
@@ -619,19 +629,18 @@
 ERegisterWindow(Window xwin)
 {
    EXID               *xid;
-   Window              rr;
-   int                 x, y;
-   unsigned int        w, h, bw, depth;
+   XWindowAttributes   xwa;
 
    xid = EXidLookup(xwin);
    if (xid)
       goto done;
 
-   XGetGeometry(disp, xwin, &rr, &x, &y, &w, &h, &bw, &depth);
+   XGetWindowAttributes(disp, xwin, &xwa);
 #if 0
    Eprintf("ERegisterWindow %#lx %d+%d %dx%d\n", win, x, y, w, h);
 #endif
-   xid = EXidSet(xwin, None, x, y, w, h, depth);
+   xid = EXidSet(xwin, None, xwa.x, xwa.y, xwa.width, xwa.height, xwa.depth,
+                xwa.visual);
    xid->attached = 1;
 
  done:
@@ -708,7 +717,7 @@
            xid, xid->xwin, xid->mapped, xid->parent, parent->xwin,
            xid->x, xid->y, xid->w, xid->h, x, y);
 #endif
-       if (parent->xwin == xid->parent)
+       if (parent == xid->parent)
          {
             if ((x != xid->x) || (y != xid->y))
               {
@@ -720,7 +729,7 @@
          }
        else
          {
-            xid->parent = parent->xwin;
+            xid->parent = parent;
             xid->x = x;
             xid->y = y;
          }
===================================================================
RCS file: /cvs/e/e16/e/src/xwin.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -3 -r1.17 -r1.18
--- xwin.h      7 May 2006 15:08:01 -0000       1.17
+++ xwin.h      10 May 2006 20:44:15 -0000      1.18
@@ -32,6 +32,7 @@
 
 #define Xwin(win) WinGetXwin(win)
 Window              WinGetXwin(const Win win);
+Visual             *WinGetVisual(const Win win);
 
 Win                 ECreateWinFromXwin(Window xwin);
 void                EDestroyWin(Win win);




-------------------------------------------------------
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

Reply via email to