gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/asobj/System.cpp testsui...


From: Benjamin Wolsey
Subject: [Gnash-commit] gnash ChangeLog server/asobj/System.cpp testsui...
Date: Mon, 14 Apr 2008 08:36:19 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Benjamin Wolsey <bwy>   08/04/14 08:36:19

Modified files:
        .              : ChangeLog 
        server/asobj   : System.cpp 
        testsuite/actionscript.all: System.as 

Log message:
                * server/asobj/System.cpp: add useCodepage and exactSettings
                  getter-setters. The getters return the notionally correct
                  values; setters are unimplemented. Pass screenDPI and
                  screenColor requests on to frontend.
                * testsuite/actionscript.all/System.as: test new System 
properties.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6266&r2=1.6267
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/System.cpp?cvsroot=gnash&r1=1.26&r2=1.27
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/System.as?cvsroot=gnash&r1=1.23&r2=1.24

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6266
retrieving revision 1.6267
diff -u -b -r1.6266 -r1.6267
--- ChangeLog   13 Apr 2008 23:46:31 -0000      1.6266
+++ ChangeLog   14 Apr 2008 08:36:18 -0000      1.6267
@@ -1,3 +1,11 @@
+2008-04-14 Benjamin Wolsey <address@hidden>
+
+       * server/asobj/System.cpp: add useCodepage and exactSettings
+         getter-setters. The getters return the notionally correct
+         values; setters are unimplemented. Pass screenDPI and
+         screenColor requests on to frontend.
+       * testsuite/actionscript.all/System.as: test new System properties.
+
 2008-04-13  Rob Savoye  <address@hidden>
 
        * libamf/amf.cpp: Boolsa re two bytes for AMF, so use a uint16-t,

Index: server/asobj/System.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/System.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -b -r1.26 -r1.27
--- server/asobj/System.cpp     13 Apr 2008 18:27:42 -0000      1.26
+++ server/asobj/System.cpp     14 Apr 2008 08:36:18 -0000      1.27
@@ -17,10 +17,6 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-#ifdef HAVE_CONFIG_H
-#include "gnashconfig.h"
-#endif
-
 #include <sstream>
 
 #include "movie_root.h" // interface callback
@@ -36,14 +32,15 @@
 
 namespace gnash {
 
-const std::string& systemLanguage();
+static const std::string& systemLanguage();
 
 static as_value system_security_allowdomain(const fn_call& fn);
 static as_value system_security_allowinsecuredomain(const fn_call& fn);
 static as_value system_security_loadpolicyfile(const fn_call& fn);
 static as_value system_setclipboard(const fn_call& fn);
 static as_value system_showsettings(const fn_call& fn);
-static as_value system_showsettings(const fn_call& fn);
+static as_value system_exactsettings(const fn_call& fn);
+static as_value system_usecodepage(const fn_call& fn);
 
 static as_object*
 getSystemSecurityInterface()
@@ -104,6 +101,10 @@
     // "StandAlone", "External", "PlugIn", "ActiveX" (get from GUI)
     std::string playerType;
 
+    std::string screenColor;
+    
+    int screenDPI = 0;
+
     int screenResolutionX = 0;
     int screenResolutionY = 0;
 
@@ -117,8 +118,13 @@
         
ss.str((*movie_root::interfaceHandle)("System.capabilities.screenResolutionY", 
""));
         ss >> screenResolutionY;
         
+        ss.clear();
+        ss.str((*movie_root::interfaceHandle)("System.capabilities.screenDPI", 
""));
+        ss >> screenDPI;
+        
         pixelAspectRatio = 
(*movie_root::interfaceHandle)("System.capabilities.pixelAspectRatio", "");
         playerType = 
(*movie_root::interfaceHandle)("System.capabilities.playerType", "");
+        screenColor = 
(*movie_root::interfaceHandle)("System.capabilities.screenColor", "");
     }
 
     //
@@ -189,8 +195,8 @@
                        << "&V="    << URL::encode(version)
                        << "&M="    << URL::encode(manufacturer)
                        << "&R="    << screenResolutionX << "x" << 
screenResolutionY
-                       << "&DP="       // screenDPI (int?
-                       << "&COL="      // screenColor (?)                      
                        
+                       << "&DP="       << screenDPI
+                       << "&COL="      << screenColor                          
        
                        << "&AR="   << pixelAspectRatio
                        << "OS="    << URL::encode(os)
                        << "&L="    << language                 
@@ -217,6 +223,8 @@
                proto->init_member("hasAudio", hasAudio, flags);
                proto->init_member("screenResolutionX", screenResolutionX, 
flags);
                proto->init_member("screenResolutionY", screenResolutionY, 
flags);
+               proto->init_member("screenColor", screenColor, flags);
+               proto->init_member("screenDPI", screenDPI, flags);
                proto->init_member("pixelAspectRatio", pixelAspectRatio, flags);
                proto->init_member("serverString", serverString.str(), flags);
                proto->init_member("avHardwareDisable", avHardwareDisable, 
flags);
@@ -247,6 +255,14 @@
        proto.init_member("capabilities", getSystemCapabilitiesInterface());
        proto.init_member("setClipboard", new 
builtin_function(system_setclipboard));
        proto.init_member("showSettings", new 
builtin_function(system_showsettings));
+
+       as_c_function_ptr gettersetter;
+
+       gettersetter = &system_exactsettings;
+       proto.init_property("exactSettings", *gettersetter, *gettersetter);
+
+       gettersetter = &system_usecodepage;
+       proto.init_property("useCodepage", *gettersetter, *gettersetter);
 }
 
 static as_object*
@@ -267,31 +283,88 @@
 {
 }
 
