gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog doc/C/usermanual/usage/gnashrc....


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog doc/C/usermanual/usage/gnashrc....
Date: Wed, 26 Dec 2007 18:03:48 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/12/26 18:03:48

Modified files:
        .              : ChangeLog 
        doc/C/usermanual/usage: gnashrc.xml 
        libbase        : rc.cpp rc.h 
        server/vm      : ASHandlers.cpp 
        testsuite/libbase: TCXXRc.cpp gnashrc.in 

Log message:
        Add support for user-specified external URL  handler. See bug #21155.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5262&r2=1.5263
http://cvs.savannah.gnu.org/viewcvs/gnash/doc/C/usermanual/usage/gnashrc.xml?cvsroot=gnash&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/rc.cpp?cvsroot=gnash&r1=1.49&r2=1.50
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/rc.h?cvsroot=gnash&r1=1.38&r2=1.39
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ASHandlers.cpp?cvsroot=gnash&r1=1.173&r2=1.174
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/libbase/TCXXRc.cpp?cvsroot=gnash&r1=1.22&r2=1.23
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/libbase/gnashrc.in?cvsroot=gnash&r1=1.11&r2=1.12

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5262
retrieving revision 1.5263
diff -u -b -r1.5262 -r1.5263
--- ChangeLog   26 Dec 2007 15:52:33 -0000      1.5262
+++ ChangeLog   26 Dec 2007 18:03:46 -0000      1.5263
@@ -1,5 +1,16 @@
 2007-12-26 Sandro Santilli <address@hidden>
 
+       * libbase/rc.{cpp,h}: add support for an urlOpenerFormat directive.
+       * server/vm/ASHandlers.cpp (CommonGetUrl): use new
+         RcInitFile::geURLOpenerFormat() method to obtain command to
+         use for opening an external url. See bug #21155.
+       * doc/C/usermanual/usage/gnashrc.xml: document new urlOpenerFormat
+         directive.
+       * testsuite/libbase/: TCXXRc.cpp, gnashrc.in: test urlOpenerFormat
+         directive.
+
+2007-12-26 Sandro Santilli <address@hidden>
+
        * server/edit_text_character.cpp (format_text): don't truncate
          or word-wrap long lines if autoSize is on.
 

Index: doc/C/usermanual/usage/gnashrc.xml
===================================================================
RCS file: /sources/gnash/gnash/doc/C/usermanual/usage/gnashrc.xml,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- doc/C/usermanual/usage/gnashrc.xml  20 Oct 2007 09:16:05 -0000      1.15
+++ doc/C/usermanual/usage/gnashrc.xml  26 Dec 2007 18:03:47 -0000      1.16
@@ -194,6 +194,22 @@
 to curl --insecure. By default, this option is <emphasis>off</emphasis> and
 connections will fail when a host cannot be verified.</entry>
 </row>
+
+<row>
+<entry>URLOpenerFormat</entry>
+<entry>string</entry>
+<entry>
+Set the format of an url opener command. The %u label would be substituted by 
the actual url to be opened.
+Examples:
+<programlisting>
+ set urlOpenerFormat firefox -remote 'openurl(%u)'
+ set urlOpenerFormat xdg-open %u
+ set urlOpenerFormat open %u
+ set urlOpenerFormat kfmclient exec %u
+</programlisting>
+</entry>
+</row>
+
 </tbody>
 </tgroup>
 </table>
@@ -254,6 +270,9 @@
     # Make sure SSL connections are always verified
     set insecureSSL off
 
+    # Use firefox to open urls
+    set urlOpenerFormat firefox -remote 'openurl(%u)'
+
   </programlisting>
 
 

Index: libbase/rc.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/rc.cpp,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -b -r1.49 -r1.50
--- libbase/rc.cpp      26 Dec 2007 00:46:48 -0000      1.49
+++ libbase/rc.cpp      26 Dec 2007 18:03:47 -0000      1.50
@@ -67,6 +67,8 @@
                            _debug(false),
                            _debugger(false),
                            _verbosity(-1),
