Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        E.h evhandlers.c x.c 


Log Message:
Make XID stuff local to x.c.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.125
retrieving revision 1.126
diff -u -3 -r1.125 -r1.126
--- E.h 11 Jul 2003 19:45:53 -0000      1.125
+++ E.h 12 Jul 2003 07:52:03 -0000      1.126
@@ -562,21 +562,6 @@
 }
 Icondef;
 
-typedef struct _exid
-{
-   Window              parent;
-   Window              win;
-   int                 x, y, w, h;
-   char                mapped;
-   int                 num_rect;
-   int                 ord;
-   XRectangle         *rects;
-   int                 depth;
-   Pixmap              bgpmap;
-   int                 bgcol;
-}
-EXID;
-
 typedef struct _actiontype
 {
    void               *params;
@@ -1880,6 +1865,7 @@
 void                EMoveResizeWindow(Display * d, Window win, int x, int y,
                                      int w, int h);
 void                EDestroyWindow(Display * d, Window win);
+void                EForgetWindow(Display * d, Window win);
 void                EMapWindow(Display * d, Window win);
 void                EUnmapWindow(Display * d, Window win);
 void                EShapeCombineMask(Display * d, Window win, int dest, int x,
@@ -1904,10 +1890,6 @@
 void                ESetWindowBackgroundPixmap(Display * d, Window win,
                                               Pixmap pmap);
 void                ESetWindowBackground(Display * d, Window win, int col);
-EXID               *NewXID(void);
-void                AddXID(EXID * xid);
-EXID               *FindXID(Window win);
-void                DelXID(Window win);
 Pixmap              ECreatePixmap(Display * display, Drawable d,
                                  unsigned int width, unsigned int height,
                                  unsigned depth);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/evhandlers.c,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -3 -r1.112 -r1.113
--- evhandlers.c        11 Jul 2003 17:58:18 -0000      1.112
+++ evhandlers.c        12 Jul 2003 07:52:03 -0000      1.113
@@ -1033,7 +1033,7 @@
 
    EDBUG(5, "HandleDestroy");
    win = ev->xdestroywindow.window;
-   DelXID(win);
+   EForgetWindow(disp, win);
    ewin = RemoveItem(NULL, win, LIST_FINDBY_ID, LIST_TYPE_EWIN);
    if (ewin)
       if (ewin->iconified > 0)
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/x.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -3 -r1.52 -r1.53
--- x.c 22 May 2003 19:15:03 -0000      1.52
+++ x.c 12 Jul 2003 07:52:03 -0000      1.53
@@ -24,6 +24,100 @@
 #include <X11/Xutil.h>
 #include <X11/Xresource.h>
 
+typedef struct _exid
+{
+   Window              parent;
+   Window              win;
+   int                 x, y, w, h;
+   char                mapped;
+   int                 num_rect;
+   int                 ord;
+   XRectangle         *rects;
+   int                 depth;
+   Pixmap              bgpmap;
+   int                 bgcol;
+}
+EXID;
+
+static XContext     xid_context = 0;
+
+static EXID        *
+NewXID(void)
+{
+   EXID               *xid;
+
+   xid = Emalloc(sizeof(EXID));
+   xid->parent = 0;
+   xid->win = 0;
+   xid->x = 0;
+   xid->y = 0;
+   xid->w = 0;
+   xid->h = 0;
+   xid->num_rect = 0;
+   xid->ord = 0;
+   xid->rects = NULL;
+   xid->depth = 0;
+   xid->mapped = 0;
+   xid->bgpmap = 0;
+   xid->bgcol = 0;
+
+   return xid;
+}
+
+static void
+AddXID(EXID * xid)
+{
+   if (!xid_context)
+      xid_context = XUniqueContext();
+   XSaveContext(disp, xid->win, xid_context, (XPointer) xid);
+   AddItem(xid, "", xid->win, LIST_TYPE_XID);
+}
+
+static EXID        *
+FindXID(Window win)
+{
+   EXID               *xid = NULL;
+
+   if (xid_context == 0)
+      xid_context = XUniqueContext();
+   if (XFindContext(disp, win, xid_context, (XPointer *) & xid) == XCNOENT)
+      xid = NULL;
+   return xid;
+}
+
+static void
+DelXID(Window win)
+{
+   EXID               *xid;
+
+   if (xid_context == 0)
+      xid_context = XUniqueContext();
+   xid = RemoveItem("", win, LIST_FINDBY_ID, LIST_TYPE_XID);
+   if (xid)
+     {
+       XDeleteContext(disp, win, xid_context);
+       if (xid->rects)
+          XFree(xid->rects);
+       Efree(xid);
+     }
+}
+
+static void
+SetXID(Window win, Window parent, int x, int y, int w, int h, int depth)
+{
+   EXID               *xid;
+
+   xid = NewXID();
+   xid->parent = parent;
+   xid->win = win;
+   xid->x = x;
+   xid->y = y;
+   xid->w = w;
+   xid->h = h;
+   xid->depth = root.depth;
+   AddXID(xid);
+}
+
 Pixmap
 ECreatePixmap(Display * display, Drawable d, unsigned int width,
              unsigned int height, unsigned depth)
@@ -43,7 +137,6 @@
 Window
 ECreateWindow(Window parent, int x, int y, int w, int h, int saveunder)
 {
-   EXID               *xid;
    Window              win;
    XSetWindowAttributes attr;
 
@@ -65,15 +158,8 @@
                    root.vis,
                    CWOverrideRedirect | CWSaveUnder | CWBackingStore |
                    CWColormap | CWBackPixmap | CWBorderPixel, &attr);
-   xid = NewXID();
-   xid->parent = parent;
-   xid->win = win;
-   xid->x = x;
-   xid->y = y;
-   xid->w = w;
-   xid->h = h;
-   xid->depth = root.depth;
-   AddXID(xid);
+   SetXID(win, parent, x, y, w, h, root.depth);
+
    EDBUG_RETURN(win);
 }
 
@@ -167,6 +253,12 @@
 }
 
 void
