Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        startup.c 


Log Message:
Use timer events for startup windows.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/startup.c,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -3 -r1.62 -r1.63
--- startup.c   16 Oct 2005 13:59:52 -0000      1.62
+++ startup.c   18 Oct 2005 19:51:14 -0000      1.63
@@ -25,7 +25,6 @@
 #include "eobj.h"
 #include "iclass.h"
 #include "xwin.h"
-#include <time.h>
 
 static EObj        *init_win1 = NULL;
 static EObj        *init_win2 = NULL;
@@ -81,7 +80,7 @@
       return;
    init_win1 = eo;
    w1 = eo->win;
-   eo->fade = 0;
+   eo->fade = eo->shadow = 0;
    win1 = ECreateWindow(w1, x, y, VRoot.w, VRoot.h, 0);
 
    eo = EobjWindowCreate(EOBJ_TYPE_MISC, x, y, VRoot.w, VRoot.h, 1, "Init-2");
@@ -89,7 +88,7 @@
       return;
    init_win2 = eo;
    w2 = eo->win;
-   eo->fade = 0;
+   eo->fade = eo->shadow = 0;
    win2 = ECreateWindow(w2, -x, -y, VRoot.w, VRoot.h, 0);
 
    EMapWindow(win1);
@@ -116,23 +115,25 @@
    EobjsRepaint();
 }
 
-void
-StartupWindowsOpen(void)
-{
-   int                 k, x, y, xOffset, yOffset, ty, fy;
+#define TIME_STEP 0.01
 
-   if (init_win1 == None || init_win2 == None)
-      return;
+static void
+doStartupWindowsOpen(int val, void *data __UNUSED__)
+{
+   int                 k, x, y, xOffset, yOffset, ty;
 
-   fy = 0;
+   k = val;
 
+#define TEST_STARTUP_USING_TIMER 1
+#if !TEST_STARTUP_USING_TIMER
    ETimedLoopInit(0, 1024, Conf.desks.slidespeed / 2);
    for (k = 0; k <= 1024;)
      {
+#endif
        if (bg_sideways)
          {                     /* so we can have two different slide methods */
             ty = (VRoot.w / 2);
-            xOffset = ((fy * (1024 - k)) + (ty * k)) >> 10;
+            xOffset = (ty * k) >> 10;
             x = ty;
             yOffset = 0;
             y = 0;
@@ -142,15 +143,30 @@
             ty = (VRoot.h / 2);
             xOffset = 0;
             x = 0;
-            yOffset = ((fy * (1024 - k)) + (ty * k)) >> 10;
+            yOffset = (ty * k) >> 10;
             y = ty;
          }
 
        EobjMove(init_win1, -x - xOffset, -y - yOffset);
        EobjMove(init_win2, x + xOffset, y + yOffset);
 
+#if !TEST_STARTUP_USING_TIMER
        k = ETimedLoopNext();
      }
+#endif
+
+#if TEST_STARTUP_USING_TIMER
+   ESync();
+   k = TIME_STEP * Conf.desks.slidespeed / 2;
+   if (k <= 0)
+      k = 1;
+   val += k;
+   if (val < 1024)
+     {
+       DoIn("Startup", TIME_STEP, doStartupWindowsOpen, val, NULL);
+       return;
+     }
+#endif
 
    EobjWindowDestroy(init_win1);
    EobjWindowDestroy(init_win2);
@@ -160,3 +176,12 @@
    BackgroundDestroyByName("STARTUP_BACKGROUND_SIDEWAYS");
    BackgroundDestroyByName("STARTUP_BACKGROUND");
 }
+
+void
+StartupWindowsOpen(void)
+{
+   if (init_win1 == None || init_win2 == None)
+      return;
+
+   doStartupWindowsOpen(0, NULL);
+}




-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to