+                           // will be reset to something else if __OS2__x is 
defined
+                           _urlOpenerFormat("firefox -remote 'openurl(%u)'"),
                            _flashVersionString(
                                DEFAULT_FLASH_PLATFORM_ID" "\
                                DEFAULT_FLASH_MAJOR_VERSION","\
@@ -97,6 +99,14 @@
 {
 //    GNASH_REPORT_FUNCTION;
     loadFiles();
+#ifdef __OS2__x
+    _urlOpenerFormat = PrfQueryProfileString( HINI_USER, (PSZ) 
"WPURLDEFAULTSETTINGS",
+                       (PSZ) "DefaultBrowserExe", NULL,
+                       (PVOID) browserExe, (LONG)sizeof(browserExe) );
+       _urlOPenerFormat += " -remote 'openurl(%u)'";
+#endif
+
+    // TODO: fetch GNASH_URLOPENER_FORMAT from the environment
 }
 
 RcInitFile::~RcInitFile()
@@ -376,6 +386,11 @@
 
             if (noCaseCompare(action, "set") || noCaseCompare(action, 
"append") ) {
 
+                if (noCaseCompare(variable, "urlOpenerFormat")) {
+                    _urlOpenerFormat = value;
+                    continue;
+                }
+
                 if (noCaseCompare(variable, "flashVersionString")) {
                     _flashVersionString = value;
                     continue;

Index: libbase/rc.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/rc.h,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -b -r1.38 -r1.39
--- libbase/rc.h        26 Dec 2007 00:46:48 -0000      1.38
+++ libbase/rc.h        26 Dec 2007 18:03:47 -0000      1.39
@@ -143,6 +143,16 @@
     // Get the location of the sandbox for .sol files
     const std::string &getSOLSafeDir() const { return _solsandbox; }
 
+    /// Get the URL opener command format
+    //
+    /// The %u label will need to be substituted by the actual url
+    /// properly excaped.
+    ///
+    const std::string &getURLOpenerFormat() const
+    {
+        return _urlOpenerFormat;
+    }
+
     // Set the location of the sandbox for .sol files
     void setSOLSafeDir(std::string &x) { _solsandbox = x; }
 
@@ -168,15 +178,32 @@
     bool _debug;                // enable debugging of this class
     bool _debugger;             // enable the Flash movie debugger
     uint32_t  _verbosity;
-    std::string  _flashVersionString;   // String to pass as $version in 
Actionscript
-    std::string  _flashSystemOS;        // String to pass as 
System.capabilities.os
-                                       // in Actionscript. If empty, leaves 
detection
-                                       // to System.cpp (default).
-    std::string  _flashSystemManufacturer;     // String to pass as
-                                               // 
System.capabilities.manufacturer
-                                               // in Actionscript
-    bool _actionDump;           // enable dumping actionscript classes
-    bool _parserDump;           // enable dumping parser data
+
+    /// Command format to use to open urls
+    //
+    /// The %u label will need to be substituted by the url
+    /// (properly escaped)
+    ///
+    std::string  _urlOpenerFormat;
+
+    /// String to pass as $version in Actionscript
+    std::string  _flashVersionString;
+
+    /// String to pass as System.capabilities.os
+    /// in Actionscript. If empty, leaves detection
+    /// to System.cpp (default).
+    std::string  _flashSystemOS;       
+
+    /// String to pass as
+    /// System.capabilities.manufacturer
+    /// in Actionscript
+    std::string  _flashSystemManufacturer;
+
+    /// enable dumping actionscript classes
+    bool _actionDump;
+
+    /// enable dumping parser data
+    bool _parserDump;
 
     /// Enable ActionScript errors verbosity
     bool _verboseASCodingErrors;
@@ -185,10 +212,10 @@
     bool _verboseMalformedSWF;
     
     
-    // End user Features
+    /// End user Features
     bool _splashScreen;        // display a splash screen when
                                 // loading a movie
-    // Security Features
+    /// Security Features
     bool _localdomainOnly;     // only access network resources for
                                 // the local domain
     bool _localhostOnly;       // only access network resources 

Index: server/vm/ASHandlers.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/vm/ASHandlers.cpp,v
retrieving revision 1.173
retrieving revision 1.174
diff -u -b -r1.173 -r1.174
--- server/vm/ASHandlers.cpp    17 Dec 2007 22:24:59 -0000      1.173
+++ server/vm/ASHandlers.cpp    26 Dec 2007 18:03:47 -0000      1.174
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-/* $Id: ASHandlers.cpp,v 1.173 2007/12/17 22:24:59 strk Exp $ */
+/* $Id: ASHandlers.cpp,v 1.174 2007/12/26 18:03:47 strk Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -58,6 +58,7 @@
 #include <locale.h>
 #include <boost/scoped_array.hpp>
 #include <boost/random.hpp>
+#include <boost/algorithm/string/replace.hpp>
 
 using namespace std;
 
@@ -2234,31 +2235,10 @@
                return;
        }
 
-#ifndef __OS2__x
-       string command = "firefox -remote \"openurl(";
-#else // def __OS2__x
-       static char browserExe[ 255 ] = "";
+       gnash::RcInitFile& rcfile = gnash::RcInitFile::getDefaultInstance();
+       string command  = rcfile.getURLOpenerFormat();
+       boost::replace_all(command, "%u", url.str());
 
-       if ( browserExe[0] == 0 )
-       {
-               PrfQueryProfileString( HINI_USER, (PSZ) "WPURLDEFAULTSETTINGS",
-                       (PSZ) "DefaultBrowserExe", NULL,
-                       (PVOID) browserExe, (LONG)sizeof(browserExe) );
-       }
-
-       string command = browserExe;
-       command += " -remote \"openurl(";
-#endif // def __OS2__x
-
-       command += url.str();
-
-#if 0 // target testing TODO: should we enable this by default?
-       if ( ! target_string.empty() )
-       {
-               command += ", " + target_string;
-       }
-#endif
-       command += ")\"";
        log_msg (_("Launching URL... %s"), command.c_str());
        system(command.c_str());
 

Index: testsuite/libbase/TCXXRc.cpp
===================================================================
RCS file: /sources/gnash/gnash/testsuite/libbase/TCXXRc.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- testsuite/libbase/TCXXRc.cpp        20 Oct 2007 09:16:05 -0000      1.22
+++ testsuite/libbase/TCXXRc.cpp        26 Dec 2007 18:03:48 -0000      1.23
@@ -269,5 +269,11 @@
             }
         }
     }
+
+    if (rc.getURLOpenerFormat() == "lynx %u") {
+        runtest.pass ("getURLOpenerFormat");
+    } else {
+        runtest.fail ("getURLOpenerFormat");
+    }
 }
 

Index: testsuite/libbase/gnashrc.in
===================================================================
RCS file: /sources/gnash/gnash/testsuite/libbase/gnashrc.in,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- testsuite/libbase/gnashrc.in        20 Oct 2007 09:16:06 -0000      1.11
+++ testsuite/libbase/gnashrc.in        26 Dec 2007 18:03:48 -0000      1.12
@@ -63,3 +63,6 @@
 
 # Allow access to the /tmp/p1 directory
 set localSandboxPath /tmp/p1
+
+# Use the following command format to open urls
+set urlOpenerFormat lynx %u




reply via email to

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