Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        E.h config.c desktops.c ewins.c main.c setup.c startup.c 


Log Message:
Handle startup window stacking via object stack.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.378
retrieving revision 1.379
diff -u -3 -r1.378 -r1.379
--- E.h 27 Feb 2005 01:11:49 -0000      1.378
+++ E.h 27 Feb 2005 14:42:25 -0000      1.379
@@ -2098,8 +2098,8 @@
 #define EwinListFocusLower(ewin) EobjListFocusLower(&(ewin->o))
 
 /* startup.c */
-void                StartupWindowsCreate(int start);
-void                StartupWindowsRaise(void);
+void                StartupWindowsCreate(void);
+void                StartupWindowsOpen(void);
 
 /* tclass.c */
 int                 TextclassConfigLoad(FILE * fs);
@@ -2325,8 +2325,6 @@
 extern VirtRoot     VRoot;
 extern EConf        Conf;
 extern EMode        Mode;
-extern Window       init_win1;
-extern Window       init_win2;
 extern Window       init_win_ext;
 
 #define FILEPATH_LEN_MAX 4096
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/config.c,v
retrieving revision 1.127
retrieving revision 1.128
diff -u -3 -r1.127 -r1.128
--- config.c    16 Feb 2005 19:48:27 -0000      1.127
+++ config.c    27 Feb 2005 14:42:28 -0000      1.128
@@ -527,7 +527,7 @@
        if (!Mode.wm.restart)
          {
             if (i == 2)
-               StartupWindowsCreate(1);
+               StartupWindowsCreate();
 
             if ((i > 1) && (!p))
               {
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/desktops.c,v
retrieving revision 1.126
retrieving revision 1.127
diff -u -3 -r1.126 -r1.127
--- desktops.c  27 Feb 2005 01:11:50 -0000      1.126
+++ desktops.c  27 Feb 2005 14:42:40 -0000      1.127
@@ -1358,11 +1358,6 @@
          {
             _APPEND_TO_WIN_LIST(init_win_ext);
          }
-       if (init_win1)
-         {
-            _APPEND_TO_WIN_LIST(init_win1);
-            _APPEND_TO_WIN_LIST(init_win2);
-         }
      }
 #endif
 
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewins.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -3 -r1.21 -r1.22
--- ewins.c     27 Feb 2005 13:17:28 -0000      1.21
+++ ewins.c     27 Feb 2005 14:42:40 -0000      1.22
@@ -910,10 +910,6 @@
    EwinConformToDesktop(ewin);
    EwinDetermineArea(ewin);
 
-#if 1                          /* FIXME - Handle via object stack */
-   StartupWindowsRaise();
-#endif
-
    ecore_x_ungrab();
 
    return ewin;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/main.c,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -3 -r1.115 -r1.116
--- main.c      26 Feb 2005 16:40:36 -0000      1.115
+++ main.c      27 Feb 2005 14:42:40 -0000      1.116
@@ -256,9 +256,6 @@
      }
 #endif
 
-   if (!Mode.wm.restart)
-      StartupWindowsCreate(0);
-
    /* sync just to make sure */
    ecore_x_sync();
    Mode.queue_up = DRAW_QUEUE_ENABLE;
@@ -280,6 +277,9 @@
    RunInitPrograms();
    SpawnSnappedCmds();
 
+   if (!Mode.wm.restart)
+      StartupWindowsOpen();
+
    Conf.startup.firsttime = 0;
    Mode.wm.save_ok = 1;
    Mode.wm.startup = 0;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/setup.c,v
retrieving revision 1.149
retrieving revision 1.150
diff -u -3 -r1.149 -r1.150
--- setup.c     2 Feb 2005 17:12:03 -0000       1.149
+++ setup.c     27 Feb 2005 14:42:41 -0000      1.150
@@ -87,7 +87,6 @@
                                 if (init_win_ext)
                                    XRaiseWindow(disp, init_win_ext);
 #endif
-                                StartupWindowsRaise();
                                 ProgressbarsRaise();
                                 XMapWindow(disp, wlist[i]);
                              }
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/startup.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -3 -r1.49 -r1.50
--- startup.c   2 Feb 2005 17:12:05 -0000       1.49
+++ startup.c   27 Feb 2005 14:42:41 -0000      1.50
@@ -23,132 +23,129 @@
 #include "E.h"
 #include <time.h>
 
-Window              init_win1 = None;
-Window              init_win2 = None;
+static Window       init_win1 = None;
+static Window       init_win2 = None;
+static char         bg_sideways = 0;
 
 void
