gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/asobj/MovieClipLoader.cpp [release


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/asobj/MovieClipLoader.cpp [release_0_7_2]
Date: Tue, 31 Oct 2006 15:59:26 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Branch:         release_0_7_2
Changes by:     Sandro Santilli <strk>  06/10/31 15:59:26

Modified files:
        .              : ChangeLog 
        server/asobj   : MovieClipLoader.cpp 

Log message:
                * server/asobj/MovieClipLoader.cpp: fixed event handlers calls
                  so that they include the target_mc argument.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&only_with_tag=release_0_7_2&r1=1.1412.2.30&r2=1.1412.2.31
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/MovieClipLoader.cpp?cvsroot=gnash&only_with_tag=release_0_7_2&r1=1.4.2.3&r2=1.4.2.4

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.1412.2.30
retrieving revision 1.1412.2.31
diff -u -b -r1.1412.2.30 -r1.1412.2.31
--- ChangeLog   31 Oct 2006 15:37:45 -0000      1.1412.2.30
+++ ChangeLog   31 Oct 2006 15:59:26 -0000      1.1412.2.31
@@ -1,5 +1,10 @@
 2006-10-31 Sandro Santilli <address@hidden>
 
+       * server/asobj/MovieClipLoader.cpp: fixed event handlers calls
+         so that they include the target_mc argument.
+
+2006-10-31 Sandro Santilli <address@hidden>
+
        * server/asobj/MovieClipLoader.cpp: lots of cleanup, implemented
          generic handling for event handlers (addListener, removeListener,
          dispatchEvent); added dispatch of onLoadInit event.

Index: server/asobj/MovieClipLoader.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/MovieClipLoader.cpp,v
retrieving revision 1.4.2.3
retrieving revision 1.4.2.4
diff -u -b -r1.4.2.3 -r1.4.2.4
--- server/asobj/MovieClipLoader.cpp    31 Oct 2006 15:37:45 -0000      1.4.2.3
+++ server/asobj/MovieClipLoader.cpp    31 Oct 2006 15:59:26 -0000      1.4.2.4
@@ -133,7 +133,7 @@
        void removeListener(as_object* listener);
 
        /// Invoke any listener for the specified event
-       void dispatchEvent(const std::string& eventName);
+       void dispatchEvent(const std::string& eventName, fn_call& fn);
 
        /// @ }
 
@@ -174,6 +174,10 @@
 bool
 MovieClipLoader::loadClip(const std::string& url_str, sprite_instance& target)
 {
+       // Prepare function call for events...
+       as_environment env;
+       env.push(as_value(&target));
+       fn_call events_call(NULL, this, &env, 1, 0);
 
        URL url(url_str.c_str(), get_base_url());
        
@@ -184,7 +188,7 @@
        // Call the callback since we've started loading the file
        // TODO: probably we should move this below, after 
        //       the loading thread actually started
-       dispatchEvent("onLoadStart");
+       dispatchEvent("onLoadStart", events_call);
 
        movie_definition* md = create_library_movie(url);
        if (md == NULL)
@@ -213,7 +217,7 @@
        /// TODO: check if we need to place it before calling
        ///       this function though...
        ///
-       dispatchEvent("onLoadInit");
+       dispatchEvent("onLoadInit", events_call);
   
 
        save_extern_movie(extern_movie);
@@ -253,8 +257,8 @@
        mcl_data->bytes_loaded = 666; // fake values for now
        mcl_data->bytes_total = 666;
 
-       // FIXME: load has not complete... (we load in a separate thread)
-       dispatchEvent("onLoadComplete");
+       log_warning("FIXME: MovieClipLoader calling onLoadComplete *before* 
movie has actually been fully loaded (cheating)");
+       dispatchEvent("onLoadComplete", events_call);
 
        return true;
 }
@@ -299,7 +303,7 @@
   
 // Callbacks
 void
-MovieClipLoader::dispatchEvent(const std::string& event)
+MovieClipLoader::dispatchEvent(const std::string& event, fn_call& fn)
 {
        typedef std::set<as_object*>::iterator iterator;
 
@@ -330,11 +334,7 @@
                        " %s function", event.c_str());
 #endif
 
-               as_value discarded_return;
-               as_environment env;
-               // TODO: pass movieclip argument
-               //env.push(clip);
-               call_method(method, &env, this, 0, 0);
+               call_method(method, fn.env, fn.this_ptr, fn.nargs, 
fn.first_arg_bottom_index);
        }
 
 }




reply via email to

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