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 server/vm/VM.cpp...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog gui/Player.cpp server/vm/VM.cpp...
Date: Fri, 07 Sep 2007 00:11:27 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/09/07 00:11:27

Modified files:
        .              : ChangeLog 
        gui            : Player.cpp 
        server/vm      : VM.cpp VM.h 
        testsuite      : MovieTester.cpp 
        testsuite/server: DisplayListTest.cpp GetterSetterTest.cpp 
                          PropertyListTest.cpp 
        utilities      : processor.cpp 

Log message:
                * server/vm/VM.{cpp,h}: change the VM::init() functionality
                  to NOT instantiate the movie definition. This is propedeutic
                  for a cleanup in movie_instance construction, which will be
                  performed by movie_root::setLevel in next patch.
                * gui/Player.cpp, testsuite/MovieTester.cpp,
                  testsuite/server/DisplayListTest.cpp,
                  testsuite/server/GetterSetterTest.cpp,
                  testsuite/server/PropertyListTest.cpp,
                  utilities/processor.cpp:
                  Update VM & stage (movie_root) initialization calls
                  to take into account VM::init() semantic change.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4240&r2=1.4241
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/Player.cpp?cvsroot=gnash&r1=1.65&r2=1.66
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/VM.cpp?cvsroot=gnash&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/VM.h?cvsroot=gnash&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/MovieTester.cpp?cvsroot=gnash&r1=1.46&r2=1.47
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/server/DisplayListTest.cpp?cvsroot=gnash&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/server/GetterSetterTest.cpp?cvsroot=gnash&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/server/PropertyListTest.cpp?cvsroot=gnash&r1=1.16&r2=1.17
http://cvs.savannah.gnu.org/viewcvs/gnash/utilities/processor.cpp?cvsroot=gnash&r1=1.62&r2=1.63

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4240
retrieving revision 1.4241
diff -u -b -r1.4240 -r1.4241
--- ChangeLog   6 Sep 2007 18:59:51 -0000       1.4240
+++ ChangeLog   7 Sep 2007 00:11:25 -0000       1.4241
@@ -1,3 +1,17 @@
+2007-09-07 Sandro Santilli <address@hidden>
+
+       * server/vm/VM.{cpp,h}: change the VM::init() functionality
+         to NOT instantiate the movie definition. This is propedeutic
+         for a cleanup in movie_instance construction, which will be
+         performed by movie_root::setLevel in next patch.
+       * gui/Player.cpp, testsuite/MovieTester.cpp,
+         testsuite/server/DisplayListTest.cpp,
+         testsuite/server/GetterSetterTest.cpp,
+         testsuite/server/PropertyListTest.cpp,
+         utilities/processor.cpp:
+         Update VM & stage (movie_root) initialization calls
+         to take into account VM::init() semantic change.
+
 2007-09-06 Sandro Santilli <address@hidden>
 
        * testsuite/misc-ming.all/action_execution_order_test4.c: more

Index: gui/Player.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/Player.cpp,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -b -r1.65 -r1.66
--- gui/Player.cpp      31 Jul 2007 19:29:42 -0000      1.65
+++ gui/Player.cpp      7 Sep 2007 00:11:26 -0000       1.66
@@ -312,7 +312,9 @@
     _gui->createWindow(_url.c_str(), width, height);
 
     movie_root& root = VM::init(*_movie_def).getRoot();
-    sprite_instance* m = root.get_root_movie();
+
+    std::auto_ptr<movie_instance> mr ( _movie_def->create_movie_instance() );
+    sprite_instance* m = mr.get();
 
     // Start loader thread
     _movie_def->completeLoad();
@@ -336,6 +338,7 @@
     // Parse querystring
     setFlashVars(*m, URL(_url).querystring());
 
+    root.setRootMovie( mr.release() ); // will construct the instance
     root.set_display_viewport(0, 0, width, height);
     root.set_background_alpha(background ? 1.0f : 0.05f);
 

