gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] [SCM] Gnash branch, master, updated. 586ebf4371c8bc6178c4


From: Sandro Santilli
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. 586ebf4371c8bc6178c48c517480cae293572117
Date: Sat, 06 Nov 2010 11:34:03 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  586ebf4371c8bc6178c48c517480cae293572117 (commit)
      from  6424f0a31d094f2c63b87d06a7405e822d015bee (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=586ebf4371c8bc6178c48c517480cae293572117


commit 586ebf4371c8bc6178c48c517480cae293572117
Author: Sandro Santilli <address@hidden>
Date:   Sat Nov 6 12:33:42 2010 +0100

    Add support for --timeout in fb-gui

diff --git a/gui/fb/fb.cpp b/gui/fb/fb.cpp
index f8eb021..23d74dc 100644
--- a/gui/fb/fb.cpp
+++ b/gui/fb/fb.cpp
@@ -190,7 +190,8 @@ FBGui::FBGui(unsigned long xid, float scale, bool loop, 
RunResources& r)
       buffer(0),                // the real value is set by 
ENABLE_DOUBLE_BUFFERING
       m_stage_width(0),
       m_stage_height(0),
-      m_rowsize(0)
+      m_rowsize(0),
+      _timeout(0)
 {
     // initializing to zero helps with debugging and prevents weird bugs
 //    memset(mouse_buf, 0, 256);
@@ -390,22 +391,13 @@ bool
 FBGui::run()
 {
     GNASH_REPORT_FUNCTION;
-
-    struct timeval tv;
-
-    double start_timer;
   
 #ifdef USE_TSLIB
     int ts_loop_count;
 #endif
+
+    VirtualClock& timer = getClock();
     
-    if (!gettimeofday(&tv, NULL)) {
-        start_timer = static_cast<double>(tv.tv_sec) +
-            static_cast<double>(tv.tv_usec) / 1000000.0;
-    } else {
-        start_timer = 0.0;
-    }  
-  
     // let the GUI recompute the x/y scale factors to best fit the whole screen
     resize_view(_validbounds.width(), _validbounds.height());
 
@@ -426,6 +418,11 @@ FBGui::run()
         
         // advance movie  
         Gui::advance_movie(this);
+
+        // check if we've reached a timeout
+        if (_timeout && timer.elapsed() >= _timeout ) {
+            break;
+        }
     }
   
     return true;
@@ -497,9 +494,9 @@ FBGui::setInterval(unsigned int interval)
 }
 
 void
-FBGui::setTimeout(unsigned int /*timeout*/)
+FBGui::setTimeout(unsigned int timeout)
 {
-
+    _timeout = timeout;
 }
 
 void
diff --git a/gui/fb/fbsup.h b/gui/fb/fbsup.h
index e5f7d93..8ff1f10 100644
--- a/gui/fb/fbsup.h
+++ b/gui/fb/fbsup.h
@@ -108,6 +108,8 @@ private:
 
     struct fb_var_screeninfo var_screeninfo;
     struct fb_fix_screeninfo fix_screeninfo;
+
+    unsigned int _timeout; /* TODO: should we move this to base class ? */
     
     /// For 8 bit (palette / LUT) modes, sets a grayscale palette.
     //

-----------------------------------------------------------------------

Summary of changes:
 gui/fb/fb.cpp  |   25 +++++++++++--------------
 gui/fb/fbsup.h |    2 ++
 2 files changed, 13 insertions(+), 14 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

[Prev in Thread] Current Thread [Next in Thread]