[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/vm/ASHandlers.cpp server...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/vm/ASHandlers.cpp server... |
Date: |
Wed, 13 Dec 2006 11:08:10 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 06/12/13 11:08:10
Modified files:
. : ChangeLog
server/vm : ASHandlers.cpp ASHandlers.h
Log message:
* server/vm/ASHandlers.{h,cpp}: added CommonSetTarget().
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.1929&r2=1.1930
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ASHandlers.cpp?cvsroot=gnash&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ASHandlers.h?cvsroot=gnash&r1=1.3&r2=1.4
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.1929
retrieving revision 1.1930
diff -u -b -r1.1929 -r1.1930
--- ChangeLog 13 Dec 2006 10:30:48 -0000 1.1929
+++ ChangeLog 13 Dec 2006 11:08:10 -0000 1.1930
@@ -1,5 +1,6 @@
2006-12-13 Sandro Santilli <address@hidden>
+ * server/vm/ASHandlers.{h,cpp}: added CommonSetTarget().
* server/font.cpp (font::read_font_info): warn only once
about DefineFontInfo2 being partially implemented...
* server/swf/tag_loaders.cpp: removed additional newlines in log
Index: server/vm/ASHandlers.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/vm/ASHandlers.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- server/vm/ASHandlers.cpp 13 Dec 2006 10:13:15 -0000 1.17
+++ server/vm/ASHandlers.cpp 13 Dec 2006 11:08:10 -0000 1.18
@@ -16,7 +16,7 @@
//
-/* $Id: ASHandlers.cpp,v 1.17 2006/12/13 10:13:15 strk Exp $ */
+/* $Id: ASHandlers.cpp,v 1.18 2006/12/13 11:08:10 strk Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -737,28 +737,7 @@
// Change the movie we're working on.
std::string target_name ( code.read_string(pc+3) );
- character *new_target;
-
- // if the string is blank, we set target to the root movie
- // TODO - double check this is correct?
- if ( target_name.empty() )
- {
- target_name = "/";
- }
-
- new_target = env.find_target(target_name);
- if (new_target == NULL)
- {
- IF_VERBOSE_ACTION (
- log_action("Couldn't find movie \"%s\" "
- "to set target to! Not setting target at all...",
- target_name.c_str());
- );
- }
- else
- {
- env.set_target(new_target);
- }
+ CommonSetTarget(env, target_name);
}
void
@@ -1069,6 +1048,7 @@
env.drop(2);
}
+// See: http://sswf.sourceforge.net/SWFalexref.html#action_get_dynamic
void
SWFHandlers::ActionSetTargetExpression(ActionExec& thread)
{
@@ -1079,33 +1059,13 @@
ensure_stack(env, 1); // target name
//Vitaly: env.drop(1) remove object on which refers const char *
target_name
- //strk: shouldn't we use env.pop() instead ?
+ //strk: shouldn't we use env.pop() instead ? No (see above comment)
//const char * target_name = env.top(0).to_string();
assert(env.top(0).to_string());
std::string target_name = env.top(0).to_string();
env.drop(1); // pop the target name off the stack
- character *new_target;
-
- // if the string is blank, we set target to the root movie
- // TODO - double check this is correct?
- if ( target_name.empty() )
- {
- target_name = "/";
- }
-
- new_target = env.find_target(target_name);
- if (new_target == NULL)
- {
- log_warning(
- " Couldn't find movie \"%s\" to set target to!"
- " Not setting target at all...",
- target_name.c_str());
- }
- else
- {
- env.set_target(new_target);
- }
+ CommonSetTarget(env, target_name);
}
void
@@ -1835,6 +1795,37 @@
}
}
+// Common code for SetTarget and SetTargetExpression. See:
+// http://sswf.sourceforge.net/SWFalexref.html#action_set_target
+// http://sswf.sourceforge.net/SWFalexref.html#action_get_dynamic
+void
+SWFHandlers::CommonSetTarget(as_environment& env, const std::string&
target_name)
+{
+ character *new_target;
+
+ // if the string is blank, we set target to the root movie
+ // TODO - double check this is correct?
+ if ( target_name.empty() ) {
+ new_target = env.find_target(std::string("/"));
+ } else {
+ new_target = env.find_target(target_name);
+ }
+
+ if (new_target == NULL)
+ {
+ IF_VERBOSE_ASCODING_ERRORS (
+ log_warning(
+ "Couldn't find movie \"%s\" to set target to!"
+ " Not setting target at all...",
+ target_name.c_str());
+ );
+ }
+ else
+ {
+ env.set_target(new_target);
+ }
+}
+
void
SWFHandlers::ActionGetUrl2(ActionExec& thread)
{
Index: server/vm/ASHandlers.h
===================================================================
RCS file: /sources/gnash/gnash/server/vm/ASHandlers.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- server/vm/ASHandlers.h 8 Dec 2006 23:46:46 -0000 1.3
+++ server/vm/ASHandlers.h 13 Dec 2006 11:08:10 -0000 1.4
@@ -157,6 +157,20 @@
as_value target, const char* url,
uint8_t method);
+ /// Common code for SetTarget and SetTargetExpression
+ //
+ /// @see http://sswf.sourceforge.net/SWFalexref.html#action_set_target
+ /// @see http://sswf.sourceforge.net/SWFalexref.html#action_get_dynamic
+ ///
+ /// @param target_name
+ /// The target name. If empty new target will be the main movie.
+ ///
+ /// @param env
+ /// The current execution environment.
+ ///
+ static void CommonSetTarget(as_environment& env,
+ const std::string& target_name);
+
static void ActionEnd(ActionExec& thread);
static void ActionNextFrame(ActionExec& thread);
static void ActionPrevFrame(ActionExec& thread);
- [Gnash-commit] gnash ChangeLog server/vm/ASHandlers.cpp server...,
Sandro Santilli <=