CVSROOT: /sources/gnash Module name: gnash Changes by: Sandro Santilli <strk> 07/09/21 08:29:03
Modified files: . : ChangeLog server : button_character_instance.cpp button_character_instance.h character.h dlist.cpp movie_instance.cpp movie_instance.h movie_root.cpp sprite_instance.cpp sprite_instance.h video_stream_instance.cpp video_stream_instance.h Log message: * server/character.h, server/dlist.cpp, server/button_character_instance.{cpp,h}, server/movie_instance.{cpp,h}, server/movie_root.cpp, server/sprite_instance.{cpp,h}, server/video_stream_instance.{cpp,h}: Rename character::construct to character::stagePlacementCallback and update documentation to help clarity. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4366&r2=1.4367 http://cvs.savannah.gnu.org/viewcvs/gnash/server/button_character_instance.cpp?cvsroot=gnash&r1=1.58&r2=1.59 http://cvs.savannah.gnu.org/viewcvs/gnash/server/button_character_instance.h?cvsroot=gnash&r1=1.25&r2=1.26 http://cvs.savannah.gnu.org/viewcvs/gnash/server/character.h?cvsroot=gnash&r1=1.95&r2=1.96 http://cvs.savannah.gnu.org/viewcvs/gnash/server/dlist.cpp?cvsroot=gnash&r1=1.93&r2=1.94 http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_instance.cpp?cvsroot=gnash&r1=1.17&r2=1.18 http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_instance.h?cvsroot=gnash&r1=1.8&r2=1.9 http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.cpp?cvsroot=gnash&r1=1.94&r2=1.95 http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.cpp?cvsroot=gnash&r1=1.352&r2=1.353 http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.h?cvsroot=gnash&r1=1.140&r2=1.141 http://cvs.savannah.gnu.org/viewcvs/gnash/server/video_stream_instance.cpp?cvsroot=gnash&r1=1.38&r2=1.39 http://cvs.savannah.gnu.org/viewcvs/gnash/server/video_stream_instance.h?cvsroot=gnash&r1=1.20&r2=1.21 Patches: Index: ChangeLog =================================================================== RCS file: /sources/gnash/gnash/ChangeLog,v retrieving revision 1.4366 retrieving revision 1.4367 diff -u -b -r1.4366 -r1.4367 --- ChangeLog 21 Sep 2007 07:35:27 -0000 1.4366 +++ ChangeLog 21 Sep 2007 08:29:01 -0000 1.4367 @@ -1,5 +1,15 @@ 2007-09-21 Sandro Santilli <[EMAIL PROTECTED]> + * server/character.h, server/dlist.cpp, + server/button_character_instance.{cpp,h}, + server/movie_instance.{cpp,h}, server/movie_root.cpp, + server/sprite_instance.{cpp,h}, + server/video_stream_instance.{cpp,h}: + Rename character::construct to character::stagePlacementCallback + and update documentation to help clarity. + +2007-09-21 Sandro Santilli <[EMAIL PROTECTED]> + * server/sprite_instance.cpp (goto_frame): make sure m_current_frame always reflect the frame number in which the control tags being executed were defined. Index: server/button_character_instance.cpp =================================================================== RCS file: /sources/gnash/gnash/server/button_character_instance.cpp,v retrieving revision 1.58 retrieving revision 1.59 diff -u -b -r1.58 -r1.59 --- server/button_character_instance.cpp 20 Sep 2007 06:57:02 -0000 1.58 +++ server/button_character_instance.cpp 21 Sep 2007 08:29:01 -0000 1.59 @@ -796,7 +796,7 @@ } void -button_character_instance::construct() +button_character_instance::stagePlacementCallback() { // Register this button instance as a live character _vm.getRoot().addLiveChar(this); @@ -813,7 +813,7 @@ // we don't need an id here, do we ? boost::intrusive_ptr<character> ch = bdef.m_character_def->create_character_instance(this, 0); - ch->construct(); // give this character life + ch->stagePlacementCallback(); // give this character life (TODO: they aren't on stage, are them ?) m_record_character[r] = ch; ch->set_matrix(mat); ch->set_cxform(cx); Index: server/button_character_instance.h =================================================================== RCS file: /sources/gnash/gnash/server/button_character_instance.h,v retrieving revision 1.25 retrieving revision 1.26 diff -u -b -r1.25 -r1.26 --- server/button_character_instance.h 13 Sep 2007 16:26:13 -0000 1.25 +++ server/button_character_instance.h 21 Sep 2007 08:29:02 -0000 1.26 @@ -21,7 +21,7 @@ // SWF buttons. Mouse-sensitive update/display, actions, etc. -/* $Id: button_character_instance.h,v 1.25 2007/09/13 16:26:13 strk Exp $ */ +/* $Id: button_character_instance.h,v 1.26 2007/09/21 08:29:02 strk Exp $ */ #ifndef GNASH_BUTTON_CHARACTER_INSTANCE_H #define GNASH_BUTTON_CHARACTER_INSTANCE_H @@ -146,8 +146,14 @@ bool get_enabled(); void set_enabled(bool value); - /// Properly initialize instance names for contained sprites - virtual void construct(); + /// Receive a stage placement notification + // + /// This callback will: + /// + /// (1) Register this button instance as a live character + /// (2) Setup the state characters calling stagePlacementCallback on all [WRONG] + /// + virtual void stagePlacementCallback(); /// Properly unload contained characters bool unload(); Index: server/character.h =================================================================== RCS file: /sources/gnash/gnash/server/character.h,v retrieving revision 1.95 retrieving revision 1.96 diff -u -b -r1.95 -r1.96 --- server/character.h 19 Sep 2007 10:17:03 -0000 1.95 +++ server/character.h 21 Sep 2007 08:29:02 -0000 1.96 @@ -19,7 +19,7 @@ // // -/* $Id: character.h,v 1.95 2007/09/19 10:17:03 strk Exp $ */ +/* $Id: character.h,v 1.96 2007/09/21 08:29:02 strk Exp $ */ #ifndef GNASH_CHARACTER_H #define GNASH_CHARACTER_H @@ -1004,20 +1004,13 @@ /// virtual void add_invalidated_bounds(InvalidatedRanges& ranges, bool force) = 0; - /// Construct this instance as an ActionScript object. + /// Callback invoked whenever a character is placed on stage // /// This function must be called when the character is placed on - /// stage for the first time. It will take care of invoking - /// the constructor of its associated class and calling the - /// 'onConstruct' event handler. + /// stage for the first time. /// - /// Make sure this instance got an instance name before calling - /// this method (it's needed for properly setting the "this" pointer - /// when calling user-defined constructors). - /// - virtual void construct() + virtual void stagePlacementCallback() { - on_event(event_id::CONSTRUCT); } /// Unload this instance from the stage. Index: server/dlist.cpp =================================================================== RCS file: /sources/gnash/gnash/server/dlist.cpp,v retrieving revision 1.93 retrieving revision 1.94 diff -u -b -r1.93 -r1.94 --- server/dlist.cpp 18 Sep 2007 14:25:58 -0000 1.93 +++ server/dlist.cpp 21 Sep 2007 08:29:02 -0000 1.94 @@ -235,7 +235,7 @@ } // Give life to this instance - ch->construct(); + ch->stagePlacementCallback(); testInvariant(); } @@ -360,7 +360,7 @@ // WARNING: when a new Button character is added, // the invalidated bounds computation will likely // be bogus, as the actual character shown is not instantiated - // until ::construct for buttons (I'd say this is a bug in button_character_instance) + // until ::stagePlacementCallback for buttons (I'd say this is a bug in button_character_instance) // UdoG, following ? // ch->extend_invalidated_bounds(old_ranges); @@ -368,7 +368,7 @@ } // Give life to this instance - ch->construct(); + ch->stagePlacementCallback(); testInvariant(); } Index: server/movie_instance.cpp =================================================================== RCS file: /sources/gnash/gnash/server/movie_instance.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -u -b -r1.17 -r1.18 --- server/movie_instance.cpp 7 Sep 2007 11:56:06 -0000 1.17 +++ server/movie_instance.cpp 21 Sep 2007 08:29:02 -0000 1.18 @@ -45,7 +45,7 @@ } void -movie_instance::construct() +movie_instance::stagePlacementCallback() { //GNASH_REPORT_FUNCTION; @@ -79,8 +79,8 @@ return; } - // Invoke proper constructor - sprite_instance::construct(); + // Invoke parent placement event handler + sprite_instance::stagePlacementCallback(); } // Advance of an SWF-defined movie instance Index: server/movie_instance.h =================================================================== RCS file: /sources/gnash/gnash/server/movie_instance.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -b -r1.8 -r1.9 --- server/movie_instance.h 7 Sep 2007 07:10:20 -0000 1.8 +++ server/movie_instance.h 21 Sep 2007 08:29:02 -0000 1.9 @@ -65,14 +65,14 @@ return const_cast<movie_instance*>(this); } - /// Construct a top-level movie + /// Handle a top-level movie on stage placement. // /// This method will just ensure first frame is loaded - /// and then call sprite_instance::construct. + /// and then call sprite_instance::stagePlacementCallback. /// /// It's intended to be called by movie_root::setLevel(). /// - void construct(); + void stagePlacementCallback(); private: Index: server/movie_root.cpp =================================================================== RCS file: /sources/gnash/gnash/server/movie_root.cpp,v retrieving revision 1.94 retrieving revision 1.95 diff -u -b -r1.94 -r1.95 --- server/movie_root.cpp 20 Sep 2007 06:57:02 -0000 1.94 +++ server/movie_root.cpp 21 Sep 2007 08:29:02 -0000 1.95 @@ -130,8 +130,8 @@ (int) movie->get_movie_definition()->get_width_pixels(), (int) movie->get_movie_definition()->get_height_pixels()); - /// Give life to this instance - movie->construct(); + /// Notify placement + movie->stagePlacementCallback(); assert(testInvariant()); } @@ -200,13 +200,13 @@ // TODO: instead, take it's definition and re-instantiate // a new movie here ! The only problem would be re-setting // externally set variables - level0->restart(); // NOTE: restart() will call construct + level0->restart(); // Add level0 back in place - // NOTE: we don't call setLevel to avoid calling ::construct again + // NOTE: we don't call setLevel to avoid calling ::stagePlacementCallback again _movies[0] = level0; - // Process actions queued by restart/construct + // Process actions queued by restart/stagePlacementCallback processActionQueue(); // Delete characters removed from the stage Index: server/sprite_instance.cpp =================================================================== RCS file: /sources/gnash/gnash/server/sprite_instance.cpp,v retrieving revision 1.352 retrieving revision 1.353 diff -u -b -r1.352 -r1.353 --- server/sprite_instance.cpp 21 Sep 2007 07:35:28 -0000 1.352 +++ server/sprite_instance.cpp 21 Sep 2007 08:29:02 -0000 1.353 @@ -3216,8 +3216,9 @@ // WARNING: THIS SNIPPET NEEDS THE CHARACTER TO BE "INSTANTIATED", which is // it's target path needs to exist, or any as_value for it will be // a dangling reference to an unexistent sprite ! +// NOTE: this is just due to the wrong steps, see comment in header void -sprite_instance::construct() +sprite_instance::stagePlacementCallback() { assert(!isUnloaded()); Index: server/sprite_instance.h =================================================================== RCS file: /sources/gnash/gnash/server/sprite_instance.h,v retrieving revision 1.140 retrieving revision 1.141 diff -u -b -r1.140 -r1.141 --- server/sprite_instance.h 18 Sep 2007 14:57:23 -0000 1.140 +++ server/sprite_instance.h 21 Sep 2007 08:29:03 -0000 1.141 @@ -377,21 +377,24 @@ /// bool attachCharacter(character& newch, int depth); - /// Construct this instance as an ActionScript object. + /// Handle placement event // - /// This function must be called when the sprite is placed on - /// stage for the first time. It will take care of invoking - /// the constructor of its associated class, either MovieClip - /// or any user-specified one (see sprite_definition::registerClass). + /// This callback will (not known to be a problem): /// - /// Make sure this sprite got an instance name before calling - /// this method (it's needed for properly setting the "this" pointer - /// when calling user-defined constructors). + /// (1) Register ourselves with the global instance list + /// (2) Take note of our original target path + /// (3) Register as listener of core broadcasters + /// (4) Execute tags of frame 0 /// - /// TODO: check if we only need to construct "named" instances - /// TODO: possibly have this function call the onConstruct() event handler + /// The callback will also (known to be bogus): + // + /// (1) Invoke the onClipConstruct and onConstruct handlers + /// [ too early for handlers to refer to childs, should be queued eventually ] + /// (2) Invoke constructor of its associated class, either MovieClip + /// or any user-specified one (see sprite_definition::registerClass). + /// [ too early, init actions might not have had a chance to call registerClass ] /// - virtual void construct(); + virtual void stagePlacementCallback(); /// Unload all contents in the displaylist and this instance /// See character::unload for more info Index: server/video_stream_instance.cpp =================================================================== RCS file: /sources/gnash/gnash/server/video_stream_instance.cpp,v retrieving revision 1.38 retrieving revision 1.39 diff -u -b -r1.38 -r1.39 --- server/video_stream_instance.cpp 13 Sep 2007 13:57:49 -0000 1.38 +++ server/video_stream_instance.cpp 21 Sep 2007 08:29:03 -0000 1.39 @@ -17,7 +17,7 @@ // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // -// $Id: video_stream_instance.cpp,v 1.38 2007/09/13 13:57:49 strk Exp $ +// $Id: video_stream_instance.cpp,v 1.39 2007/09/21 08:29:03 strk Exp $ #include "sprite_instance.h" #include "video_stream_instance.h" @@ -230,7 +230,7 @@ } void -video_stream_instance::construct() +video_stream_instance::stagePlacementCallback() { // Register this video instance as a live character _vm.getRoot().addLiveChar(this); Index: server/video_stream_instance.h =================================================================== RCS file: /sources/gnash/gnash/server/video_stream_instance.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -b -r1.20 -r1.21 --- server/video_stream_instance.h 13 Sep 2007 13:57:49 -0000 1.20 +++ server/video_stream_instance.h 21 Sep 2007 08:29:03 -0000 1.21 @@ -16,7 +16,7 @@ // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // -// $Id: video_stream_instance.h,v 1.20 2007/09/13 13:57:49 strk Exp $ +// $Id: video_stream_instance.h,v 1.21 2007/09/21 08:29:03 strk Exp $ #ifndef GNASH_VIDEO_STREAM_INSTANCE_H #define GNASH_VIDEO_STREAM_INSTANCE_H @@ -61,9 +61,8 @@ /// We use the call to ::advance to properly set invalidated status virtual void advance(float delta_time); - /// construct is needed to register this instance as an "advanceable" character - /// with movie_root - virtual void construct(); + /// Register this video instance as a live character + virtual void stagePlacementCallback(); void display(); _______________________________________________ Gnash-commit mailing list Gnash-commit@gnu.org http://lists.gnu.org/mailman/listinfo/gnash-commit