Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        E.h buttons.c desktops.c eobj.c ewins.c pager.c slideout.c 


Log Message:
Simplify.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.452
retrieving revision 1.453
diff -u -3 -r1.452 -r1.453
--- E.h 12 Jun 2005 07:02:01 -0000      1.452
+++ E.h 12 Jun 2005 07:56:28 -0000      1.453
@@ -1492,7 +1492,7 @@
 
 /* eobj.c */
 void                EobjInit(EObj * eo, int type, Window win, int x, int y,
-                            int w, int h, const char *name);
+                            int w, int h, int su, const char *name);
 void                EobjFini(EObj * eo);
 void                EobjDestroy(EObj * eo);
 EObj               *EobjWindowCreate(int type, int x, int y, int w, int h,
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/buttons.c,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -3 -r1.65 -r1.66
--- buttons.c   12 Jun 2005 07:02:01 -0000      1.65
+++ buttons.c   12 Jun 2005 07:56:30 -0000      1.66
@@ -76,7 +76,6 @@
             int ysr, int ysa, char simg, int desk, char sticky)
 {
    Button             *b;
-   Window              win;
 
    if (desk < 0 || desk >= DesksGetNumber())
       return NULL;
@@ -128,10 +127,9 @@
    b->state = 0;
    b->ref_count = 0;
 
-   win = ECreateWindow(DeskGetWin(desk), -100, -100, 50, 50, 0);
    EoSetSticky(b, sticky);
    EoSetDesk(b, desk);
-   EobjInit(&b->o, EOBJ_TYPE_BUTTON, win, -100, -100, 50, 50, name);
+   EobjInit(EoObj(b), EOBJ_TYPE_BUTTON, None, -100, -100, 50, 50, 0, name);
    EoSetLayer(b, ontop);
    EoSetShadow(b, 0);
 
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/desktops.c,v
retrieving revision 1.150
retrieving revision 1.151
diff -u -3 -r1.150 -r1.151
--- desktops.c  8 Jun 2005 16:33:36 -0000       1.150
+++ desktops.c  12 Jun 2005 07:56:30 -0000      1.151
@@ -405,13 +405,9 @@
    d->num = desk;
    desks.order[desk] = desk;
 
-   if (desk == 0)
-      win = VRoot.win;
-   else
-      win = ECreateWindow(VRoot.win, -VRoot.w, -VRoot.h, VRoot.w, VRoot.h, 0);
-
+   win = (desk == 0) ? VRoot.win : None;
    Esnprintf(buf, sizeof(buf), "Desk-%d", desk);
-   EobjInit(&d->o, EOBJ_TYPE_DESK, win, 0, 0, VRoot.w, VRoot.h, buf);
+   EobjInit(&d->o, EOBJ_TYPE_DESK, win, 0, 0, VRoot.w, VRoot.h, 0, buf);
    EoSetShadow(d, 0);
    if (desk > 0)
      {
@@ -422,7 +418,7 @@
        DeskEventsConfigure(d, 1);
 #endif
      }
-   EventCallbackRegister(win, 0, DesktopHandleEvents, d);
+   EventCallbackRegister(EoGetWin(d), 0, DesktopHandleEvents, d);
 
    HintsSetRootHints(EoGetWin(d));
 
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/eobj.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -3 -r1.35 -r1.36
--- eobj.c      12 Jun 2005 07:02:01 -0000      1.35
+++ eobj.c      12 Jun 2005 07:56:30 -0000      1.36
@@ -149,8 +149,15 @@
 
 void
 EobjInit(EObj * eo, int type, Window win, int x, int y, int w, int h,
-        const char *name)
+        int su, const char *name)
 {
+   if (win == None)
+     {
+       if (type == EOBJ_TYPE_EVENT)
+          win = ECreateEventWindow(VRoot.win, x, y, w, h);
+       else
+          win = ECreateWindow(DeskGetWin(eo->desk), x, y, w, h, su);
+     }
    eo->type = type;
    eo->win = win;
    eo->x = x;
@@ -206,20 +213,15 @@
 
    eo = Ecalloc(1, sizeof(EObj));
 
-   if (type == EOBJ_TYPE_EVENT)
-      eo->win = ECreateEventWindow(VRoot.win, x, y, w, h);
-   else
-      eo->win = ECreateWindow(VRoot.win, x, y, w, h, su);
+   eo->floating = 1;
+   EobjSetLayer(eo, 20);
+   EobjInit(eo, type, eo->win, x, y, w, h, su, name);
    if (eo->win == None)
      {
        Efree(eo);
-       return NULL;
+       eo = NULL;
      }
 
-   eo->floating = 1;
-   EobjSetLayer(eo, 20);
-   EobjInit(eo, type, eo->win, x, y, w, h, name);
-
    return eo;
 }
 