+EForgetWindow(Display * d, Window win)
+{
+   DelXID(win);
+}
+
+void
 EMapWindow(Display * d, Window win)
 {
    EXID               *xid;
@@ -523,68 +615,6 @@
       XSetWindowBackground(d, win, col);
 }
 
-EXID               *
-NewXID(void)
-{
-   EXID               *xid;
-
-   xid = Emalloc(sizeof(EXID));
-   xid->parent = 0;
-   xid->win = 0;
-   xid->x = 0;
-   xid->y = 0;
-   xid->w = 0;
-   xid->h = 0;
-   xid->num_rect = 0;
-   xid->ord = 0;
-   xid->rects = NULL;
-   xid->depth = 0;
-   xid->mapped = 0;
-   xid->bgpmap = 0;
-   xid->bgcol = 0;
-   return xid;
-}
-
-static XContext     xid_context = 0;
-
-void
-AddXID(EXID * xid)
-{
-   if (!xid_context)
-      xid_context = XUniqueContext();
-   XSaveContext(disp, xid->win, xid_context, (XPointer) xid);
-   AddItem(xid, "", xid->win, LIST_TYPE_XID);
-}
-
-EXID               *
-FindXID(Window win)
-{
-   EXID               *xid = NULL;
-
-   if (xid_context == 0)
-      xid_context = XUniqueContext();
-   if (XFindContext(disp, win, xid_context, (XPointer *) & xid) == XCNOENT)
-      xid = NULL;
-   return xid;
-}
-
-void
-DelXID(Window win)
-{
-   EXID               *xid;
-
-   if (xid_context == 0)
-      xid_context = XUniqueContext();
-   xid = RemoveItem("", win, LIST_FINDBY_ID, LIST_TYPE_XID);
-   if (xid)
-     {
-       XDeleteContext(disp, win, xid_context);
-       if (xid->rects)
-          XFree(xid->rects);
-       Efree(xid);
-     }
-}
-
 Window
 ECreateEventWindow(Window parent, int x, int y, int w, int h)
 {
@@ -596,6 +626,10 @@
    win =
       XCreateWindow(disp, parent, x, y, w, h, 0, 0, InputOnly, root.vis,
                    CWOverrideRedirect, &attr);
+#if 0                          /* Not yet */
+   SetXID(win, parent, x, y, w, h, root.depth);
+#endif
+
    EDBUG_RETURN(win);
 }
 




-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps1
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to