gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/character.h server/dlist...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/character.h server/dlist...
Date: Mon, 05 Mar 2007 21:53:48 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/03/05 21:53:48

Modified files:
        .              : ChangeLog 
        server         : character.h dlist.cpp sprite_instance.cpp 
                         sprite_instance.h 
        testsuite/misc-ming.all: action_execution_order_extend_test.c 

Log message:
                * server/: character.h, sprite_instance.{h,cpp}:
                  Add character::unload() virtual method to properly unload
                  child elements.
                * server/dlist.cpp: call character::unload() rather then
                  directly invoking the UNLOAD event.
                * testsuite/misc-ming.all/action_execution_order_extend_test.c:
                  Do not expect failures of unload event execution.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2539&r2=1.2540
http://cvs.savannah.gnu.org/viewcvs/gnash/server/character.h?cvsroot=gnash&r1=1.52&r2=1.53
http://cvs.savannah.gnu.org/viewcvs/gnash/server/dlist.cpp?cvsroot=gnash&r1=1.52&r2=1.53
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.cpp?cvsroot=gnash&r1=1.185&r2=1.186
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.h?cvsroot=gnash&r1=1.73&r2=1.74
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/action_execution_order_extend_test.c?cvsroot=gnash&r1=1.3&r2=1.4

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2539
retrieving revision 1.2540
diff -u -b -r1.2539 -r1.2540
--- ChangeLog   5 Mar 2007 21:35:26 -0000       1.2539
+++ ChangeLog   5 Mar 2007 21:53:48 -0000       1.2540
@@ -1,3 +1,13 @@
+2007-03-05 Sandro Santilli <address@hidden>
+
+       * server/: character.h, sprite_instance.{h,cpp}:
+         Add character::unload() virtual method to properly unload
+         child elements.
+       * server/dlist.cpp: call character::unload() rather then
+         directly invoking the UNLOAD event.
+       * testsuite/misc-ming.all/action_execution_order_extend_test.c:
+         Do not expect failures of unload event execution.
+
 2007-03-05 Ann Barcomb <address@hidden>
 
        * doc/C/internals.xml: section 'ActionScript Support' was updated

Index: server/character.h
===================================================================
RCS file: /sources/gnash/gnash/server/character.h,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -b -r1.52 -r1.53
--- server/character.h  28 Feb 2007 17:25:25 -0000      1.52
+++ server/character.h  5 Mar 2007 21:53:48 -0000       1.53
@@ -18,7 +18,7 @@
 //
 //
 
-/* $Id: character.h,v 1.52 2007/02/28 17:25:25 udog Exp $ */
+/* $Id: character.h,v 1.53 2007/03/05 21:53:48 strk Exp $ */
 
 #ifndef GNASH_CHARACTER_H
 #define GNASH_CHARACTER_H
@@ -611,6 +611,19 @@
                on_event(event_id::CONSTRUCT);
        }
 
+       /// Unload this instance from the stage.
+       //
+       /// This function must be called when the character is removed
+       /// from the stage.
+       /// stage for the first time. It will take care of properly
+       /// unloading any child characters and calling the 'UNLOAD'
+       /// event handler.
+       ///
+       virtual void unload()
+       {
+               on_event(event_id::UNLOAD);
+       }
+
        
 };
 

Index: server/dlist.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/dlist.cpp,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -b -r1.52 -r1.53
--- server/dlist.cpp    1 Mar 2007 08:00:40 -0000       1.52
+++ server/dlist.cpp    5 Mar 2007 21:53:48 -0000       1.53
@@ -403,7 +403,7 @@
                {
                        DisplayItem& di = *it;
                        if ( ! it->get() ) continue;
-                       di->on_event(event_id::UNLOAD); // if call_unload
+                       di->unload(); // if call_unload
                }
        }
                
@@ -444,7 +444,7 @@
 
                if (is_affected == false)
                {
-                       if ( call_unload ) di->on_event(event_id::UNLOAD);
+                       if ( call_unload ) di->unload();
                        it = _characters.erase(it);
                        continue;
                }
@@ -473,7 +473,7 @@
 
                if (is_affected == false)
                {
-                       if ( call_unload ) di->on_event(event_id::UNLOAD);
+                       if ( call_unload ) di->unload();
                        it = _characters.erase(it);
                        continue;
                }
@@ -504,7 +504,7 @@
 
                if (is_affected == false)
                {
-                       if ( call_unload ) di->on_event(event_id::UNLOAD);
+                       if ( call_unload ) di->unload();
                        it = _characters.erase(it);
                        continue;
                }
@@ -535,7 +535,7 @@
 
                if (is_affected)
                {
-                       if ( call_unload ) di->on_event(event_id::UNLOAD);
+                       if ( call_unload ) di->unload();
                        it = _characters.erase(it);
                        continue;
                }

Index: server/sprite_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.cpp,v
retrieving revision 1.185
retrieving revision 1.186
diff -u -b -r1.185 -r1.186
--- server/sprite_instance.cpp  1 Mar 2007 11:08:07 -0000       1.185
+++ server/sprite_instance.cpp  5 Mar 2007 21:53:48 -0000       1.186
@@ -1526,6 +1526,15 @@
        }
 };
 
+/// A DisplayList visitor used to unload all characters
+struct UnloaderVisitor {
+       bool operator() (character* ch)
+       {
+               ch->unload();
+               return true;
+       }
+};
+
 
 //------------------------------------------------
 // sprite_instance
@@ -3645,6 +3654,19 @@
 }
 
 void
+sprite_instance::unload()
+{
+#ifdef GNASH_DEBUG
+       log_msg("Unloading sprite '%s'", getTargetPath().c_str());
+#endif
+
+       UnloaderVisitor visitor;
+       m_display_list.visitForward(visitor);
+       on_event(event_id::UNLOAD); // if call_unload
+
+}
+
+void
 sprite_instance::set_name(const char* name)
 {
        _name = name;

Index: server/sprite_instance.h
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.h,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -b -r1.73 -r1.74
--- server/sprite_instance.h    28 Feb 2007 17:25:26 -0000      1.73
+++ server/sprite_instance.h    5 Mar 2007 21:53:48 -0000       1.74
@@ -17,7 +17,7 @@
 // 
 //
 
-/* $Id: sprite_instance.h,v 1.73 2007/02/28 17:25:26 udog Exp $ */
+/* $Id: sprite_instance.h,v 1.74 2007/03/05 21:53:48 strk Exp $ */
 
 // Stateful live Sprite instance
 
@@ -365,6 +365,10 @@
        ///
        void construct();
 
+       /// Unload all contents in the displaylist and this instance
+       /// See character::unload for more info
+       void unload();
+
        /// Updates the transform properties of the object at
        /// the specified depth.
        void    move_display_object(

Index: testsuite/misc-ming.all/action_execution_order_extend_test.c
===================================================================
RCS file: 
/sources/gnash/gnash/testsuite/misc-ming.all/action_execution_order_extend_test.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- testsuite/misc-ming.all/action_execution_order_extend_test.c        5 Mar 
2007 15:03:05 -0000       1.3
+++ testsuite/misc-ming.all/action_execution_order_extend_test.c        5 Mar 
2007 21:53:48 -0000       1.4
@@ -169,7 +169,7 @@
   /* actions in main timeline is executed *after* mc_blu.onEnterFrame */
   check_equals(mo, "_root.y5", "'as_in_root'");
   /* actions in main timeline is executed *before* mc_blu.onUnload */
-  xcheck_equals(mo, "_root.y6", "'mc_blu onUnload called'");
+  check_equals(mo, "_root.y6", "'mc_blu onUnload called'");
   add_actions(mo, " _root.totals(); stop(); ");
   SWFMovie_nextFrame(mo); /* 5th frame */
   




reply via email to

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