gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog gui/Player.cpp gui/Player.h gui...


From: Benjamin Wolsey
Subject: [Gnash-commit] gnash ChangeLog gui/Player.cpp gui/Player.h gui...
Date: Mon, 10 Mar 2008 20:07:06 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Benjamin Wolsey <bwy>   08/03/10 20:07:06

Modified files:
        .              : ChangeLog 
        gui            : Player.cpp Player.h gnash.cpp gui.cpp gui.h 

Log message:
                * gui/gui{h.cpp}: allow exiting after a set number of advances.
                * gui/Player.{h.cpp}: same.
                * gui/gnash.cpp: add switch (-m) for setting max advances. This
                  will probably be changed soon to a long option. Drop unused
                  switches and code.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5861&r2=1.5862
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/Player.cpp?cvsroot=gnash&r1=1.85&r2=1.86
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/Player.h?cvsroot=gnash&r1=1.25&r2=1.26
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gnash.cpp?cvsroot=gnash&r1=1.104&r2=1.105
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gui.cpp?cvsroot=gnash&r1=1.137&r2=1.138
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gui.h?cvsroot=gnash&r1=1.78&r2=1.79

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5861
retrieving revision 1.5862
diff -u -b -r1.5861 -r1.5862
--- ChangeLog   10 Mar 2008 19:39:34 -0000      1.5861
+++ ChangeLog   10 Mar 2008 20:07:05 -0000      1.5862
@@ -3,6 +3,11 @@
        * doc/C/usermanual/gnashrc.xml: add information about ignoreFSCommands
          directive.
        * doc/C/refmanual/internals.xml: correct typo.
+       * gui/gui{h.cpp}: allow exiting after a set number of advances.
+       * gui/Player.{h.cpp}: same.
+       * gui/gnash.cpp: add switch (-m) for setting max advances. This
+         will probably be changed soon to a long option. Drop unused
+         switches and code.
 
 2008-03-10 Sandro Santilli <address@hidden>
 

Index: gui/Player.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/Player.cpp,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -b -r1.85 -r1.86
--- gui/Player.cpp      10 Mar 2008 10:32:09 -0000      1.85
+++ gui/Player.cpp      10 Mar 2008 20:07:05 -0000      1.86
@@ -84,7 +84,8 @@
        _doRender(true),
        _doSound(true),
        _exitTimeout(0),
-       _movieDef(0)
+       _movieDef(0),
+       _maxAdvances(0)
 #ifdef GNASH_FPS_DEBUG
        ,_fpsDebugTime(0.0)
 #endif
@@ -190,6 +191,8 @@
                _gui.reset(new NullGui(_doLoop));
        }
 
+    _gui->setMaxAdvances(_maxAdvances);
+
 #ifdef GNASH_FPS_DEBUG
        if ( _fpsDebugTime )
        {
@@ -410,15 +413,17 @@
        
        if (rcfile.ignoreFSCommand()) return;
 
-       if (command == "quit")
+       StringNoCaseEqual noCaseCompare;
+
+       if (noCaseCompare(command, "quit"))
        {
                _gui->quit();
        }
 
-       if (command == "fullscreen")
+       if (noCaseCompare(command, "fullscreen"))
        {
-               if (args == "true")     _gui->setFullscreen();
-               else if (args == "false") _gui->unsetFullscreen();
+               if (noCaseCompare(args, "true")) _gui->setFullscreen();
+               else if (noCaseCompare(args, "false")) _gui->unsetFullscreen();
                return;
        }
 

Index: gui/Player.h
===================================================================
RCS file: /sources/gnash/gnash/gui/Player.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- gui/Player.h        10 Mar 2008 10:32:09 -0000      1.25
+++ gui/Player.h        10 Mar 2008 20:07:05 -0000      1.26
@@ -107,6 +107,8 @@
 
        void setDoSound(bool b) { _doSound = b; }
 
+       void setMaxAdvances(unsigned long ul) { if (ul > 0) _maxAdvances = ul; }
+
        /// Set the base url for this run.
        //
        /// The base url will be used to resolve relative
@@ -191,6 +193,8 @@
 
        movie_definition* _movieDef;
 
+       unsigned long _maxAdvances;
+
        /// Load the "_infile" movie setting it's url to "_url"
        // 
        /// This function takes care of interpreting _infile as

Index: gui/gnash.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/gnash.cpp,v
retrieving revision 1.104
retrieving revision 1.105
diff -u -b -r1.104 -r1.105
--- gui/gnash.cpp       3 Mar 2008 16:52:29 -0000       1.104
+++ gui/gnash.cpp       10 Mar 2008 20:07:05 -0000      1.105
@@ -108,21 +108,18 @@
         "  -v            Be verbose; i.e. print log messages to stdout\n"
                ),
 #if VERBOSE_ACTION
-      _("  -va           Be verbose about movie Actions\n"),
+      _("  -va           Be (very) verbose about parsing\n"),
 #else
        "",
 #endif
 #if VERBOSE_PARSE