Index: server/vm/VM.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/vm/VM.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- server/vm/VM.cpp    19 Aug 2007 20:01:13 -0000      1.15
+++ server/vm/VM.cpp    7 Sep 2007 00:11:26 -0000       1.16
@@ -16,7 +16,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: VM.cpp,v 1.15 2007/08/19 20:01:13 strk Exp $ */
+/* $Id: VM.cpp,v 1.16 2007/09/07 00:11:26 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -51,10 +51,6 @@
 
        assert(_singleton.get());
 
-       std::auto_ptr<movie_instance> inst ( movie.create_movie_instance() );
-       assert(inst.get()); // or an invalid movie_definition was given
-       _singleton->setRoot(inst.release()); // transfer ownership
-
        _singleton->setGlobal(new Global(*_singleton));
        assert(_singleton->getGlobal());
 
@@ -77,6 +73,7 @@
 
 VM::VM(movie_definition& topmovie)
        :
+       _root_movie(new movie_root()),
        _swfversion(topmovie.get_version()),
        _start_time(tu_timer::get_ticks())
 {
@@ -119,15 +116,6 @@
        return *_root_movie;
 }
 
-/*private*/
-void
-VM::setRoot(movie_instance* root)
-{
-       assert(!_root_movie.get());
-       _root_movie.reset(new movie_root());
-       _root_movie->setRootMovie(root);
-}
-
 /*public*/
 as_object*
 VM::getGlobal() const

Index: server/vm/VM.h
===================================================================
RCS file: /sources/gnash/gnash/server/vm/VM.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- server/vm/VM.h      5 Aug 2007 19:29:37 -0000       1.14
+++ server/vm/VM.h      7 Sep 2007 00:11:26 -0000       1.15
@@ -66,7 +66,7 @@
 /// the operation, as depending on that version the Virtual
 /// Machine acts differently, for backward compatibility.
 /// 
-/// The VM is initialized once for each *main* movie.
+/// The VM is initialized once for each "stage" (main movie).
 /// Gnash currently only supports a *single* VM as it uses
 /// gloabls a lot. Definition of this class is aimed at
 /// grouping the globals into a specific VM instance that
@@ -100,10 +100,7 @@
        friend class std::auto_ptr<VM>;
        static std::auto_ptr<VM> _singleton;
 
-       /// \brief
-       /// Root movie, will be instantiated from the definition
-       /// given to the init() function.
-       ///
+       /// Stage associated with this VM
        std::auto_ptr<movie_root> _root_movie;
 
        /// The _global ActionScript object
@@ -115,12 +112,6 @@
        /// Time when the VM get started
        uint64_t _start_time;
 
-       /// Set the current Root movie.
-       //
-       /// Will be called by the init() function
-       ///
-       void setRoot(movie_instance*);
-
        /// Set the _global Object for actions run by Virtual Machine
        //
        /// Will be called by the init() function
@@ -142,19 +133,15 @@
        /// Initialize the virtual machine singleton with the given
        /// movie definition and return a reference to it.
        //
-       /// An instance of the given movie will become the absolute
-       /// root of the application (ActionScript's _level0)
+       /// The given movie will be only used to fetch SWF version from.
        ///
        /// Don't call this function twice, and make sure you have
        /// called this *before* you call VM::get()
        ///
        /// @param movie
-       ///     The definition for the root movie.
-       ///     It is required that the given definition's
-       ///     create_movie_instance() method returns
-       ///     not NULL, or an assertion will fail.
-       ///     See movie_definition::create_root_instance()
-       ///     for more info.
+       ///     The definition for the root movie, only
+       ///     used to fetch SWF version from.
+       ///     TODO: take SWF version directly ?
        ///
        static VM& init(movie_definition& movie);
 
@@ -186,7 +173,7 @@
        ///
        const std::string& getPlayerVersion() const;
 
-       /// Get a pointer to this VM's Root movie 
+       /// Get a pointer to this VM's Root movie (stage)
        movie_root& getRoot() const;
 
        /// Get a pointer to this VM's _global Object