-as_value system_security_allowdomain(const fn_call& /*fn*/) {
+as_value
+system_security_allowdomain(const fn_call& /*fn*/)
+{
     log_unimpl (__PRETTY_FUNCTION__);
     return as_value();
 }
 
-as_value system_security_allowinsecuredomain(const fn_call& /*fn*/) {
+as_value
+system_security_allowinsecuredomain(const fn_call& /*fn*/)
+{
     log_unimpl (__PRETTY_FUNCTION__);
     return as_value();
 }
 
-as_value system_security_loadpolicyfile(const fn_call& /*fn*/) {
+as_value
+system_security_loadpolicyfile(const fn_call& /*fn*/)
+{
     log_unimpl (__PRETTY_FUNCTION__);
     return as_value();
 }
 
-as_value system_setclipboard(const fn_call& /*fn*/) {
+as_value
+system_setclipboard(const fn_call& /*fn*/)
+{
     log_unimpl (__PRETTY_FUNCTION__);
     return as_value();
 }
 
-as_value system_showsettings(const fn_call& /*fn*/) {
+as_value
+system_showsettings(const fn_call& /*fn*/)
+{
     log_unimpl (__PRETTY_FUNCTION__);
     return as_value();
 }
 
+// FIXME: should return true if shared object files
+// are stored under an exact domain name (www.gnashdev.org or
+// gnashdev.org); false if both are stored under gnashdev.org.
+// Can be set.
+as_value
+system_exactsettings(const fn_call& fn)
+{
+       static boost::intrusive_ptr<as_object> obj = 
ensureType<as_object>(fn.this_ptr);
+
+    // Getter
+    if (fn.nargs == 0)
+    {
+        // Is always true until we implement it.
+        return as_value(true);   
+    }
+    
+    // Setter
+    else 
+    {
+        log_unimpl ("Setting System.exactSettings unimplemented");
+        return as_value();
+    }
+}
+
+// FIXME: if true, SWF6+ should treat characters as Latin
+// charset variants. If false (default), as UTF-8.
+// Can be set.
+as_value
+system_usecodepage(const fn_call& fn)
+{
+       static boost::intrusive_ptr<as_object> obj = 
ensureType<as_object>(fn.this_ptr);
+
+    // Getter
+    if (fn.nargs == 0)
+    {
+        // Is always false until we implement it.
+        return as_value(false);   
+    }
+    
+    // Setter
+    else 
+    {
+        log_unimpl ("Setting System.useCodepage unimplemented");
+        return as_value();
+    }
+}
+
 void
 system_class_init(as_object& global)
 {
@@ -302,7 +375,8 @@
        global.init_member("System", obj.get());
 }
 
-const std::string& systemLanguage()
+const std::string&
+systemLanguage()
 {
        // Two-letter language code ('en', 'de') corresponding to ISO 639-1
        // Chinese can be either zh-CN or zh-TW. English used to have a 

Index: testsuite/actionscript.all/System.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/System.as,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- testsuite/actionscript.all/System.as        13 Apr 2008 18:27:42 -0000      
1.23
+++ testsuite/actionscript.all/System.as        14 Apr 2008 08:36:19 -0000      
1.24
@@ -21,7 +21,7 @@
 // execute it like this gnash -1 -r 0 -v out.swf
 
 
-rcsid="$Id: System.as,v 1.23 2008/04/13 18:27:42 bwy Exp $";
+rcsid="$Id: System.as,v 1.24 2008/04/14 08:36:19 bwy Exp $";
 #include "check.as"
 
 check_equals(typeof(System), 'object');
@@ -66,8 +66,8 @@
 check_equals(typeof(System.capabilities.serverString), 'string');
 check_equals(typeof(System.capabilities.screenResolutionX), 'number');
 check_equals(typeof(System.capabilities.screenResolutionY), 'number');
-xcheck_equals(typeof(System.capabilities.screenDPI), 'number');
-xcheck_equals(typeof(System.capabilities.screenColor), 'string');
+check_equals(typeof(System.capabilities.screenDPI), 'number');
+check_equals(typeof(System.capabilities.screenColor), 'string');
 check_equals(typeof(System.capabilities.pixelAspectRatio), 'string');
 check_equals(typeof(System.capabilities.localFileReadDisable), 'boolean');
 check_equals(typeof(System.capabilities.language), 'string');
@@ -92,6 +92,15 @@
 // Added in Player version 9.
 check_equals(typeof(System.capabilities.hasTLS), 'boolean');
 
+
+// System.exactSettings
+check_equals(typeof(System.exactSettings), 'boolean');
+value = System.exactSettings;
+System.exactSettings = true;
+check_equals(System.exactSettings, value);
+System.exactSettings = false;
+check_equals(System.exactSettings, value);
+
 #if OUTPUT_VERSION >= 6
 check(this.hasOwnProperty("$version"));
 check(! MovieClip.prototype.hasOwnProperty("$version") );
@@ -102,11 +111,11 @@
 //
 
 // Directs the player to use Latin1 instead of unicode.
-xcheck_equals(typeof(System.useCodepage), 'boolean');
+check_equals(typeof(System.useCodepage), 'boolean');
 System.useCodepage = false;
 check_equals(System.useCodepage, false);
 System.useCodepage = true;
-check_equals(System.useCodepage, true);
+xcheck_equals(System.useCodepage, true);
 
 // Pops up settings dialogue box with variable settings.
 // System.showSettings(0): camera / microphone access;
@@ -128,11 +137,11 @@
 xcheck_equals(typeof(p.launch), 'function');
 
 #if OUTPUT_VERSION > 6
- check_totals(53);
+ check_totals(56);
 #else
 # if OUTPUT_VERSION == 6
-   check_totals(52);
+   check_totals(55);
 # else
-   check_totals(50);
+   check_totals(53);
 # endif
 #endif




reply via email to

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