tasn pushed a commit to branch master.

http://git.enlightenment.org/bindings/cxx/eflxx.git/commit/?id=a077647bd13ecbef7a8ff0794bf2899785989431

commit a077647bd13ecbef7a8ff0794bf2899785989431
Author: Andreas Volz <[email protected]>
Date:   Sun Mar 6 08:33:13 2011 +0000

    Timer API sync
    
    
    SVN revision: 57538
---
 eflxx_examples/src/ecorexx/3dstars/main.cpp               |  2 +-
 eflxx_examples/src/ecorexx/callbacks/main.cpp             | 11 ++++++-----
 eflxx_examples/src/ecorexx/stars/main.cpp                 |  2 +-
 eflxx_examples/src/ecorexx/timers/main.cpp                | 14 ++++++++++----
 eflxx_examples/src/elementaryxx/full/test_progressbar.cpp |  5 +++--
 5 files changed, 21 insertions(+), 13 deletions(-)

diff --git a/eflxx_examples/src/ecorexx/3dstars/main.cpp 
b/eflxx_examples/src/ecorexx/3dstars/main.cpp
index a8792af..9658997 100644
--- a/eflxx_examples/src/ecorexx/3dstars/main.cpp
+++ b/eflxx_examples/src/ecorexx/3dstars/main.cpp
@@ -78,7 +78,7 @@ typedef list<Star*> Starfield;
 typedef list<Star*>::iterator StarfieldIterator;
 Starfield starfield;
 
-void advance( Ecorexx::Timer* e )
+void advance()
 {
   for (StarfieldIterator it = starfield.begin(); it != starfield.end(); ++it )
   {
diff --git a/eflxx_examples/src/ecorexx/callbacks/main.cpp 
b/eflxx_examples/src/ecorexx/callbacks/main.cpp
index 1d5c549..f35ebde 100644
--- a/eflxx_examples/src/ecorexx/callbacks/main.cpp
+++ b/eflxx_examples/src/ecorexx/callbacks/main.cpp
@@ -25,7 +25,8 @@ public:
       xstep( 2*PI/360 ), ystep( 2*PI/360 ),
       size( BALLSIZE ), direction( -1 ),
       alpha( 0 ), alphadirection( 1 ),
-      xaddfactor( 1 ), yaddfactor( 1 )
+      xaddfactor( 1 ), yaddfactor( 1 ),
+      ecoreTimer (NULL)
   {
     Ecorexx::EvasWindowSoftwareX11* mw = new Ecorexx::EvasWindowSoftwareX11( 
size );
     Evasxx::Canvas &evas = mw->getCanvas();
@@ -55,7 +56,8 @@ public:
       balls[i]->show();
     }
 
-    startTimer( 1.0 / 25 );
+    ecoreTimer = new Ecorexx::Timer( 1.0 / 25 );
+    ecoreTimer->timeout.connect( sigc::mem_fun( this, &TimerApp::timerEvent ) 
);
 
     mw->show();
   }
@@ -72,8 +74,9 @@ public:
   int alphadirection;
   double xaddfactor;
   double yaddfactor;
+  Ecorexx::Timer* ecoreTimer;
 
-  virtual bool timerEvent()
+  void timerEvent()
   {
 
     logo->setColor( Color (255, 255, 255, alpha) );
@@ -97,8 +100,6 @@ public:
       xaddfactor = -2 + (4.0*rand()/(RAND_MAX));
       yaddfactor = -2 + (4.0*rand()/(RAND_MAX));
     }
-
-    return true; // call me again, please
   }
 
 };
diff --git a/eflxx_examples/src/ecorexx/stars/main.cpp 
b/eflxx_examples/src/ecorexx/stars/main.cpp
index 5dcbdac..48f5e7b 100644
--- a/eflxx_examples/src/ecorexx/stars/main.cpp
+++ b/eflxx_examples/src/ecorexx/stars/main.cpp
@@ -19,7 +19,7 @@ Starfield starfield;
 
 int width = 0;
 
-void advance( Ecorexx::Timer* e )
+void advance( )
 {
   for (StarfieldIterator it = starfield.begin(); it != starfield.end(); ++it )
   {
diff --git a/eflxx_examples/src/ecorexx/timers/main.cpp 
b/eflxx_examples/src/ecorexx/timers/main.cpp
index 90d2358..7f02082 100644
--- a/eflxx_examples/src/ecorexx/timers/main.cpp
+++ b/eflxx_examples/src/ecorexx/timers/main.cpp
@@ -26,7 +26,8 @@ public:
       xstep( 2*PI/360 ), ystep( 2*PI/360 ),
       size( BALLSIZE ), direction( -1 ),
       alpha( 0 ), alphadirection( 1 ),
-      xaddfactor( 1 ), yaddfactor( 1 )
+      xaddfactor( 1 ), yaddfactor( 1 ),
+      ecoreTimer (NULL)
   {
     Ecorexx::EvasWindowSoftwareX11* mw = new Ecorexx::EvasWindowSoftwareX11( 
Size (WIDTH, HEIGHT) );
     Evasxx::Canvas &evas = mw->getCanvas();
@@ -54,7 +55,8 @@ public:
       balls[i]->show();
     }
 
-    startTimer( 1.0 / 25 );
+    ecoreTimer = new Ecorexx::Timer( 1.0 / 25 );
+    ecoreTimer->timeout.connect( sigc::mem_fun( this, &TimerApp::timerEvent ) 
);
 
     mw->show();
   }
@@ -72,8 +74,9 @@ public:
   int alphadirection;
   double xaddfactor;
   double yaddfactor;
+  Ecorexx::Timer* ecoreTimer;
 
-  virtual bool timerEvent()
+  void timerEvent()
   {
 
     logo->setColor( Color (255, 255, 255, alpha) );
@@ -97,8 +100,11 @@ public:
       xaddfactor = -2 + (4.0*rand()/(RAND_MAX));
       yaddfactor = -2 + (4.0*rand()/(RAND_MAX));
     }
+  }
 
-    return true; // call me again, please
+  ~TimerApp ()
+  {
+    delete ecoreTimer;
   }
 
 };
diff --git a/eflxx_examples/src/elementaryxx/full/test_progressbar.cpp 
b/eflxx_examples/src/elementaryxx/full/test_progressbar.cpp
index 729b2ab..b836c85 100644
--- a/eflxx_examples/src/elementaryxx/full/test_progressbar.cpp
+++ b/eflxx_examples/src/elementaryxx/full/test_progressbar.cpp
@@ -17,7 +17,7 @@ typedef struct _MyProgressbar
 
 static MyProgressbar _test_progressbar;
 
-static void _my_progressbar_value_set (Ecorexx::Timer *timer)
+static void _my_progressbar_value_set ()
 {
   double progress;
 
@@ -40,7 +40,8 @@ static void _my_progressbar_value_set (Ecorexx::Timer *timer)
   if (progress > 1.0)
   {
     _test_progressbar.run = false;
-    timer->del ();
+    //timer->del ();
+    // FIXME: new design offern no timers pointer!
   }
 }
 

-- 


Reply via email to