Enlightenment CVS committal
Author : kwo
Project : e16
Module : e
Dir : e16/e/src
Modified Files:
startup.c
Log Message:
Use animator to slide startup windows.
===================================================================
RCS file: /cvs/e/e16/e/src/startup.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -3 -r1.74 -r1.75
--- startup.c 17 Jan 2007 01:10:43 -0000 1.74
+++ startup.c 29 Jan 2007 01:40:38 -0000 1.75
@@ -115,63 +115,47 @@
EobjsRepaint();
}
-#define TIME_STEP 0.01
-
-static void
-doStartupWindowsOpen(int val, void *data __UNUSED__)
+static int
+doStartupWindowsOpen(void *data __UNUSED__)
{
+ static int kk = 0;
int k, x, y, xOffset, yOffset, ty;
- k = val;
+ k = kk;
-#define TEST_STARTUP_USING_TIMER 1
-#if !TEST_STARTUP_USING_TIMER
- ETimedLoopInit(0, 1024, Conf.desks.slidespeed / 2);
- for (k = 0; k <= 1024;)
+ if (bg_sideways)
+ { /* so we can have two different slide methods */
+ ty = (VRoot.w / 2);
+ xOffset = (ty * k) >> 10;
+ x = ty;
+ yOffset = 0;
+ y = 0;
+ }
+ else
{
-#endif
- if (bg_sideways)
- { /* so we can have two different slide methods */
- ty = (VRoot.w / 2);
- xOffset = (ty * k) >> 10;
- x = ty;
- yOffset = 0;
- y = 0;
- }
- else
- {
- ty = (VRoot.h / 2);
- xOffset = 0;
- x = 0;
- 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();
+ ty = (VRoot.h / 2);
+ xOffset = 0;
+ x = 0;
+ yOffset = (ty * k) >> 10;
+ y = ty;
}
-#endif
-#if TEST_STARTUP_USING_TIMER
- ESync();
- k = (int)(TIME_STEP * Conf.desks.slidespeed / 2);
+ EobjMove(init_win1, -x - xOffset, -y - yOffset);
+ EobjMove(init_win2, x + xOffset, y + yOffset);
+
+ k = (int)(1e-3 * Conf.animation.step * Conf.desks.slidespeed / 2);
if (k <= 0)
k = 1;
- val += k;
- if (val < 1024)
- {
- DoIn("Startup", TIME_STEP, doStartupWindowsOpen, val, NULL);
- return;
- }
-#endif
+ kk += k;
+ if (kk < 1024)
+ return 1;
EobjWindowDestroy(init_win1);
EobjWindowDestroy(init_win2);
init_win1 = NULL;
init_win2 = NULL;
+
+ return 0;
}
void
@@ -180,5 +164,6 @@
if (init_win1 == NULL || init_win2 == NULL)
return;
- doStartupWindowsOpen(0, NULL);
+ ESync();
+ AnimatorAdd(doStartupWindowsOpen, NULL);
}
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs