[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] [SCM] Gnash branch, objecturi, updated. 2b517c88e595102b1
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] [SCM] Gnash branch, objecturi, updated. 2b517c88e595102b1abd98aff9b5426d6dc73ae1 |
Date: |
Thu, 23 Sep 2010 00:25:11 +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, objecturi has been updated
via 2b517c88e595102b1abd98aff9b5426d6dc73ae1 (commit)
via f71edcbc2c6e896554e33d911425f91d768c6cdd (commit)
from f7cbadf44f7dd5c921e58334794ac437b1eb821c (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=2b517c88e595102b1abd98aff9b5426d6dc73ae1
commit 2b517c88e595102b1abd98aff9b5426d6dc73ae1
Author: Sandro Santilli <address@hidden>
Date: Thu Sep 23 02:24:48 2010 +0200
Cache ObjectURI for events, to lookup lowercase once per event
diff --git a/libcore/Button.cpp b/libcore/Button.cpp
index ad524f8..6c3183f 100644
--- a/libcore/Button.cpp
+++ b/libcore/Button.cpp
@@ -567,7 +567,7 @@ Button::mouseEvent(const event_id& event)
mr.pushAction(code, movie_root::PRIORITY_DOACTION);
}
- callMethod(getObject(this), event.functionKey());
+ callMethod(getObject(this), event.functionURI());
}
diff --git a/libcore/DisplayObject.cpp b/libcore/DisplayObject.cpp
index 14a6540..a044ec0 100644
--- a/libcore/DisplayObject.cpp
+++ b/libcore/DisplayObject.cpp
@@ -502,7 +502,7 @@ DisplayObject::hasEventHandler(const event_id& id) const
if (!_object) return false;
as_value tmp;
- if (_object->get_member(id.functionKey(), &tmp)) {
+ if (_object->get_member(id.functionURI(), &tmp)) {
return tmp.to_function();
}
return false;
diff --git a/libcore/MovieClip.cpp b/libcore/MovieClip.cpp
index 640d989..aa927a6 100644
--- a/libcore/MovieClip.cpp
+++ b/libcore/MovieClip.cpp
@@ -683,7 +683,7 @@ MovieClip::notifyEvent(const event_id& id)
// Check for member function.
if (!isKeyEvent(id)) {
- callMethod(getObject(this), id.functionKey());
+ callMethod(getObject(this), id.functionURI());
}
// TODO: if this was UNLOAD release as much memory as possible ?
diff --git a/libcore/asobj/Global_as.h b/libcore/asobj/Global_as.h
index 883cd24..6972bf3 100644
--- a/libcore/asobj/Global_as.h
+++ b/libcore/asobj/Global_as.h
@@ -231,7 +231,7 @@ invoke(const as_value& method, const as_environment& env,
as_object* this_ptr,
/// This is a macro to cope with a varying number of arguments. The function
/// signature is as follows:
//
-/// as_value callMethod(as_object* obj, string_table::key key,
+/// as_value callMethod(as_object* obj, const ObjectURI& uri,
/// const as_value& arg1, ..., const as_value& argN);
//
/// If the member function exists and is a function, invoke() is called on
@@ -247,11 +247,11 @@ invoke(const as_value& method, const as_environment& env,
as_object* this_ptr,
/// @return The return value of the call (possibly undefined).
#define CALL_METHOD(x, n, t) \
inline as_value \
-callMethod(as_object* obj, string_table::key key BOOST_PP_COMMA_IF(n)\
+callMethod(as_object* obj, const ObjectURI& uri BOOST_PP_COMMA_IF(n)\
BOOST_PP_REPEAT(n, VALUE_ARG, const as_value&)) {\
if (!obj) return as_value();\
as_value func;\
- if (!obj->get_member(key, &func)) return as_value();\
+ if (!obj->get_member(uri, &func)) return as_value();\
fn_call::Args args;\
BOOST_PP_EXPR_IF(n, (args += BOOST_PP_REPEAT(n, VALUE_ARG, ));)\
return invoke(func, as_environment(getVM(*obj)), obj, args);\
diff --git a/libcore/event_id.cpp b/libcore/event_id.cpp
index 471d66f..3f6b021 100644
--- a/libcore/event_id.cpp
+++ b/libcore/event_id.cpp
@@ -22,6 +22,7 @@
#include "log.h"
#include "event_id.h"
#include "namedStrings.h"
+#include "ObjectURI.h"
#include <map>
#include <string>
@@ -63,10 +64,15 @@ event_id::functionName() const
return it->second;
}
-string_table::key
-event_id::functionKey() const
+const ObjectURI&
+event_id::functionURI() const
{
- typedef std::map<EventCode, string_table::key> EventFunctionMap;
+ typedef std::map<EventCode, ObjectURI> EventFunctionMap;
+
+ // TODO: make this table non-static, as
+ // it contains string_table-dependent
+ // mutable entries
+ //
static const EventFunctionMap e = boost::assign::map_list_of
(PRESS, NSV::PROP_ON_PRESS)
(RELEASE, NSV::PROP_ON_RELEASE)
diff --git a/libcore/event_id.h b/libcore/event_id.h
index 84116da..0603dbd 100644
--- a/libcore/event_id.h
+++ b/libcore/event_id.h
@@ -22,9 +22,13 @@
#define GNASH_EVENT_ID_H
#include <string>
-#include "string_table.h"
#include "GnashKey.h"
+// Forward declarations
+namespace gnash {
+ class ObjectURI;
+}
+
namespace gnash {
@@ -143,9 +147,9 @@ public:
/// corresponding to this event.
const std::string& functionName() const;
- /// Return the string_table key of a method-handler function
+ /// Return the ObjectURI of a method-handler function
/// corresponding to this event.
- string_table::key functionKey() const;
+ const ObjectURI& functionURI() const;
/// Return the keycode associated with this event_id.
//
http://git.savannah.gnu.org/cgit//commit/?id=f71edcbc2c6e896554e33d911425f91d768c6cdd
commit f71edcbc2c6e896554e33d911425f91d768c6cdd
Author: Sandro Santilli <address@hidden>
Date: Thu Sep 23 01:41:00 2010 +0200
missing include
diff --git a/libcore/DisplayList.cpp b/libcore/DisplayList.cpp
index 7044bf4..c6d4e52 100644
--- a/libcore/DisplayList.cpp
+++ b/libcore/DisplayList.cpp
@@ -24,6 +24,7 @@
#include "Renderer.h"
#include "StringPredicates.h"
#include "MovieClip.h"
+#include "ObjectURI.h"
#include <typeinfo>
#include <iostream>
-----------------------------------------------------------------------
Summary of changes:
libcore/Button.cpp | 2 +-
libcore/DisplayList.cpp | 1 +
libcore/DisplayObject.cpp | 2 +-
libcore/MovieClip.cpp | 2 +-
libcore/asobj/Global_as.h | 6 +++---
libcore/event_id.cpp | 12 +++++++++---
libcore/event_id.h | 10 +++++++---
7 files changed, 23 insertions(+), 12 deletions(-)
hooks/post-receive
--
Gnash
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] [SCM] Gnash branch, objecturi, updated. 2b517c88e595102b1abd98aff9b5426d6dc73ae1,
Sandro Santilli <=