gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog gui/gui.cpp server/as_environme...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog gui/gui.cpp server/as_environme...
Date: Fri, 14 Dec 2007 20:51:21 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/12/14 20:51:21

Modified files:
        .              : ChangeLog 
        gui            : gui.cpp 
        server         : as_environment.cpp as_value.cpp character.cpp 
                         character.h movie_instance.cpp movie_instance.h 
                         movie_root.h sprite_instance.cpp 
                         sprite_instance.h swf_function.cpp 
        server/asobj   : Object.cpp 
        server/vm      : ASHandlers.cpp 

Log message:
        Drop duplicated character::get_root_movie(), which does the same as
        character::get_root(); drop movie_root::get_root_movie, use the
        new getRootMovie name.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5177&r2=1.5178
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gui.cpp?cvsroot=gnash&r1=1.119&r2=1.120
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_environment.cpp?cvsroot=gnash&r1=1.115&r2=1.116
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_value.cpp?cvsroot=gnash&r1=1.105&r2=1.106
http://cvs.savannah.gnu.org/viewcvs/gnash/server/character.cpp?cvsroot=gnash&r1=1.67&r2=1.68
http://cvs.savannah.gnu.org/viewcvs/gnash/server/character.h?cvsroot=gnash&r1=1.114&r2=1.115
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_instance.cpp?cvsroot=gnash&r1=1.20&r2=1.21
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_instance.h?cvsroot=gnash&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.h?cvsroot=gnash&r1=1.95&r2=1.96
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.cpp?cvsroot=gnash&r1=1.413&r2=1.414
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.h?cvsroot=gnash&r1=1.157&r2=1.158
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf_function.cpp?cvsroot=gnash&r1=1.43&r2=1.44
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Object.cpp?cvsroot=gnash&r1=1.38&r2=1.39
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ASHandlers.cpp?cvsroot=gnash&r1=1.170&r2=1.171

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5177
retrieving revision 1.5178
diff -u -b -r1.5177 -r1.5178
--- ChangeLog   14 Dec 2007 20:13:46 -0000      1.5177
+++ ChangeLog   14 Dec 2007 20:51:19 -0000      1.5178
@@ -1,5 +1,17 @@
 2007-12-14 Sandro Santilli <address@hidden>
 
+       * gui/gui.cpp, server/as_environment.cpp, server/as_value.cpp,
+         server/character.cpp, server/character.h,
+         server/movie_instance.cpp, server/movie_instance.h,
+         server/movie_root.h, server/sprite_instance.cpp,
+         server/sprite_instance.h, server/swf_function.cpp,
+         server/asobj/Object.cpp, server/vm/ASHandlers.cpp:
+         Drop duplicated character::get_root_movie(), which does the same as
+         character::get_root(); drop movie_root::get_root_movie, use the
+         new getRootMovie name.
+
+2007-12-14 Sandro Santilli <address@hidden>
+
        * server/swf/DoInitActionTag.h: store referenced character
          in the instance, pass to execute_init_actions when
          executing; add self as a normal control tag.

Index: gui/gui.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/gui.cpp,v
retrieving revision 1.119
retrieving revision 1.120
diff -u -b -r1.119 -r1.120
--- gui/gui.cpp 4 Dec 2007 11:45:22 -0000       1.119
+++ gui/gui.cpp 14 Dec 2007 20:51:19 -0000      1.120
@@ -694,8 +694,8 @@
        // Advance movie by one frame
        m->advance(1.0);
 #else
-       size_t cur_frame = m->get_root_movie()->get_current_frame();
-       size_t tot_frames = m->get_root_movie()->get_frame_count();
+       size_t cur_frame = m->getRootMovie()->get_current_frame();
+       size_t tot_frames = m->getRootMovie()->get_frame_count();
        m->advance(1.0);
        m->get_movie_definition()->ensure_frame_loaded(tot_frames);
        m->goto_frame(cur_frame+1);