-StartupWindowsCreate(int start)
+StartupWindowsCreate(void)
 {
-   static Window       w1, w2, win1, win2, b1, b2;
-   static Background  *bg = NULL;
-   static Background  *bg_sideways = NULL;     /* currently used to determine 
if the startup screen should slide sideways */
-   static ImageClass  *ic = NULL;
+   Window              w1, w2, win1, win2, b1, b2;
+   Background         *bg;
+   ImageClass         *ic;
+   EObj               *eo;
    char                pq;
 
    if (!Conf.startup.animate)
       return;
 
-   if (start)
-     {
-       bg_sideways = FindItem("STARTUP_BACKGROUND_SIDEWAYS", 0,
-                              LIST_FINDBY_NAME, LIST_TYPE_BACKGROUND);
-       ic = ImageclassFind("STARTUP_BAR", 0);
-       if (!ic)
-          ic = ImageclassFind("DESKTOP_DRAGBUTTON_HORIZ", 0);
-       bg =
-          FindItem("STARTUP_BACKGROUND", 0, LIST_FINDBY_NAME,
-                   LIST_TYPE_BACKGROUND);
-       if ((!ic) || (!bg))
-          return;
-
-       if (bg_sideways)
-         {
-            w1 =
-               ECreateWindow(VRoot.win, (VRoot.w / 2), 0, VRoot.w, VRoot.h, 1);
-            w2 =
-               ECreateWindow(VRoot.win, -(VRoot.w / 2), 0, VRoot.w, VRoot.h,
-                             1);
-            win1 = ECreateWindow(w1, -(VRoot.w / 2), 0, VRoot.w, VRoot.h, 0);
-            win2 = ECreateWindow(w2, (VRoot.w / 2), 0, VRoot.w, VRoot.h, 0);
-         }
-       else
-         {
-            w1 =
-               ECreateWindow(VRoot.win, 0, -(VRoot.h / 2), VRoot.w, VRoot.h,
-                             1);
-            w2 =
-               ECreateWindow(VRoot.win, 0, (VRoot.h / 2), VRoot.w, VRoot.h, 1);
-            win1 = ECreateWindow(w1, 0, (VRoot.h / 2), VRoot.w, VRoot.h, 0);
-            win2 = ECreateWindow(w2, 0, -(VRoot.h / 2), VRoot.w, VRoot.h, 0);
-         }
-
-       EMapWindow(win1);
-       EMapWindow(win2);
+   /* Acting only as boolean? */
+   if (FindItem
+       ("STARTUP_BACKGROUND_SIDEWAYS", 0, LIST_FINDBY_NAME,
+       LIST_TYPE_BACKGROUND))
+      bg_sideways = 1;
+
+   ic = ImageclassFind("STARTUP_BAR", 0);
+   if (!ic)
+      ic = ImageclassFind("DESKTOP_DRAGBUTTON_HORIZ", 0);
+   bg = FindItem("STARTUP_BACKGROUND", 0, LIST_FINDBY_NAME,
+                LIST_TYPE_BACKGROUND);
+   if (!ic || !bg)
+      return;
 
-       b1 = ECreateWindow(w1, 0, VRoot.h - Conf.desks.dragbar_width, VRoot.w,
-                          Conf.desks.dragbar_width, 0);
-       b2 = ECreateWindow(w2, 0, 0, VRoot.w, Conf.desks.dragbar_width, 0);
-       EMapRaised(b1);
-       EMapRaised(b2);
-
-       pq = Mode.queue_up;
-       Mode.queue_up = 0;
-       ImageclassApply(ic, b1, VRoot.w, Conf.desks.dragbar_width, 0, 0, 0, 0,
-                       ST_UNKNWN);
-       ImageclassApply(ic, b2, VRoot.w, Conf.desks.dragbar_width, 0, 0, 0, 0,
-                       ST_UNKNWN);
-       Mode.queue_up = pq;
-       BackgroundApply(bg, win1, 1);
-       BackgroundApply(bg, win2, 1);
-       BackgroundImagesFree(bg, 1);
-       init_win1 = w1;
-       init_win2 = w2;
-       EMapRaised(w1);
-       EMapRaised(w2);
+   if (bg_sideways)
+     {
+       w1 = ECreateWindow(VRoot.win, (VRoot.w / 2), 0, VRoot.w, VRoot.h, 1);
+       w2 = ECreateWindow(VRoot.win, -(VRoot.w / 2), 0, VRoot.w, VRoot.h, 1);
+       win1 = ECreateWindow(w1, -(VRoot.w / 2), 0, VRoot.w, VRoot.h, 0);
+       win2 = ECreateWindow(w2, (VRoot.w / 2), 0, VRoot.w, VRoot.h, 0);
      }
    else
      {
-       int                 k, x, y, xOffset, yOffset, ty, fy;
+       w1 = ECreateWindow(VRoot.win, 0, -(VRoot.h / 2), VRoot.w, VRoot.h, 1);
+       w2 = ECreateWindow(VRoot.win, 0, (VRoot.h / 2), VRoot.w, VRoot.h, 1);
+       win1 = ECreateWindow(w1, 0, (VRoot.h / 2), VRoot.w, VRoot.h, 0);
+       win2 = ECreateWindow(w2, 0, -(VRoot.h / 2), VRoot.w, VRoot.h, 0);
+     }
 
-       if ((!ic) || (!bg))
-          return;
+   EMapWindow(win1);
+   EMapWindow(win2);
 
-       fy = 0;
+   b1 = ECreateWindow(w1, 0, VRoot.h - Conf.desks.dragbar_width, VRoot.w,
+                     Conf.desks.dragbar_width, 0);
+   b2 = ECreateWindow(w2, 0, 0, VRoot.w, Conf.desks.dragbar_width, 0);
+   EMapRaised(b1);
+   EMapRaised(b2);
+
+   pq = Mode.queue_up;
+   Mode.queue_up = 0;
+   ImageclassApply(ic, b1, VRoot.w, Conf.desks.dragbar_width, 0, 0, 0, 0,
+                  ST_UNKNWN);
+   ImageclassApply(ic, b2, VRoot.w, Conf.desks.dragbar_width, 0, 0, 0, 0,
+                  ST_UNKNWN);
+   Mode.queue_up = pq;
+
+   BackgroundApply(bg, win1, 1);
+   BackgroundApply(bg, win2, 1);
+   BackgroundImagesFree(bg, 1);
+
+   init_win1 = w1;
+   init_win2 = w2;
+   EMapRaised(w1);
+   EMapRaised(w2);
+
+   eo = EobjRegister(w1, EOBJ_TYPE_OTHER);
+   EobjSetFloating(eo, 1);
+   EobjListStackRaise(eo);
+   eo = EobjRegister(w2, EOBJ_TYPE_OTHER);
+   EobjSetFloating(eo, 1);
+   EobjListStackRaise(eo);
+}
 
-       ETimedLoopInit(0, 1024, Conf.slidespeedcleanup / 2);
-       for (k = 0; k <= 1024;)
-         {
-            if (bg_sideways)
-              {                /* so we can have two different slide methods */
-                 ty = (VRoot.w / 2);
-                 xOffset = ((fy * (1024 - k)) + (ty * k)) >> 10;
-                 x = ty;
-                 yOffset = 0;
-                 y = 0;
-              }
-            else
-              {
-                 ty = (VRoot.h / 2);
-                 xOffset = 0;
-                 x = 0;
-                 yOffset = ((fy * (1024 - k)) + (ty * k)) >> 10;
-                 y = ty;
-              }
-
-            EMoveWindow(w1, x + xOffset, -y - yOffset);
-            EMoveWindow(w2, -x - xOffset, y + yOffset);
-            ecore_x_sync();
+void
+StartupWindowsOpen(void)
+{
+   int                 k, x, y, xOffset, yOffset, ty, fy;
+
+   if (init_win1 == None || init_win2 == None)
+      return;
+
+   fy = 0;
 
-            k = ETimedLoopNext();
+   ETimedLoopInit(0, 1024, Conf.slidespeedcleanup / 2);
+   for (k = 0; k <= 1024;)
+     {
+       if (bg_sideways)
+         {                     /* so we can have two different slide methods */
+            ty = (VRoot.w / 2);
+            xOffset = ((fy * (1024 - k)) + (ty * k)) >> 10;
+            x = ty;
+            yOffset = 0;
+            y = 0;
+         }
+       else
+         {
+            ty = (VRoot.h / 2);
+            xOffset = 0;
+            x = 0;
+            yOffset = ((fy * (1024 - k)) + (ty * k)) >> 10;
+            y = ty;
          }
 
-       EDestroyWindow(w1);
-       EDestroyWindow(w2);
-       init_win1 = 0;
-       init_win2 = 0;
+       EMoveWindow(init_win1, x + xOffset, -y - yOffset);
+       EMoveWindow(init_win2, -x - xOffset, y + yOffset);
+       ecore_x_sync();
 
-       BackgroundDestroyByName("STARTUP_BACKGROUND_SIDEWAYS");
-       BackgroundDestroyByName("STARTUP_BACKGROUND");
+       k = ETimedLoopNext();
      }
-}
 
-/* FIXME - should be handled via object stack */
-void
-StartupWindowsRaise(void)
-{
-   if (init_win1)
-     {
-       ERaiseWindow(init_win1);
-       ERaiseWindow(init_win2);
-     }
+   EobjUnregister(init_win1);
+   EobjUnregister(init_win2);
+   EDestroyWindow(init_win1);
+   EDestroyWindow(init_win2);
+   init_win1 = None;
+   init_win2 = None;
+
+   BackgroundDestroyByName("STARTUP_BACKGROUND_SIDEWAYS");
+   BackgroundDestroyByName("STARTUP_BACKGROUND");
 }




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to