[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog gui/Player.cpp
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] gnash ChangeLog gui/Player.cpp |
Date: |
Fri, 04 Apr 2008 19:52:55 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Benjamin Wolsey <bwy> 08/04/04 19:52:54
Modified files:
. : ChangeLog
gui : Player.cpp
Log message:
* gui/Player.cpp: document fscommand, edit logging calls, drop
some dead code.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6184&r2=1.6185
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/Player.cpp?cvsroot=gnash&r1=1.95&r2=1.96
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6184
retrieving revision 1.6185
diff -u -b -r1.6184 -r1.6185
--- ChangeLog 4 Apr 2008 19:05:15 -0000 1.6184
+++ ChangeLog 4 Apr 2008 19:52:54 -0000 1.6185
@@ -1,3 +1,8 @@
+2008-04-04 Benjamin Wolsey <address@hidden>
+
+ * gui/Player.cpp: document fscommand, edit logging calls, drop
+ some dead code.
+
2008-04-04 Sandro Santilli <address@hidden>
* extensions/gnashrc: force useless options off.
Index: gui/Player.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/Player.cpp,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -b -r1.95 -r1.96
--- gui/Player.cpp 4 Apr 2008 14:54:46 -0000 1.95
+++ gui/Player.cpp 4 Apr 2008 19:52:54 -0000 1.96
@@ -65,7 +65,6 @@
URL::parse_querystring(varstr, vars);
_gui->addFlashVars(vars);
- //si->setVariables(vars);
}
Player::Player()
@@ -323,10 +322,6 @@
setBaseUrl(it->second);
continue;
}
-
- // too much noise...
- //log_debug(_("Unused parameter %s = %s"),
- // it->first.c_str(), it->second.c_str());
}
// Set base url for this movie (needed before parsing)
@@ -399,7 +394,9 @@
}
// static private
-// For handling notification callbacks from ActionScript.
+// 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
Player::fs_callback(gnash::sprite_instance* movie, const std::string& command,
const
std::string& args)
@@ -408,7 +405,8 @@
gnash::RcInitFile& rcfile = gnash::RcInitFile::getDefaultInstance();
- int hostfd = VM::get().getRoot().getHostFD(); // it's _hostfd, but
we're a static method...
+ // it's _hostfd, but we're a static method...
+ int hostfd = VM::get().getRoot().getHostFD();
if ( hostfd != -1 )
{
//log_debug("user-provided host requests fd is %d", hostfd);
@@ -424,32 +422,43 @@
int ret = write(hostfd, cmd, len);
if ( ret == -1 )
{
- log_error("Could not write to user-provided host
requests fd %d: %s", hostfd, strerror(errno));
+ log_error("Could not write to user-provided host "
+ "requests fd %d: %s", hostfd, strerror(errno));
}
- if ( (size_t)ret < len )
+ if ( static_cast<size_t>(ret) < len )
{
- log_error("Could only write %d bytes over "SIZET_FMT"
required to user-provided host requests fd %d",
+ log_error("Could only write %d bytes over %d required to "
+ "user-provided host requests fd %d",
ret, len, hostfd);
}
- requestString.resize(requestString.size()-1); // for sake of
clean logging, should always end with newline
- log_debug(_("Sent request '%s' to host fd %d"), requestString,
hostfd);
+
+ // Remove the newline for logging
+ requestString.resize(requestString.size() - 1);
+ log_debug(_("Sent FsCommand '%s' to host fd %d"),
+ requestString, hostfd);
}
/// Fscommands can be ignored using an rcfile setting. As a
/// plugin they are always ignored.
if (_gui->isPlugin())
{
- log_debug(_("Running as plugin: skipping internal handling of
fscommand %s%s."),
- command,
- (hostfd != -1) ? _(" (but INVOKE request was still sent
to host application)")
- : _(" (and no host fd given)"));
+ // We log the request to the fd above
+ log_debug(_("Running as plugin: skipping internal "
+ "handling of FsCommand %s%s."));
return;
}
+ // This only disables fscommands for the standalone player. In the
+ // plugin or a hosting application, the fscommands are always passed
+ // on; the hosting application should decide what to do with them.
+ // (Or do we want to allow disabling all external communication?)
if (rcfile.ignoreFSCommand()) return;
StringNoCaseEqual noCaseCompare;
+ // There are six defined FsCommands handled by the standalone player:
+ // quit, fullscreen, showmenu, exec, allowscale, and trapallkeys.
+
// FSCommand quit
if (noCaseCompare(command, "quit"))
{
@@ -476,29 +485,30 @@
// FSCommand exec
// Note: the pp insists that the file to execute should be in
// a subdirectory 'fscommand' of the 'projector' executable's
- // location.
- // In SWF5 there were no restrictions.
+ // location. In SWF5 there were no restrictions.
if (noCaseCompare(command, "exec"))
{
- log_unimpl(_("FScommand exec called with argument %s"), args);
+ log_unimpl(_("FsCommand exec called with argument %s"), args);
return;
}
// FSCommand allowscale
if (noCaseCompare(command, "allowscale"))
{
- log_unimpl(_("FScommand allowscale called with argument %s"), args);
+ log_unimpl(_("FsCommand allowscale called with argument %s"), args);
return;
}
// FSCommand trapallkeys
if (noCaseCompare(command, "trapallkeys"))
{
- log_unimpl(_("FScommand trapallkeys called with argument %s"), args);
+ log_unimpl(_("FsCommand trapallkeys called with argument %s"), args);
return;
}
- log_debug(_("FSCommand '%s(%s)' not handled by the standalone player
(might have been by the hosting app)"),
+ // The plugin never reaches this point; anything sent to the fd has
+ // been logged already.
+ log_debug(_("FsCommand '%s(%s)' not handled internally"),
command, args);
}