@@ -748,7 +748,7 @@
        if ( ! loops() )
        {
                size_t curframe = m->get_current_frame(); // can be 0 on 
malformed SWF
-               gnash::sprite_instance* si = m->get_root_movie();
+               gnash::sprite_instance* si = m->getRootMovie();
                if (curframe + 1 >= si->get_frame_count())
                {
                        quit(); 

Index: server/as_environment.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/as_environment.cpp,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -b -r1.115 -r1.116
--- server/as_environment.cpp   26 Nov 2007 16:27:27 -0000      1.115
+++ server/as_environment.cpp   14 Dec 2007 20:51:20 -0000      1.116
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-/* $Id: as_environment.cpp,v 1.115 2007/11/26 16:27:27 strk Exp $ */
+/* $Id: as_environment.cpp,v 1.116 2007/12/14 20:51:20 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -537,7 +537,7 @@
     if (*p == '/')
     {
        // Absolute path.  Start at the root.
-       sprite_instance* root = m_target->get_root_movie();
+       sprite_instance* root = m_target->get_root();
        if ( ! *(++p) )
        {
 #ifdef DEBUG_TARGET_FINDING 

Index: server/as_value.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/as_value.cpp,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -b -r1.105 -r1.106
--- server/as_value.cpp 12 Dec 2007 14:48:16 -0000      1.105
+++ server/as_value.cpp 14 Dec 2007 20:51:20 -0000      1.106
@@ -1477,7 +1477,7 @@
 
        VM& vm = VM::get();
        string_table& st = vm.getStringTable();
-       as_object* o = vm.getRoot().get_root_movie();
+       as_object* o = vm.getRoot().getRootMovie();
 
        // TODO: for another optimization we may cache
        //       the string_table::key for each element

Index: server/character.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/character.cpp,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -b -r1.67 -r1.68
--- server/character.cpp        30 Nov 2007 11:26:05 -0000      1.67
+++ server/character.cpp        14 Dec 2007 20:51:20 -0000      1.68
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 // 
 
-/* $Id: character.cpp,v 1.67 2007/11/30 11:26:05 strk Exp $ */
+/* $Id: character.cpp,v 1.68 2007/12/14 20:51:20 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -77,16 +77,6 @@
        return m;
 }
 
-sprite_instance*
-character::get_root_movie()
-{
-       assert(m_parent != NULL);
-#ifndef GNASH_USE_GC
-       assert(m_parent->get_ref_count() > 0);
-#endif // GNASH_USE_GC
-       return m_parent->get_root_movie();
-}
-
 void
 character::get_mouse_state(int& x, int& y, int& buttons)
 {
@@ -125,7 +115,8 @@
        }
        else if (name == "_root")
        {
-               return get_root_movie();
+               // TODO: handle lockroot ? or have get_root handle it ?
+               return get_root();
        }
        else if (name.compare(0, 6, "_level") == 0 && 
name.find_first_not_of("0123456789", 7) == string::npos )
        {

Index: server/character.h
===================================================================
RCS file: /sources/gnash/gnash/server/character.h,v
retrieving revision 1.114
retrieving revision 1.115
diff -u -b -r1.114 -r1.115
--- server/character.h  10 Dec 2007 20:17:16 -0000      1.114
+++ server/character.h  14 Dec 2007 20:51:20 -0000      1.115
@@ -19,7 +19,7 @@
 //
 //
 
-/* $Id: character.h,v 1.114 2007/12/10 20:17:16 strk Exp $ */
+/* $Id: character.h,v 1.115 2007/12/14 20:51:20 strk Exp $ */
 
 #ifndef GNASH_CHARACTER_H
 #define GNASH_CHARACTER_H
@@ -709,12 +709,9 @@
        /// TODO: what about programmatically created characters ?
        ///       which would their "relative" root be ?
        ///
-       /// The default implementation is to invoke get_root_movie
+       /// The default implementation is to invoke get_root
        /// against this character's parent.
        ///
-       virtual sprite_instance* get_root_movie();
-
-       /// By default call get_root on the parent
        virtual movie_instance* get_root() const {
                return get_parent()->get_root();
        }

Index: server/movie_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/movie_instance.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- server/movie_instance.cpp   10 Dec 2007 20:17:17 -0000      1.20
+++ server/movie_instance.cpp   14 Dec 2007 20:51:20 -0000      1.21
@@ -49,7 +49,7 @@
 {
        //GNASH_REPORT_FUNCTION;
 
-       assert ( get_root()->get_root_movie() == this );
+       assert ( get_root()->get_root() == this );
 
        //_def->stopLoader();
 
@@ -73,7 +73,7 @@
 {
        //GNASH_REPORT_FUNCTION;
 
-       assert ( get_root()->get_root_movie() == this );
+       assert ( get_root()->get_root() == this );
 
        //_def->stopLoader();
 

Index: server/movie_instance.h
===================================================================
RCS file: /sources/gnash/gnash/server/movie_instance.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- server/movie_instance.h     14 Dec 2007 20:13:46 -0000      1.11
+++ server/movie_instance.h     14 Dec 2007 20:51:20 -0000      1.12
@@ -59,13 +59,6 @@
 
        virtual void advance();
 
-       // Could be implemented in sprite_instance too,
-       // returning m_root like it is done for get_root_movie...
-       virtual movie_instance* get_root() const
-       {
-               return const_cast<movie_instance*>(this);
-       }
-
        /// Handle a top-level movie on stage placement.
        //
        /// This method will just ensure first frame is loaded

Index: server/movie_root.h
===================================================================
RCS file: /sources/gnash/gnash/server/movie_root.h,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -b -r1.95 -r1.96
--- server/movie_root.h 10 Dec 2007 20:17:17 -0000      1.95
+++ server/movie_root.h 14 Dec 2007 20:51:20 -0000      1.96
@@ -15,7 +15,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: movie_root.h,v 1.95 2007/12/10 20:17:17 strk Exp $ */
+/* $Id: movie_root.h,v 1.96 2007/12/14 20:51:20 strk Exp $ */
 
 /// \page events_handling Handling of user events
 ///
@@ -303,12 +303,6 @@
 
     void set_drag_state(const drag_state& st);
 
-    // just an alias to getRootMovie
-    sprite_instance* get_root_movie() const
-    {
-       return getRootMovie();
-    }
-
     /// @return current top-level root sprite (_level0)
     movie_instance* getRootMovie() const
     {

Index: server/sprite_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.cpp,v
retrieving revision 1.413
retrieving revision 1.414
diff -u -b -r1.413 -r1.414
--- server/sprite_instance.cpp  14 Dec 2007 20:13:46 -0000      1.413
+++ server/sprite_instance.cpp  14 Dec 2007 20:51:20 -0000      1.414
@@ -1901,7 +1901,15 @@
                //if ( isUnloaded() ) return false; // see 
movieclip_destruction_test3.sc
 
                // TODO: handle lockroot
-               val->set_as_object( VM::get().getRoot().get_root_movie() );
+               //
+               // get_root() would return relative root of this instance
+               // VM::getRoot().getRootMovie() would return _level0 or 
something
+               // like that (check dox)
+               //
+               // If _lockroot is true we should return the relative root, 
otherwise
+               // we should return the absolute one (_level0?)
+               //
+               val->set_as_object( VM::get().getRoot().getRootMovie() );
                return true;
        }
        if (name.compare(0, 6, "_level") == 0 && 
name.find_first_not_of("0123456789", 7) == string::npos )
@@ -3194,20 +3202,6 @@
        return NULL;
 }
 
-//float
-//sprite_instance::get_timer() const
-//{
-//     return m_root->get_timer();
-//}
-
-
-sprite_instance*
-sprite_instance::get_root_movie()
-{
-       assert(m_root);
-       return m_root; // could as well be myself !
-}
-
 float
 sprite_instance::get_pixel_scale() const
 {
@@ -3600,7 +3594,6 @@
                matrix mat = get_matrix();
                int ratio = get_ratio();
                int clip_depth = get_clip_depth();
-               //character* new_movie = extern_movie->get_root_movie();
 
                extern_movie->set_parent(parent);
 

Index: server/sprite_instance.h
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.h,v
retrieving revision 1.157
retrieving revision 1.158
diff -u -b -r1.157 -r1.158
--- server/sprite_instance.h    14 Dec 2007 20:13:46 -0000      1.157
+++ server/sprite_instance.h    14 Dec 2007 20:51:20 -0000      1.158
@@ -116,7 +116,10 @@
        /// Return this sprite's relative root as
        /// specified at contruction time
        ///
-       virtual sprite_instance* get_root_movie();
+       virtual movie_instance* get_root() const
+       {
+               return m_root;
+       }
 
        /// \brief
        /// Return the sprite_definition (or movie_definition)

Index: server/swf_function.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/swf_function.cpp,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -b -r1.43 -r1.44
--- server/swf_function.cpp     12 Dec 2007 10:07:01 -0000      1.43
+++ server/swf_function.cpp     14 Dec 2007 20:51:20 -0000      1.44
@@ -235,8 +235,9 @@
                if (m_function2_flags & PRELOAD_ROOT) 
                {
                        // Put '_root' in a register.
+                       // TODO: handle lockroot ? (or let get_root() do that?)
                        our_env->local_register(current_reg).set_as_object(
-                               our_env->get_target()->get_root_movie());
+                               our_env->get_target()->get_root());
                        current_reg++;
                }
 

Index: server/asobj/Object.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Object.cpp,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -b -r1.38 -r1.39
--- server/asobj/Object.cpp     27 Nov 2007 15:39:41 -0000      1.38
+++ server/asobj/Object.cpp     14 Dec 2007 20:51:21 -0000      1.39
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-/* $Id: Object.cpp,v 1.38 2007/11/27 15:39:41 strk Exp $ */
+/* $Id: Object.cpp,v 1.39 2007/12/14 20:51:21 strk Exp $ */
 
 #include "tu_config.h"
 #include "Object.h"
@@ -26,7 +26,7 @@
 #include "as_object.h" // for inheritance
 #include "builtin_function.h" // need builtin_function
 #include "movie_definition.h" // for Object.registerClass 
(get_exported_resource)
-#include "character.h" // for Object.registerClass  (get_root_movie)
+//#include "character.h" // for Object.registerClass  (get_root_movie)
 #include "sprite_instance.h" // for Object.registerClass  
(get_movie_definition)
 #include "sprite_definition.h" // for Object.registerClass  
(get_movie_definition)
 #include "VM.h" // for SWF version (attachObjectInterface)

Index: server/vm/ASHandlers.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/vm/ASHandlers.cpp,v
retrieving revision 1.170
retrieving revision 1.171
diff -u -b -r1.170 -r1.171
--- server/vm/ASHandlers.cpp    12 Dec 2007 10:23:47 -0000      1.170
+++ server/vm/ASHandlers.cpp    14 Dec 2007 20:51:21 -0000      1.171
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-/* $Id: ASHandlers.cpp,v 1.170 2007/12/12 10:23:47 zoulunkai Exp $ */
+/* $Id: ASHandlers.cpp,v 1.171 2007/12/14 20:51:21 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1336,7 +1336,7 @@
 {
 //    GNASH_REPORT_FUNCTION;
     as_environment& env = thread.env;
-    sprite_instance *root_movie = env.get_target()->get_root_movie();
+    sprite_instance *root_movie = env.get_target()->get_root();
     assert(root_movie);
     root_movie->stop_drag();
 }
@@ -2103,7 +2103,7 @@
                if (s_fscommand_handler)
                {
                        // Call into the app.
-                       
(*s_fscommand_handler)(env.get_target()->get_root_movie(), url_c + 10, 
target_string.c_str());
+                       (*s_fscommand_handler)(env.get_target()->get_root(), 
url_c + 10, target_string.c_str());
                }
 
                return;




reply via email to

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