-      _("  -vp           Be verbose about parsing the movie\n"),
+      _("  -vp           Be (very) verbose about action execution\n"),
 #else
        "",
 #endif
                  _(
-        "  -m <bias>     Specify the texture LOD bias (float, default is 
-1.0)\n"
         "  -x <ID>       X11 Window ID for display\n"
         "  -v            Produce verbose output\n"
-        "  -vp           Be (very) verbose about parsing\n"
-        "  -va           Be (very) verbose about action execution\n"
         "  -w            Produce the disk based debug log\n"
        "  -j <width >   Set window width\n"
        "  -k <height>   Set window height\n"
@@ -136,7 +133,6 @@
         "                3 enables both rendering & sound (default)\n"
                ), _(
         "  -t <sec>      Timeout and exit after the specified number of 
seconds\n"
-        //"  -b <bits>     Bit depth of output window (16 or 32, default is 
16)\n"
         "  -u <url>      Set \"real\" url of the movie\n"
        "                (useful for downloaded movies)\n"
         "  -U <url>      Set \"base\" url for this run\n"
@@ -163,8 +159,6 @@
 
        "  CTRL-L          Force immediate redraw\n"
 /*
-        "  CTRL-B          Toggle background color\n"  // No code to make this 
work or indication
-                                                      // what it's supposed to 
do.
         "  CTRL-A          Toggle antialiasing (doesn't work)\n"
         "  CTRL-T          Debug.  Test the set_variable() function\n"
         "  CTRL-G          Debug.  Test the get_variable() function\n"
@@ -228,7 +222,7 @@
         }
     }
     
-    while ((c = getopt (argc, argv, "hvaps:cd:x:r:t:b:1wj:k:u:P:U:gVf:F:")) != 
-1)
+    while ((c = getopt (argc, argv, "hvaps:m:cd:x:r:t:1wj:k:u:P:U:gVf:F:")) != 
-1)
     {
        switch (c) {
          // case 'c' (Disable SDL core dumps) is decoded in sdl.cpp:init()
@@ -265,6 +259,9 @@
               log_error (_("No verbose parsing; disabled at compile time"));
 #endif
              break;
+             case 'm':
+                 player.setMaxAdvances( strtoul(optarg, NULL, 0) );
+                 break;
           case 's':
               player.setScale( fclamp((float) atof(optarg), 0.01f, 100.f) );
               break;
@@ -350,9 +347,6 @@
           case 't':
               player.setExitTimeout( (float) atof(optarg) );
               break;
-//          case 'b':
-//           player.setBitDepth(atoi(optarg));
-//           break;
           case 'f':
 #ifdef GNASH_FPS_DEBUG
                player.setFpsPrintTime((float)strtod(optarg, NULL));

Index: gui/gui.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/gui.cpp,v
retrieving revision 1.137
retrieving revision 1.138
diff -u -b -r1.137 -r1.138
--- gui/gui.cpp 10 Mar 2008 10:32:09 -0000      1.137
+++ gui/gui.cpp 10 Mar 2008 20:07:06 -0000      1.138
@@ -92,7 +92,8 @@
     _renderer(NULL),
     _redraw_flag(true),
     _fullscreen(false),
-    _mouseShown(true)
+    _mouseShown(true),
+    _maxAdvances(0)
 #ifdef GNASH_FPS_DEBUG
     ,fps_counter(0)
     ,fps_counter_total(0)
@@ -128,7 +129,9 @@
     _interval(0),
     _renderer(NULL),
     _redraw_flag(true),
-    _fullscreen(false)
+    _fullscreen(false),
+    _mouseShown(true),
+    _maxAdvances(0)
 #ifdef GNASH_FPS_DEBUG
     ,fps_counter(0)    
     ,fps_counter_total(0)    
@@ -707,13 +710,14 @@
     bool background = true; // ??
     _stage->set_background_alpha(background ? 1.0f : 0.05f);
 
-
     _started = true;
 }
 
 bool
 Gui::advanceMovie()
 {
+    static unsigned long advances = 0;
+
        if ( isStopped() ) return true;
 
     if ( ! _started ) start();
@@ -799,6 +803,12 @@
                }
        }
 
+    /// Quit if we've reached the advance limit.
+    if (_maxAdvances && (advances++ > _maxAdvances))
+    {
+        quit();
+    }
+
        return true;
 }
 

Index: gui/gui.h
===================================================================
RCS file: /sources/gnash/gnash/gui/gui.h,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -b -r1.78 -r1.79
--- gui/gui.h   10 Mar 2008 10:32:10 -0000      1.78
+++ gui/gui.h   10 Mar 2008 20:07:06 -0000      1.79
@@ -268,6 +268,8 @@
     /// Whether gnash is is running as a plugin
     bool isPlugin() const { return (( _xid )); }
 
+    void setMaxAdvances(unsigned long ul) { if (ul > 0) _maxAdvances = ul; }
+
     /** @name Menu callbacks
      *  These callbacks will be called when a menu item is clicked.
      *  @{
@@ -373,6 +375,8 @@
     bool               _fullscreen;
     // True if mouse pointer is showing
     bool               _mouseShown;
+    // Maximum number of advances before exit; 0 for no limit.
+    unsigned long _maxAdvances;
 
 private:
 




reply via email to

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