@@ -248,7 +250,7 @@
    if (!eo)
       return eo;
 
-   EobjInit(eo, type, win, attr.x, attr.y, attr.width, attr.height, NULL);
+   EobjInit(eo, type, win, attr.x, attr.y, attr.width, attr.height, 0, NULL);
    eo->name = ecore_x_icccm_title_get(win);
 
 #if 1                          /* FIXME - TBD */
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewins.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -3 -r1.74 -r1.75
--- ewins.c     9 Jun 2005 18:28:11 -0000       1.74
+++ ewins.c     12 Jun 2005 07:56:30 -0000      1.75
@@ -122,11 +122,11 @@
    if (use_argb)
       frame = ECreateVisualWindow(VRoot.win, -10, -10, 1, 1, 1, &win_attr);
    else
-      frame = ECreateWindow(VRoot.win, -10, -10, 1, 1, 1);
+      frame = None;
 
    ewin->o.stacked = -1;       /* Not placed on desk yet */
-   EobjInit(&ewin->o, EOBJ_TYPE_EWIN, frame, -10, -10, -1, -1, NULL);
    EoSetDesk(ewin, DesksGetCurrent());
+   EobjInit(EoObj(ewin), EOBJ_TYPE_EWIN, frame, -10, -10, -1, -1, 1, NULL);
    EoSetLayer(ewin, 4);
    EoSetShadow(ewin, 1);
    EobjListFocusAdd(&ewin->o, 0);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/pager.c,v
retrieving revision 1.150
retrieving revision 1.151
diff -u -3 -r1.150 -r1.151
--- pager.c     9 Jun 2005 18:28:13 -0000       1.150
+++ pager.c     12 Jun 2005 07:56:30 -0000      1.151
@@ -953,14 +953,12 @@
 PagerHiwinCreate(void)
 {
    PagerHiwin         *phi;
-   Window              win;
 
    phi = Ecalloc(1, sizeof(PagerHiwin));
    if (!phi)
       return NULL;
 
-   win = ECreateWindow(VRoot.win, 0, 0, 3, 3, 1);
-   EobjInit(&phi->o, EOBJ_TYPE_MISC, win, 0, 0, 3, 3, "HiWin");
+   EobjInit(EoObj(phi), EOBJ_TYPE_MISC, None, 0, 0, 3, 3, 1, "HiWin");
    EoSetShadow(phi, 0);
    EoSetFloating(phi, 1);
    EoSetLayer(phi, 19);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/slideout.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -3 -r1.33 -r1.34
--- slideout.c  12 Jun 2005 07:02:02 -0000      1.33
+++ slideout.c  12 Jun 2005 07:56:31 -0000      1.34
@@ -48,14 +48,12 @@
 SlideoutCreate(char *name, char dir)
 {
    Slideout           *s;
-   Window              win;
 
    s = Ecalloc(1, sizeof(Slideout));
    if (!s)
       return NULL;
 
-   win = ECreateWindow(VRoot.win, -10, -10, 1, 1, 1);
-   EobjInit(EoObj(s), EOBJ_TYPE_MISC, win, -10, -10, 1, 1, name);
+   EobjInit(EoObj(s), EOBJ_TYPE_MISC, None, -10, -10, 1, 1, 1, name);
    s->direction = dir;
    EventCallbackRegister(EoGetWin(s), 0, SlideoutHandleEvent, s);
 




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

Reply via email to