[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r10065: Add yesNo() to AbstractIFace
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r10065: Add yesNo() to AbstractIFaceCallback. Remove libcore's dependency on |
Date: |
Thu, 23 Oct 2008 20:56:00 +0200 |
User-agent: |
Bazaar (1.5) |
------------------------------------------------------------
revno: 10065
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Thu 2008-10-23 20:56:00 +0200
message:
Add yesNo() to AbstractIFaceCallback. Remove libcore's dependency on
Gui again. Always answer yes for now.
Cleanup logging.
modified:
gui/Player.cpp
gui/Player.h
libcore/Makefile.am
libcore/movie_root.cpp
libcore/movie_root.h
libcore/vm/ActionExec.cpp
utilities/processor.cpp
=== modified file 'gui/Player.cpp'
--- a/gui/Player.cpp 2008-10-22 21:31:53 +0000
+++ b/gui/Player.cpp 2008-10-23 18:56:00 +0000
@@ -449,6 +449,14 @@
return EXIT_SUCCESS;
}
+bool
+Player::CallbacksHandler::yesNo(const std::string& query)
+{
+ log_debug(_("Received query from core: '%d'. Answering yes until "
+ "this is implemented properly"), query);
+ return true;
+}
+
std::string
Player::CallbacksHandler::call(const std::string& event, const std::string&
arg)
{
=== modified file 'gui/Player.h'
--- a/gui/Player.h 2008-09-12 21:18:45 +0000
+++ b/gui/Player.h 2008-10-23 18:56:00 +0000
@@ -153,11 +153,14 @@
_gui(gui)
{}
- std::string call(const std::string& event, const std::string&
arg);
+ std::string call(const std::string& event,
+ const std::string& arg);
+ bool yesNo(const std::string& query);
- // For handling notification callbacks from ActionScript. The
callback is
- // always sent to a hosting application (i.e. if a file
descriptor is
- // supplied). It is never acted on by Gnash when running as a
plugin.
+ // For handling notification callbacks from ActionScript.
+ // The callback is always sent to a hosting application
+ // (i.e. if a file descriptor is supplied). It is never
+ // acted on by Gnash when running as a plugin.
void notify(const std::string& event, const std::string& arg);
private:
=== modified file 'libcore/Makefile.am'
--- a/libcore/Makefile.am 2008-10-20 17:06:14 +0000
+++ b/libcore/Makefile.am 2008-10-23 18:56:00 +0000
@@ -28,7 +28,6 @@
# Only enable if we're configured with --enable-mp3
AM_CPPFLAGS = \
- -I$(top_srcdir)/gui \
-I$(top_srcdir)/libamf \
-I$(top_srcdir)/libnet \
-I$(top_srcdir)/backend \
=== modified file 'libcore/movie_root.cpp'
--- a/libcore/movie_root.cpp 2008-10-23 16:50:44 +0000
+++ b/libcore/movie_root.cpp 2008-10-23 18:56:00 +0000
@@ -200,7 +200,7 @@
}
catch (ActionLimitException& al)
{
- boost::format fmt = boost::format(_("ActionLimits hit during
setRootMovie: %s. Disable scripts ?")) % al.what();
+ boost::format fmt = boost::format(_("ActionLimits hit during
setRootMovie: %s. Disable scripts?")) % al.what();
handleActionLimitHit(fmt.str());
}
catch (ActionParserException& e)
@@ -216,8 +216,9 @@
movie_root::handleActionLimitHit(const std::string& msg)
{
bool disable = true;
- if ( _gui ) disable = _gui->yesno(msg);
- else log_error("No gui registered, assuming 'Yes' answer to question:
%s", msg);
+ if ( _interfaceHandler ) disable = _interfaceHandler->yesNo(msg);
+ else log_error("No gui registered, assuming 'Yes' answer to "
+ "question: %s", msg);
if ( disable )
{
disableScripts();
=== modified file 'libcore/movie_root.h'
--- a/libcore/movie_root.h 2008-10-23 16:50:44 +0000
+++ b/libcore/movie_root.h 2008-10-23 18:56:00 +0000
@@ -741,12 +741,24 @@
}
/// Call this to notify FS commands
- DSOEXPORT void handleFsCommand(const std::string& cmd, const std::string&
arg) const;
+ DSOEXPORT void handleFsCommand(const std::string& cmd,
+ const std::string& arg) const;
/// Abstract base class for hosting app handler
class AbstractIfaceCallback {
public:
- virtual std::string call(const std::string& cmd, const std::string&
arg)=0;
+
+ /// Get Gui-related information for the core.
+ //
+ /// This should be used for occasional AS calls, such as for
+ /// Mouse.hide, System.capabilities etc. The return can be
+ /// various types, so it is passed as a string.
+ virtual std::string call(const std::string& cmd,
+ const std::string& arg) = 0;
+
+ /// Ask the hosting application for a yes / no answer to
+ /// a question.
+ virtual bool yesNo(const std::string& cmd) = 0;
virtual ~AbstractIfaceCallback() {}
};
=== modified file 'libcore/vm/ActionExec.cpp'
--- a/libcore/vm/ActionExec.cpp 2008-10-20 09:42:00 +0000
+++ b/libcore/vm/ActionExec.cpp 2008-10-23 18:56:00 +0000
@@ -332,8 +332,9 @@
{
if ( ++branchCount > maxBranchCount )
{
- boost::format fmt(_("Loop iterations count exceeded limit
of "
- "%d. Last branch was from pc %d to
%d."));
+ boost::format fmt(_("Loop iterations count exceeded "
+ "limit of %d. Last branch was from pc %d "
+ "to %d"));
fmt % maxBranchCount % oldPc % pc;
throw ActionLimitException(fmt.str());
}
=== modified file 'utilities/processor.cpp'
--- a/utilities/processor.cpp 2008-10-03 09:39:44 +0000
+++ b/utilities/processor.cpp 2008-10-23 18:56:00 +0000
@@ -191,6 +191,11 @@
return "";
}
+
+ bool yesNo(const std::string& /*query*/)
+ {
+ return true;
+ }
};
EventCallback eventCallback;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r10065: Add yesNo() to AbstractIFaceCallback. Remove libcore's dependency on,
Benjamin Wolsey <=