CVSROOT: /sources/gnash Module name: gnash Changes by: Sandro Santilli <strk> 07/08/19 20:01:13
Modified files: . : ChangeLog doc/C/usermanual/usage: gnashrc.xml libbase : rc.cpp rc.h server/vm : VM.cpp testsuite/libbase: TCXXRc.cpp gnashrc.in Log message: * doc/C/usermanual/usage/gnashrc.xml: document flashVersionString variable. Patch #6155 by Benjamin Wolsey <[EMAIL PROTECTED]>: * libbase/rc.{cpp,h}: Avoid string copies in inspectors; add getFlashVersionString (support for "set flashVersionString Bla bla bla" in gnashrc). * server/vm/VM.cpp (getPlayerVersion): Query RcInit for version string * testsuite/libbase/: TCXXRc.cpp, gnashrc.in: Add test for CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4036&r2=1.4037 http://cvs.savannah.gnu.org/viewcvs/gnash/doc/C/usermanual/usage/gnashrc.xml?cvsroot=gnash&r1=1.6&r2=1.7 http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/rc.cpp?cvsroot=gnash&r1=1.27&r2=1.28 http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/rc.h?cvsroot=gnash&r1=1.21&r2=1.22 http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/VM.cpp?cvsroot=gnash&r1=1.14&r2=1.15 http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/libbase/TCXXRc.cpp?cvsroot=gnash&r1=1.14&r2=1.15 http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/libbase/gnashrc.in?cvsroot=gnash&r1=1.5&r2=1.6 Patches: Index: ChangeLog =================================================================== RCS file: /sources/gnash/gnash/ChangeLog,v retrieving revision 1.4036 retrieving revision 1.4037 diff -u -b -r1.4036 -r1.4037 --- ChangeLog 19 Aug 2007 19:54:48 -0000 1.4036 +++ ChangeLog 19 Aug 2007 20:01:12 -0000 1.4037 @@ -1,3 +1,18 @@ +2007-08-19 Sandro Santilli <[EMAIL PROTECTED]> + + * doc/C/usermanual/usage/gnashrc.xml: document + flashVersionString variable. + +2007-08-19 Benjamin Wolsey <[EMAIL PROTECTED]> + + * libbase/rc.{cpp,h}: Avoid string copies in inspectors; + add getFlashVersionString (support for + "set flashVersionString Bla bla bla" in gnashrc). + * server/vm/VM.cpp (getPlayerVersion): Query RcInit for version + string + * testsuite/libbase/: TCXXRc.cpp, gnashrc.in: + Add test for + 2007-08-19 Markus Gothe <[EMAIL PROTECTED]> * testsuite/libbase/Makefile.am: Added DEJAGNU_CFLAGS. Index: doc/C/usermanual/usage/gnashrc.xml =================================================================== RCS file: /sources/gnash/gnash/doc/C/usermanual/usage/gnashrc.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -u -b -r1.6 -r1.7 --- doc/C/usermanual/usage/gnashrc.xml 16 Aug 2007 14:25:58 -0000 1.6 +++ doc/C/usermanual/usage/gnashrc.xml 19 Aug 2007 20:01:12 -0000 1.7 @@ -134,6 +134,22 @@ for the plugin, so you have to explicitly start any movie on a webpage. This option is <emphasis>off</emphasis> by default. </entry> </row> +<row> +<entry>flashVersionString</entry> +<entry>string</entry> +<entry>Set the string returned by $version and System.capabilities.version. + Useful to get around some flash version detection movies. + Note that the version advertised by the plugin is NOT affected by this setting, + instead you need to set the GNASH_FLASH_VERSION environment variable for + the latter (which doesn't affect $version and System.capabilities.version).</entry> +</row> +<row> +<entry>StartStopped</entry> +<entry>on/off</entry> +<entry>Set to <emphasis>on</emphasis> to have the GUI start in "stop" mode. This is useful in particular + for the plugin, so you have to explicitly start any movie on a webpage. This option is <emphasis>off</emphasis> by default. + </entry> +</row> </tbody> </tgroup> </table> Index: libbase/rc.cpp =================================================================== RCS file: /sources/gnash/gnash/libbase/rc.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -u -b -r1.27 -r1.28 --- libbase/rc.cpp 12 Jul 2007 23:03:49 -0000 1.27 +++ libbase/rc.cpp 19 Aug 2007 20:01:13 -0000 1.28 @@ -53,6 +53,10 @@ _debug(false), _debugger(false), _verbosity(-1), + _flashVersionString("GSH "\ + DEFAULT_FLASH_MAJOR_VERSION","\ + DEFAULT_FLASH_MINOR_VERSION","\ + DEFAULT_FLASH_REV_NUMBER ",0"), _actiondump(false), _parserdump(false), _verboseASCodingErrors(false), @@ -60,6 +64,7 @@ _splash_screen(true), _localdomain_only(false), _localhost_only(false), + _log("gnash-dbg.log"), _sound(true), _plugin_sound(true), _extensionsEnabled(false), @@ -128,8 +133,8 @@ } int -RcInitFile::extractNumber(int *num, const char *pattern, std::string &variable, - std::string &value) +RcInitFile::extractNumber(int *num, const char *pattern, string &variable, + string &value) { // GNASH_REPORT_FUNCTION; // log_msg ("%s: %s", variable.c_str(), value.c_str()); @@ -176,7 +181,11 @@ continue; } - in >> variable >> value; + in >> variable; + getline(in, value); + string::size_type position = value.find_first_not_of(' '); + if(position != string::npos) value.erase(0, position); + // log_msg ("%s %s %s", action, variable, value); if (action == "set") { @@ -197,6 +206,14 @@ extractNumber(&_delay, "delay", variable, value); extractNumber(&_verbosity, "verbosity", variable, value); + if (variable == "flashVersionString") { + _flashVersionString = value; + } + + if (variable == "debuglog") { + _log = value; + } + if (variable == "documentroot") { _wwwroot = value; } @@ -335,6 +352,9 @@ if (_log.size()) { cerr << "\tDebug Log name is: " << _log << endl; } + if (_flashVersionString.size()) { + cerr << "\tFlash Version String is: " << _flashVersionString << endl; + } // std::vector<std::string> _whitelist; // std::vector<std::string> _blacklist; Index: libbase/rc.h =================================================================== RCS file: /sources/gnash/gnash/libbase/rc.h,v retrieving revision 1.21 retrieving revision 1.22 diff -u -b -r1.21 -r1.22 --- libbase/rc.h 12 Jul 2007 23:03:49 -0000 1.21 +++ libbase/rc.h 19 Aug 2007 20:01:13 -0000 1.22 @@ -76,7 +76,7 @@ int verbosityLevel() const { return _verbosity; } void verbosityLevel(int value) { _verbosity = value; } - std::string getDebugLog() const { return _log; } + const std::string& getDebugLog() const { return _log; } std::string getDocumentRoot() { return _wwwroot; } bool useDebugger() const { return _debugger; } @@ -105,6 +105,8 @@ const std::vector<std::string>& getWhiteList() const { return _whitelist; } const std::vector<std::string>& getBlackList() const { return _blacklist; } + const std::string& getFlashVersionString() const { return _flashVersionString; } + int getRetries() const { return _retries; } void setRetries(int x) { _retries = x; } @@ -122,6 +124,7 @@ bool _debug; // enable debugging of this class bool _debugger; // enable the Flash movie debugger int _verbosity; + std::string _flashVersionString; //String to pass as $version in Actionscript bool _actiondump; // enable dumping actionscript classes bool _parserdump; // enable dumping parser data Index: server/vm/VM.cpp =================================================================== RCS file: /sources/gnash/gnash/server/vm/VM.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -u -b -r1.14 -r1.15 --- server/vm/VM.cpp 18 Aug 2007 12:24:41 -0000 1.14 +++ server/vm/VM.cpp 19 Aug 2007 20:01:13 -0000 1.15 @@ -16,7 +16,7 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -/* $Id: VM.cpp,v 1.14 2007/08/18 12:24:41 strk Exp $ */ +/* $Id: VM.cpp,v 1.15 2007/08/19 20:01:13 strk Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -28,9 +28,13 @@ #include "movie_root.h" #include "Global.h" #include "tu_timer.h" // for tu_timer::get_ticks() +#include "rc.h" //for overriding default version string with rcfile #include <memory> +namespace { +gnash::RcInitFile& rcfile = gnash::RcInitFile::getDefaultInstance(); +} namespace gnash { @@ -104,18 +108,8 @@ const std::string& VM::getPlayerVersion() const { - // Expected Form: UNIX|WIN|WINCE|MAC (major version),(minor version),(revision),0 - // Used in _ActionScript_ version detection, not Javascript - // ActionScript detection often looks for the commas, so - // the last ,0 is necessary, even if it doesn't appear - // to mean anything. - // - // TODO: query RcInit file for an override - // -#define FLASH_VERSION "GSH "DEFAULT_FLASH_MAJOR_VERSION","\ - DEFAULT_FLASH_MINOR_VERSION","DEFAULT_FLASH_REV_NUMBER",0" - - static const std::string version(FLASH_VERSION); + //From rcfile + static const std::string version(rcfile.getFlashVersionString()); return version; } Index: testsuite/libbase/TCXXRc.cpp =================================================================== RCS file: /sources/gnash/gnash/testsuite/libbase/TCXXRc.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -u -b -r1.14 -r1.15 --- testsuite/libbase/TCXXRc.cpp 12 Jul 2007 23:03:49 -0000 1.14 +++ testsuite/libbase/TCXXRc.cpp 19 Aug 2007 20:01:13 -0000 1.15 @@ -158,6 +158,12 @@ runtest.fail ("enableExtensions"); } + if (rc.getFlashVersionString() == "GSH 9,0,99,0") { + runtest.pass ("getFlashVersionString"); + } else { + runtest.fail ("getFlashVersionString"); + } + if (rc.startStopped() == 1) { runtest.pass ("startStopped"); } else { @@ -175,7 +181,7 @@ } runtest.pass ("rc.getWhiteList() has elements"); } else { - runtest.fail ("rc.getWhiteList() doesn't has elements"); + runtest.fail ("rc.getWhiteList() doesn't have elements"); } std::vector<std::string> blacklist = rc.getBlackList(); @@ -188,7 +194,7 @@ } runtest.pass ("rc.getBlackList() has elements"); } else { - runtest.fail ("rc.getBlackList() doesn't has elements"); + runtest.fail ("rc.getBlackList() doesn't have elements"); } } Index: testsuite/libbase/gnashrc.in =================================================================== RCS file: /sources/gnash/gnash/testsuite/libbase/gnashrc.in,v retrieving revision 1.5 retrieving revision 1.6 diff -u -b -r1.5 -r1.6 --- testsuite/libbase/gnashrc.in 1 Jun 2007 15:01:55 -0000 1.5 +++ testsuite/libbase/gnashrc.in 19 Aug 2007 20:01:13 -0000 1.6 @@ -28,6 +28,9 @@ # The full path to the debug log set debuglog ~/gnash-dbg.log +# Version string to pass to ActionScript +set flashVersionString GSH 9,0,99,0 + # Enable the debugger set debugger off _______________________________________________ Gnash-commit mailing list Gnash-commit@gnu.org http://lists.gnu.org/mailman/listinfo/gnash-commit