[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/asobj/MovieClipLoader.cpp
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/asobj/MovieClipLoader.cpp |
Date: |
Tue, 31 Oct 2006 15:58:58 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 06/10/31 15:58:58
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&r1=1.1464&r2=1.1465
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/MovieClipLoader.cpp?cvsroot=gnash&r1=1.7&r2=1.8
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.1464
retrieving revision 1.1465
diff -u -b -r1.1464 -r1.1465
--- ChangeLog 31 Oct 2006 15:40:58 -0000 1.1464
+++ ChangeLog 31 Oct 2006 15:58:58 -0000 1.1465
@@ -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.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- server/asobj/MovieClipLoader.cpp 31 Oct 2006 15:40:58 -0000 1.7
+++ server/asobj/MovieClipLoader.cpp 31 Oct 2006 15:58:58 -0000 1.8
@@ -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);
}
}