Index: testsuite/MovieTester.cpp
===================================================================
RCS file: /sources/gnash/gnash/testsuite/MovieTester.cpp,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -b -r1.46 -r1.47
--- testsuite/MovieTester.cpp   29 Aug 2007 17:54:10 -0000      1.46
+++ testsuite/MovieTester.cpp   7 Sep 2007 00:11:27 -0000       1.47
@@ -95,6 +95,7 @@
        // Now complete load of the movie
        _movie_def->completeLoad();
        _movie_def->ensure_frame_loaded(_movie_def->get_frame_count());
+        _movie_root->setRootMovie( _movie_def->create_movie_instance() );
 
        _movie = _movie_root->get_root_movie();
        assert(_movie);

Index: testsuite/server/DisplayListTest.cpp
===================================================================
RCS file: /sources/gnash/gnash/testsuite/server/DisplayListTest.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- testsuite/server/DisplayListTest.cpp        1 Jul 2007 10:55:12 -0000       
1.7
+++ testsuite/server/DisplayListTest.cpp        7 Sep 2007 00:11:27 -0000       
1.8
@@ -54,7 +54,9 @@
        // Initialize a VM
        boost::intrusive_ptr<movie_definition> md5 ( new 
DummyMovieDefinition(5) );
        boost::intrusive_ptr<movie_definition> md6 ( new 
DummyMovieDefinition(6) );
-       VM::init(*md5);
+
+       VM& vm = VM::init(*md5);
+       vm.getRoot().setRootMovie( md5->create_movie_instance() );
 
        DisplayList dlist1;
 

Index: testsuite/server/GetterSetterTest.cpp
===================================================================
RCS file: /sources/gnash/gnash/testsuite/server/GetterSetterTest.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- testsuite/server/GetterSetterTest.cpp       1 Jul 2007 10:55:12 -0000       
1.14
+++ testsuite/server/GetterSetterTest.cpp       7 Sep 2007 00:11:27 -0000       
1.15
@@ -87,7 +87,8 @@
        gnashInit();
 
        boost::intrusive_ptr<movie_definition> md6 ( new 
DummyMovieDefinition(6) );
-       VM::init(*md6);
+       VM& vm = VM::init(*md6);
+       vm.getRoot().setRootMovie( md6->create_movie_instance() );
 
        boost::intrusive_ptr<test_object> obj(new test_object("initial text"));
        boost::intrusive_ptr<test_object> obj2(new test_object("other obj"));

Index: testsuite/server/PropertyListTest.cpp
===================================================================
RCS file: /sources/gnash/gnash/testsuite/server/PropertyListTest.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- testsuite/server/PropertyListTest.cpp       1 Jul 2007 10:55:14 -0000       
1.16
+++ testsuite/server/PropertyListTest.cpp       7 Sep 2007 00:11:27 -0000       
1.17
@@ -52,6 +52,7 @@
        boost::intrusive_ptr<movie_definition> md6 ( new 
DummyMovieDefinition(6) );
 
        VM& vm = VM::init(*md5);
+       vm.getRoot().setRootMovie( md5->create_movie_instance() );
 
        log_debug("VM version %d", vm.getSWFVersion());
 

Index: utilities/processor.cpp
===================================================================
RCS file: /sources/gnash/gnash/utilities/processor.cpp,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -b -r1.62 -r1.63
--- utilities/processor.cpp     5 Sep 2007 01:51:32 -0000       1.62
+++ utilities/processor.cpp     7 Sep 2007 00:11:27 -0000       1.63
@@ -333,6 +333,10 @@
 
     md->completeLoad();
     
+    std::auto_ptr<movie_instance> mi ( md->create_movie_instance() );
+
+    m.setRootMovie( mi.release() );
+    
     resetLastAdvanceTimer();
     int        kick_count = 0;
     int stop_count=0;




reply via email to

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