gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/trunk r9510: Stub Accessibility class. Ren


From: Benjamin Wolsey
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r9510: Stub Accessibility class. Rename some asobj files for consistency.
Date: Mon, 21 Jul 2008 12:29:58 +0200
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9510
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Mon 2008-07-21 12:29:58 +0200
message:
  Stub Accessibility class. Rename some asobj files for consistency.
added:
  server/asobj/Accessibility_as.cpp
  server/asobj/Accessibility_as.h
  testsuite/actionscript.all/Accessibility.as
renamed:
  server/asobj/GMath.h => server/asobj/Math_as.h
  server/asobj/Math.cpp => server/asobj/Math_as.cpp
  server/asobj/gstring.h => server/asobj/String_as.h
  server/asobj/string.cpp => server/asobj/String_as.cpp
modified:
  server/as_function.cpp
  server/as_value.cpp
  server/asobj/ClassHierarchy.cpp
  server/asobj/Global.cpp
  server/asobj/Makefile.am
  server/asobj/Mouse.cpp
  server/namedStrings.cpp
  server/namedStrings.h
  server/vm/ASHandlers.cpp
  testsuite/actionscript.all/Makefile.am
  server/asobj/Math_as.cpp
  server/asobj/String_as.cpp
    ------------------------------------------------------------
    revno: 9507.1.1
    committer: Benjamin Wolsey <address@hidden>
    branch nick: workingcopy
    timestamp: Mon 2008-07-21 11:53:23 +0200
    message:
      Stub Accessibility class.
    added:
      server/asobj/Accessibility_as.cpp
      server/asobj/Accessibility_as.h
    ------------------------------------------------------------
    revno: 9507.1.2
    committer: Benjamin Wolsey <address@hidden>
    branch nick: workingcopy
    timestamp: Mon 2008-07-21 11:55:24 +0200
    message:
      Make property flags easier to read.
    modified:
      server/as_function.cpp
    ------------------------------------------------------------
    revno: 9507.1.3
    committer: Benjamin Wolsey <address@hidden>
    branch nick: workingcopy
    timestamp: Mon 2008-07-21 11:56:09 +0200
    message:
      Rename gstring.h and string.cpp to String_as.{h,cpp}. Rename Math.cpp and 
GMath.cpp
      to Math_as.{h,cpp}.
      
      Modify includes and Makefile to reflect these changes.
      
      Add Accessibility class to ClassHierarchy and namedStrings.
    renamed:
      server/asobj/GMath.h => server/asobj/Math_as.h
      server/asobj/Math.cpp => server/asobj/Math_as.cpp
      server/asobj/gstring.h => server/asobj/String_as.h
      server/asobj/string.cpp => server/asobj/String_as.cpp
    modified:
      server/as_value.cpp
      server/asobj/ClassHierarchy.cpp
      server/asobj/Global.cpp
      server/asobj/Makefile.am
      server/asobj/Mouse.cpp
      server/namedStrings.cpp
      server/namedStrings.h
      server/vm/ASHandlers.cpp
      server/asobj/Math_as.cpp
      server/asobj/String_as.cpp
    ------------------------------------------------------------
    revno: 9507.1.4
    committer: Benjamin Wolsey <address@hidden>
    branch nick: workingcopy
    timestamp: Mon 2008-07-21 11:58:57 +0200
    message:
      Add basic tests for AS Accessibility class (unimplemented).
    added:
      testsuite/actionscript.all/Accessibility.as
    modified:
      testsuite/actionscript.all/Makefile.am
=== modified file 'server/as_function.cpp'
--- a/server/as_function.cpp    2008-06-19 09:51:41 +0000
+++ b/server/as_function.cpp    2008-07-21 09:55:24 +0000
@@ -104,7 +104,9 @@
        //as_object(getFunctionPrototype())
        as_object()
 {
-       int flags = 
as_prop_flags::dontDelete|as_prop_flags::dontEnum|as_prop_flags::onlySWF6Up;
+       int flags = as_prop_flags::dontDelete |
+                   as_prop_flags::dontEnum | 
+                   as_prop_flags::onlySWF6Up;
        init_member(NSV::PROP_uuPROTOuu, as_value(getFunctionPrototype()), 
flags);
 }
 
@@ -116,7 +118,9 @@
        //as_object(getFunctionPrototype())
        as_object()
 {
-       int flags = 
as_prop_flags::dontDelete|as_prop_flags::dontEnum|as_prop_flags::onlySWF6Up;
+       int flags = as_prop_flags::dontDelete |
+                   as_prop_flags::dontEnum |
+                   as_prop_flags::onlySWF6Up;
        init_member(NSV::PROP_uuPROTOuu, as_value(getFunctionPrototype()), 
flags);
 
        if ( iface )

=== modified file 'server/as_value.cpp'
--- a/server/as_value.cpp       2008-07-13 15:33:11 +0000
+++ b/server/as_value.cpp       2008-07-21 09:56:09 +0000
@@ -26,7 +26,7 @@
 #include "as_environment.h" // for MOVIECLIP values
 #include "VM.h" // for MOVIECLIP values
 #include "movie_root.h" // for MOVIECLIP values
-#include "gstring.h" // for automatic as_value::STRING => String as object
+#include "String_as.h" // for automatic as_value::STRING => String as object
 #include "Number.h" // for automatic as_value::NUMBER => Number as object
 #include "Boolean.h" // for automatic as_value::BOOLEAN => Boolean as object
 #include "action.h" // for call_method0

=== added file 'server/asobj/Accessibility_as.cpp'
--- a/server/asobj/Accessibility_as.cpp 1970-01-01 00:00:00 +0000
+++ b/server/asobj/Accessibility_as.cpp 2008-07-21 09:53:23 +0000
@@ -0,0 +1,95 @@
+// Accessibility_as.cpp:  ActionScript "Accessibility" class, for Gnash.
+//
+//   Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+#ifdef HAVE_CONFIG_H
+#include "gnashconfig.h"
+#endif
+
+#include "Accessibility_as.h"
+#include "as_object.h" // for inheritance
+#include "log.h"
+#include "fn_call.h"
+#include "smart_ptr.h" // for boost intrusive_ptr
+#include "builtin_function.h" // need builtin_function
+#include "GnashException.h" // for ActionException
+#include "Object.h" // for AS inheritance
+#include "VM.h" // for addStatics
+
+#include <sstream>
+
+namespace gnash {
+
+static as_value Accessibility_isActive(const fn_call& fn);
+static as_value Accessibility_updateProperties(const fn_call& fn);
+static as_value Accessibility_sendEvent(const fn_call& fn);
+
+as_value Accessibility_ctor(const fn_call& fn);
+
+static void
+attachAccessibilityInterface(as_object& o)
+{
+    const int flags = as_prop_flags::dontDelete
+                | as_prop_flags::readOnly;
+
+    o.init_member("isActive", new builtin_function(Accessibility_isActive), 
flags);
+    o.init_member("updateProperties", new 
builtin_function(Accessibility_updateProperties), flags);
+    o.init_member("sendEvent", new builtin_function(Accessibility_sendEvent), 
flags);
+}
+
+
+static as_value
+Accessibility_isActive(const fn_call& fn)
+{
+       boost::intrusive_ptr<as_object> ptr = 
ensureType<as_object>(fn.this_ptr);
+       UNUSED(ptr);
+       LOG_ONCE( log_unimpl (__FUNCTION__) );
+       return as_value();
+}
+
+static as_value
+Accessibility_updateProperties(const fn_call& fn)
+{
+       boost::intrusive_ptr<as_object> ptr = 
ensureType<as_object>(fn.this_ptr);
+       UNUSED(ptr);
+       LOG_ONCE( log_unimpl (__FUNCTION__) );
+       return as_value();
+}
+
+static as_value
+Accessibility_sendEvent(const fn_call& fn)
+{
+       boost::intrusive_ptr<as_object> ptr = 
ensureType<as_object>(fn.this_ptr);
+       UNUSED(ptr);
+       LOG_ONCE( log_unimpl (__FUNCTION__) );
+       return as_value();
+}
+
+// extern 
+void Accessibility_class_init(as_object& where)
+{
+       // This is going to be the Accessibility "class"/"function"
+       // in the 'where' package
+       boost::intrusive_ptr<as_object> obj = new 
as_object(getObjectInterface());
+       attachAccessibilityInterface(*obj);
+
+       // Register _global.Accessibility
+       where.init_member("Accessibility", obj.get());
+}
+
+} // end of gnash namespace

=== added file 'server/asobj/Accessibility_as.h'
--- a/server/asobj/Accessibility_as.h   1970-01-01 00:00:00 +0000
+++ b/server/asobj/Accessibility_as.h   2008-07-21 09:53:23 +0000
@@ -0,0 +1,42 @@
+// Accessibility_as.h:  ActionScript "Accessibility" class, for Gnash.
+//
+//   Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+#ifndef GNASH_ASOBJ_ACCESSIBILITY_H
+#define GNASH_ASOBJ_ACCESSIBILITY_H
+
+#ifdef HAVE_CONFIG_H
+#include "gnashconfig.h"
+#endif
+
+//#include <smart_ptr.h> // for intrusive_ptr and GC stuff
+
+namespace gnash {
+
+class as_object;
+
+/// Initialize the global Accessibility class
+void Accessibility_class_init(as_object& global);
+
+/// Return a Accessibility instance (in case the core lib needs it)
+//boost::intrusive_ptr<as_object> init_Accessibility_instance();
+
+} // end of gnash namespace
+
+// GNASH_ASOBJ_ACCESSIBILITY_H
+#endif

=== modified file 'server/asobj/ClassHierarchy.cpp'
--- a/server/asobj/ClassHierarchy.cpp   2008-06-18 16:19:22 +0000
+++ b/server/asobj/ClassHierarchy.cpp   2008-07-21 09:56:09 +0000
@@ -23,6 +23,7 @@
 #include "button_character_instance.h"
 #include "array.h"
 #include "AsBroadcaster.h"
+#include "Accessibility_as.h"
 #include "Boolean.h"
 #include "Camera.h"
 #include "Color.h"
@@ -31,14 +32,14 @@
 #include "Date.h"
 #include "Error_as.h"
 #include "Global.h"
-#include "gstring.h"
+#include "String_as.h"
 #include "Key.h"
 #include "LoadVars.h"
 #include "LocalConnection.h"
 #include "Microphone.h"
 #include "Number.h"
 #include "Object.h"
-#include "GMath.h"
+#include "Math_as.h"
 #include "Mouse.h"
 #include "MovieClipLoader.h"
 #include "movie_definition.h"
@@ -286,8 +287,8 @@
        { netstream_class_init, NSV::CLASS_NET_STREAM, NSV::CLASS_OBJECT, 
NSV::NS_FLASH_NET, 6 },
        { contextmenu_class_init, NSV::CLASS_CONTEXT_MENU, NSV::CLASS_OBJECT, 
NSV::NS_FLASH_UI, 7 },
        { moviecliploader_class_init, NSV::CLASS_MOVIE_CLIP_LOADER, 
NSV::CLASS_OBJECT, NS_GLOBAL, 7 },
-       { Error_class_init, NSV::CLASS_ERROR, NSV::CLASS_OBJECT, NS_GLOBAL, 5 }
-
+       { Error_class_init, NSV::CLASS_ERROR, NSV::CLASS_OBJECT, NS_GLOBAL, 5 },
+       { Accessibility_class_init, NSV::CLASS_ACCESSIBILITY, 
NSV::CLASS_OBJECT, NS_GLOBAL, 5 }
 // These classes are all implicitly constructed; that is, it is not necessary 
for
 // the class name to be used to construct the class, so they must always be 
available.
 //     { object_class_init, NSV::CLASS_OBJECT, 0, NS_GLOBAL, 5 }

=== modified file 'server/asobj/Global.cpp'
--- a/server/asobj/Global.cpp   2008-06-17 06:18:46 +0000
+++ b/server/asobj/Global.cpp   2008-07-21 09:56:09 +0000
@@ -36,14 +36,14 @@
 #include "Date.h"
 #include "Error_as.h"
 #include "Global.h"
-#include "gstring.h"
+#include "String_as.h"
 #include "Key.h"
 #include "LoadVars.h"
 #include "LocalConnection.h"
 #include "Microphone.h"
 #include "Number.h"
 #include "Object.h"
-#include "GMath.h"
+#include "Math_as.h"
 #include "Mouse.h"
 #include "MovieClipLoader.h"
 #include "movie_definition.h"

=== modified file 'server/asobj/Makefile.am'
--- a/server/asobj/Makefile.am  2008-06-17 06:18:46 +0000
+++ b/server/asobj/Makefile.am  2008-07-21 09:56:09 +0000
@@ -42,7 +42,8 @@
 
 
 libgnashasobjs_la_SOURCES = \
-        AsBroadcaster.cpp \
+       AsBroadcaster.cpp \
+       Accessibility_as.cpp \
        Boolean.cpp \
        Camera.cpp \
        ClassHierarchy.cpp \
@@ -55,7 +56,7 @@
        Key.cpp \
        LoadVars.cpp \
        LocalConnection.cpp\
-       Math.cpp \
+       Math_as.cpp \
        Microphone.cpp  \
        Mouse.cpp \
        NetConnection.cpp \
@@ -70,7 +71,7 @@
        TextFormat.cpp \
        TextSnapshot.cpp \
        MovieClipLoader.cpp\
-       string.cpp \
+       String_as.cpp \
        xml.cpp \
        xmlattrs.cpp \
        xmlnode.cpp \
@@ -105,7 +106,8 @@
        $(NULL)
 
 noinst_HEADERS = \
-        AsBroadcaster.h \
+       AsBroadcaster.h \
+       Accessibility_as.h \
        Boolean.h \
        Camera.h \
        ClassHierarchy.h \
@@ -114,7 +116,7 @@
        CustomActions.h \
        Date.h \
        Error_as.h      \
-       GMath.h \
+       Math_as.h       \
        Global.h\
        Key.h \
        LoadVars.h \
@@ -139,7 +141,7 @@
        System.h \
        TextFormat.h \
        TextSnapshot.h \
-       gstring.h \
+       String_as.h \
        xml.h \
        xmlsocket.h \
        xmlattrs.h \

=== renamed file 'server/asobj/Math.cpp' => 'server/asobj/Math_as.cpp'
--- a/server/asobj/Math.cpp     2008-05-15 06:02:51 +0000
+++ b/server/asobj/Math_as.cpp  2008-07-21 09:56:09 +0000
@@ -34,7 +34,7 @@
 
 #include "VM.h" // get random generator
 #include "fn_call.h"
-#include "GMath.h"
+#include "Math_as.h"
 #include "log.h"
 #include "builtin_function.h" 
 #include "Object.h" // for getObjectInterface

=== renamed file 'server/asobj/GMath.h' => 'server/asobj/Math_as.h'
=== modified file 'server/asobj/Mouse.cpp'
--- a/server/asobj/Mouse.cpp    2008-05-29 11:44:28 +0000
+++ b/server/asobj/Mouse.cpp    2008-07-21 09:56:09 +0000
@@ -109,7 +109,7 @@
 mouse_class_init(as_object& global)
 {
        // This is going to be the global Mouse "class"/"function"
-       static boost::intrusive_ptr<as_object> obj = new 
as_object(getObjectInterface());
+       boost::intrusive_ptr<as_object> obj = new 
as_object(getObjectInterface());
        attachMouseInterface(*obj);
 
        // Register _global.Mouse

=== renamed file 'server/asobj/string.cpp' => 'server/asobj/String_as.cpp'
--- a/server/asobj/string.cpp   2008-05-29 14:34:22 +0000
+++ b/server/asobj/String_as.cpp        2008-07-21 09:56:09 +0000
@@ -33,6 +33,7 @@
 #include "Object.h" // for getObjectInterface
 #include "namedStrings.h"
 #include "utf8.h"
+#include "String_as.h"
 
 #include <boost/algorithm/string/case_conv.hpp>
 #include <algorithm>

=== renamed file 'server/asobj/gstring.h' => 'server/asobj/String_as.h'
=== modified file 'server/namedStrings.cpp'
--- a/server/namedStrings.cpp   2008-06-07 11:11:33 +0000
+++ b/server/namedStrings.cpp   2008-07-21 09:56:09 +0000
@@ -160,6 +160,7 @@
        string_table::svt( "Object", NSV::CLASS_OBJECT ),
        string_table::svt( "String", NSV::CLASS_STRING ),
        string_table::svt( "Number", NSV::CLASS_NUMBER ),
+       string_table::svt( "Accessibility", NSV::CLASS_ACCESSIBILITY ), 
        string_table::svt( "Array", NSV::CLASS_ARRAY ),
        string_table::svt( "Key", NSV::CLASS_KEY ),
        string_table::svt( "AsBroadcaster", NSV::CLASS_AS_BROADCASTER ),

=== modified file 'server/namedStrings.h'
--- a/server/namedStrings.h     2008-06-07 11:11:33 +0000
+++ b/server/namedStrings.h     2008-07-21 09:56:09 +0000
@@ -178,6 +178,7 @@
                CLASS_OBJECT,
                CLASS_NUMBER,
                CLASS_STRING,
+               CLASS_ACCESSIBILITY,
                CLASS_ARRAY,
                CLASS_KEY,
                CLASS_AS_BROADCASTER,

=== modified file 'server/vm/ASHandlers.cpp'
--- a/server/vm/ASHandlers.cpp  2008-07-19 08:17:17 +0000
+++ b/server/vm/ASHandlers.cpp  2008-07-21 09:56:09 +0000
@@ -40,7 +40,7 @@
 #include "action_buffer.h"
 #include "as_object.h"
 #include "Object.h"
-#include "gstring.h" // for automatic as_value::STRING => String as object
+#include "String_as.h" // for automatic as_value::STRING => String as object
 #include "Number.h" // for automatic as_value::NUMBER => Number as object
 #include "types.h" // for PIXELS_TO_TWIPS
 #include "drag_state.h"

=== added file 'testsuite/actionscript.all/Accessibility.as'
--- a/testsuite/actionscript.all/Accessibility.as       1970-01-01 00:00:00 
+0000
+++ b/testsuite/actionscript.all/Accessibility.as       2008-07-21 09:58:57 
+0000
@@ -0,0 +1,65 @@
+// 
+//   Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+// Test case for Accessibility ActionScript class
+// compile this test case with Ming makeswf, and then
+// execute it like this gnash -1 -r 0 -v out.swf
+
+
+rcsid="$Id: Accessibility.as,v 1.19 2008/04/16 11:16:34 bwy Exp $";
+#include "check.as"
+
+check_equals ( typeof(Accessibility), 'object' );
+
+// Accessibility object can't be instantiated !
+var accObj = new Accessibility;
+check_equals(accObj, undefined);
+
+check_equals (typeof(Accessibility.__proto__), 'object');
+check_equals (Accessibility.__proto__, Object.prototype);
+
+#if OUTPUT_VERSION > 5
+
+check_equals ( typeof(Accessibility.isActive), 'function' );
+check_equals ( typeof(Accessibility.updateProperties), 'function' );
+check_equals ( typeof(Accessibility.sendEvent), 'function' );
+
+check(Accessibility.hasOwnProperty("isActive"));
+check(Accessibility.hasOwnProperty("updateProperties"));
+check(Accessibility.hasOwnProperty("sendEvent"));
+
+xcheck_equals ( typeof(Accessibility.isActive()), 'boolean' );
+
+#else
+
+// SWF 5:
+xcheck_equals ( typeof(Accessibility.isActive), 'undefined' );
+xcheck_equals ( typeof(Accessibility.updateProperties), 'undefined' );
+xcheck_equals ( typeof(Accessibility.sendEvent), 'undefined' );
+
+#endif // OUTPUT_VERSION > 5
+
+// Methods return void (just undefined in SWF 5).
+check_equals ( typeof(Accessibility.updateProperties()), 'undefined' );
+check_equals ( typeof(Accessibility.sendEvent()), 'undefined' );
+
+#if OUTPUT_VERSION > 5
+check_totals(13);
+#else
+check_totals(9);
+#endif

=== modified file 'testsuite/actionscript.all/Makefile.am'
--- a/testsuite/actionscript.all/Makefile.am    2008-06-19 16:40:14 +0000
+++ b/testsuite/actionscript.all/Makefile.am    2008-07-21 09:58:57 +0000
@@ -72,6 +72,7 @@
 ASTESTS =                      \
        AsBroadcaster.as        \
        ASnative.as             \
+       Accessibility.as \
        array.as                \
        BitmapData.as \
        delete.as               \


reply via email to

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