gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, master, updated. ae8ac63d8c2fed12f879


From: Benjamin Wolsey
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. ae8ac63d8c2fed12f8796b7a57f548e35a414b9a
Date: Wed, 17 Nov 2010 09:26:39 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  ae8ac63d8c2fed12f8796b7a57f548e35a414b9a (commit)
       via  8dc70ffbc1ca2cecb0ad87df91365c081265c127 (commit)
      from  6632445f89338d2abc0c43adb33211481d95c79f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=ae8ac63d8c2fed12f8796b7a57f548e35a414b9a


commit ae8ac63d8c2fed12f8796b7a57f548e35a414b9a
Author: Benjamin Wolsey <address@hidden>
Date:   Wed Nov 17 10:21:33 2010 +0100

    Don't forget initialization!

diff --git a/gui/gnash.cpp b/gui/gnash.cpp
index f461deb..9f9a02b 100644
--- a/gui/gnash.cpp
+++ b/gui/gnash.cpp
@@ -85,7 +85,7 @@ template<typename T>
 class accumulator_type : public po::value_semantic {
 public:
 
-    accumulator_type() : _interval(1) {}
+    accumulator_type() : _interval(1), _default(0) {}
 
     /// Set the notifier function.
     accumulator_type* notifier(boost::function1<void, const T&> f) {

http://git.savannah.gnu.org/cgit//commit/?id=8dc70ffbc1ca2cecb0ad87df91365c081265c127


commit 8dc70ffbc1ca2cecb0ad87df91365c081265c127
Author: Benjamin Wolsey <address@hidden>
Date:   Wed Nov 17 09:45:47 2010 +0100

    Move find_target out of class.

diff --git a/libcore/as_environment.cpp b/libcore/as_environment.cpp
index 8022a5f..10afffb 100644
--- a/libcore/as_environment.cpp
+++ b/libcore/as_environment.cpp
@@ -259,19 +259,6 @@ as_environment::set_variable(const std::string& varname, 
const as_value& val,
     }
 }
 
-/// Find the sprite/movie referenced by the given path.
-//
-/// Supports both /slash/syntax and dot.syntax
-//
-/// @return     The found DisplayObject or 0 if it is not a DisplayObject.
-DisplayObject*
-as_environment::find_target(const std::string& path_in) const
-{
-    as_object* o = find_object(path_in);
-    return get<DisplayObject>(o); 
-}
-
-
 as_object*
 as_environment::find_object(const std::string& path,
         const ScopeStack* scopeStack) const
@@ -692,6 +679,13 @@ next_slash_or_dot(const char* word)
 
 } // unnamed namespace 
 
