[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog gui/NullGui.cpp gui/NullGui.h
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog gui/NullGui.cpp gui/NullGui.h |
Date: |
Tue, 19 Jun 2007 21:59:00 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/06/19 21:59:00
Modified files:
. : ChangeLog
gui : NullGui.cpp NullGui.h
Log message:
* gui/NullGui.{cpp,h}: implement setTimeout
call. fixes bug #20118.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3584&r2=1.3585
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/NullGui.cpp?cvsroot=gnash&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/NullGui.h?cvsroot=gnash&r1=1.9&r2=1.10
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3584
retrieving revision 1.3585
diff -u -b -r1.3584 -r1.3585
--- ChangeLog 19 Jun 2007 18:42:49 -0000 1.3584
+++ ChangeLog 19 Jun 2007 21:58:59 -0000 1.3585
@@ -1,5 +1,10 @@
2007-06-19 Sandro Santilli <address@hidden>
+ * gui/NullGui.{cpp,h}: implement setTimeout
+ call. fixes bug #20118.
+
+2007-06-19 Sandro Santilli <address@hidden>
+
* server/sprite_instance.h: document another
reachable resource (was marked already, just not documented
as such).
Index: gui/NullGui.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/NullGui.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- gui/NullGui.cpp 28 May 2007 15:40:59 -0000 1.6
+++ gui/NullGui.cpp 19 Jun 2007 21:59:00 -0000 1.7
@@ -32,15 +32,41 @@
# include <unistd.h> // for usleep
#endif
+#include <sys/time.h> // for gettimeofday
+#include <time.h> // for gettimeofday
+#include <errno.h> // for reporting gettimeofday errors
+
namespace gnash
{
bool
NullGui::run()
{
+ struct timeval tv;
+
+
+ if (gettimeofday(&tv, NULL))
+ {
+ cerr << "Could not get time of day: " << strerror(errno) <<
endl;
+ return false;
+ }
+ unsigned long int start_timer = tv.tv_sec*1000 + tv.tv_usec / 1000;
+
while (true)
{
+ if (gettimeofday(&tv, NULL))
+ {
+ cerr << "Could not get time of day: " <<
strerror(errno) << endl;
+ return false;
+ }
+ unsigned long int timer = tv.tv_sec*1000 + tv.tv_usec / 1000;
+ if ( timer - start_timer > _timeout)
+ {
+ break;
+ }
+
// sleep for _interval milliseconds
+ // TODO: use the timer value to trigger advances
usleep(_interval*1000);
Gui::advance_movie(this);
}
Index: gui/NullGui.h
===================================================================
RCS file: /sources/gnash/gnash/gui/NullGui.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- gui/NullGui.h 28 May 2007 15:40:59 -0000 1.9
+++ gui/NullGui.h 19 Jun 2007 21:59:00 -0000 1.10
@@ -46,8 +46,9 @@
{
_interval=interval;
}
- void setTimeout(unsigned int)
+ void setTimeout(unsigned int to)
{
+ _timeout=to;
}
bool init(int, char ***) { return true; }
bool createWindow(const char* /*title*/, int /*width*/, int /*height*/)
@@ -58,6 +59,11 @@
bool createMenu() { return true; }
bool setupEvents() { return true; }
void renderBuffer() { }
+
+private:
+
+ /// timeout value, in milliseconds
+ unsigned int _timeout;
};
} // end of gnash namespace
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog gui/NullGui.cpp gui/NullGui.h,
Sandro Santilli <=