+DisplayObject*
+findTarget(const as_environment& env, const std::string& path)
+{
+    return get<DisplayObject>(env.find_object(path));
+}
+
+
 string_table&
 getStringTable(const as_environment& env)
 {
diff --git a/libcore/as_environment.h b/libcore/as_environment.h
index 65e271e..c84f541 100644
--- a/libcore/as_environment.h
+++ b/libcore/as_environment.h
@@ -41,7 +41,6 @@ namespace gnash {
 /// ActionScript execution environment.
 class as_environment
 {
-
 public:
 
     /// A stack of objects used for variables/members lookup
@@ -141,11 +140,6 @@ public:
     /// Only the targets are reachable.
     void markReachableResources() const;
 
-    /// Find the sprite/movie referenced by the given path.
-    //
-    /// Supports both /slash/syntax and dot.syntax
-    DisplayObject* find_target(const std::string& path) const;
-
     /// Find the object referenced by the given path.
     //
     /// Supports both /slash/syntax and dot.syntax
@@ -195,6 +189,16 @@ private:
 bool parsePath(const std::string& var_path, std::string& path,
         std::string& var);
 
+/// Find the DisplayObject referenced by the given path.
+//
+/// Supports both /slash/syntax and dot.syntax. This is a wrapper round
+/// get_object().
+//
+/// Note that only AS-referenceable DisplayObjects can be found by path,
+/// so that the returned object (if it exists) will have an associated
+/// as_object. This logic can't be reflected in the return type.
+DisplayObject* findTarget(const as_environment& env, const std::string& path);
+
 inline VM&
 getVM(const as_environment& env)
 {
@@ -206,10 +210,9 @@ string_table& getStringTable(const as_environment& env);
 int getSWFVersion(const as_environment& env);
 Global_as& getGlobal(const as_environment &env);
 
-} // end namespace gnash
-
+} // namespace gnash
 
-#endif // GNASH_AS_ENVIRONMENT_H
+#endif 
 
 
 // Local Variables:
diff --git a/libcore/asobj/Color_as.cpp b/libcore/asobj/Color_as.cpp
index e6d833d..b3a423b 100644
--- a/libcore/asobj/Color_as.cpp
+++ b/libcore/asobj/Color_as.cpp
@@ -275,7 +275,7 @@ getTarget(as_object* obj, const fn_call& fn)
     const as_value& target = getMember(*obj, NSV::PROP_TARGET);
     MovieClip* sp = target.toMovieClip();
     if (sp) return sp;
-    DisplayObject* o = fn.env().find_target(target.to_string());
+    DisplayObject* o = findTarget(fn.env(), target.to_string());
     if (o) return o->to_movie();
     return 0;
 }
diff --git a/libcore/asobj/MovieClipLoader.cpp 
b/libcore/asobj/MovieClipLoader.cpp
index 93f0f3d..d133400 100644
--- a/libcore/asobj/MovieClipLoader.cpp
+++ b/libcore/asobj/MovieClipLoader.cpp
@@ -131,7 +131,7 @@ moviecliploader_loadClip(const fn_call& fn)
     movie_root& mr = getRoot(*ptr);
 
     // TODO: check if this logic can be generic to movie_root::loadMovie
-       DisplayObject* target = fn.env().find_target(tgt_str);
+       DisplayObject* target = findTarget(fn.env(), tgt_str);
     unsigned int junk;
        if (!target && ! isLevelTarget(getSWFVersion(fn), tgt_str, junk) ) {
                IF_VERBOSE_ASCODING_ERRORS(
diff --git a/libcore/asobj/MovieClip_as.cpp b/libcore/asobj/MovieClip_as.cpp
index b9b0162..f786f84 100644
--- a/libcore/asobj/MovieClip_as.cpp
+++ b/libcore/asobj/MovieClip_as.cpp
@@ -997,7 +997,7 @@ movieclip_hitTest(const fn_call& fn)
         case 1: // target
         {
             const as_value& tgt_val = fn.arg(0);
-            DisplayObject* target = fn.env().find_target(tgt_val.to_string());
+            DisplayObject* target = findTarget(fn.env(), tgt_val.to_string());
             if ( ! target )
             {
                 IF_VERBOSE_ASCODING_ERRORS(
diff --git a/libcore/asobj/Selection_as.cpp b/libcore/asobj/Selection_as.cpp
index 556714f..04c4247 100644
--- a/libcore/asobj/Selection_as.cpp
+++ b/libcore/asobj/Selection_as.cpp
@@ -208,7 +208,7 @@ selection_setFocus(const fn_call& fn)
 
     if (focus.is_string()) {
         const std::string& target = focus.to_string();
-        ch = fn.env().find_target(target);
+        ch = findTarget(fn.env(), target);
     }
     else {
         /// Try converting directly to DisplayObject.
diff --git a/libcore/vm/ASHandlers.cpp b/libcore/vm/ASHandlers.cpp
index 77f82c6..7bfb397 100644
--- a/libcore/vm/ASHandlers.cpp
+++ b/libcore/vm/ASHandlers.cpp
@@ -1059,7 +1059,7 @@ ActionGetProperty(ActionExec& thread)
         }
     }
     else {
-        target = env.find_target(tgt_str);
+        target = findTarget(env, tgt_str);
     }
  
     // FIXME: what happens when it's an invalid number? This will cause
@@ -1085,7 +1085,7 @@ ActionSetProperty(ActionExec& thread)
 {
     as_environment& env = thread.env;
 
-    DisplayObject *target = env.find_target(env.top(2).to_string());
+    DisplayObject *target = findTarget(env, env.top(2).to_string());
     // FIXME: what happens when it's an invalid number? This will cause
     // undefined behaviour on overflow.
     unsigned int prop_number = toNumber(env.top(1), getVM(env));
@@ -1132,7 +1132,7 @@ ActionDuplicateClip(ActionExec& thread)
     const std::string& newname = env.top(1).to_string();
     const std::string& path = env.top(2).to_string();
 
-    DisplayObject* ch = env.find_target(path);
+    DisplayObject* ch = findTarget(env, path);
     if (!ch) {
         IF_VERBOSE_ASCODING_ERRORS(
             log_aserror(_("Path given to duplicateMovieClip(%s) doesn't "
@@ -1164,7 +1164,7 @@ ActionRemoveClip(ActionExec& thread)
 
     const std::string path = env.pop().to_string();
 
-    DisplayObject* ch = env.find_target(path);
+    DisplayObject* ch = findTarget(env, path);
     if (!ch) {
         IF_VERBOSE_ASCODING_ERRORS(
             log_aserror(_("Path given to removeMovieClip(%s) doesn't "
@@ -1208,7 +1208,7 @@ ActionStartDragMovie(ActionExec& thread)
     assert(thread.atActionTag(SWF::ACTION_STARTDRAGMOVIE));
 #endif
 
-    DisplayObject* tgt = env.find_target(env.top(0).to_string());
+    DisplayObject* tgt = findTarget(env, env.top(0).to_string());
     if (tgt) {
         // mark this DisplayObject as script transformed.
         tgt->transformedByScript();
@@ -1977,7 +1977,7 @@ ActionCallFrame(ActionExec& thread)
 
     DisplayObject* target = 0;
     if (parsePath(target_frame, target_path, frame_var)) {
-        target = env.find_target(target_path);
+        target = findTarget(env, target_path);
     }
     else {
         frame_var = target_frame;
@@ -2027,7 +2027,7 @@ ActionGotoExpression(ActionExec& thread)
 
     DisplayObject* target = NULL;
     if (parsePath(target_frame, target_path, frame_var)) {
-        target = env.find_target(target_path);
+        target = findTarget(env, target_path);
     }
 
     // 4.11 would make parsePath above return true,
@@ -3570,7 +3570,7 @@ commonGetURL(as_environment& env, as_value target,
             target_string, url, static_cast<int>(method),
             sendVarsMethod, loadTargetFlag, loadVariableFlag);
 
-    DisplayObject* target_ch = env.find_target(target.to_string());
+    DisplayObject* target_ch = findTarget(env, target.to_string());
     MovieClip* target_movie = target_ch ? target_ch->to_movie() : 0;
 
     if (loadVariableFlag) {
@@ -3683,7 +3683,7 @@ commonSetTarget(ActionExec& thread, const std::string& 
target_name)
     if (target_name.empty()) return;
 
     // TODO: pass thread.getScopeStack()
-    DisplayObject* new_target = env.find_target(target_name); 
+    DisplayObject* new_target = findTarget(env, target_name); 
     if (!new_target) {
         IF_VERBOSE_ASCODING_ERRORS (
             log_aserror(_("Couldn't find movie \"%s\" to set target to!"

-----------------------------------------------------------------------

Summary of changes:
 gui/gnash.cpp                     |    2 +-
 libcore/as_environment.cpp        |   20 +++++++-------------
 libcore/as_environment.h          |   21 ++++++++++++---------
 libcore/asobj/Color_as.cpp        |    2 +-
 libcore/asobj/MovieClipLoader.cpp |    2 +-
 libcore/asobj/MovieClip_as.cpp    |    2 +-
 libcore/asobj/Selection_as.cpp    |    2 +-
 libcore/vm/ASHandlers.cpp         |   18 +++++++++---------
 8 files changed, 33 insertions(+), 36 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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