"Fossies" - the Fresh Open Source Software Archive

Member "gnash-0.8.10/libcore/asobj/Accessibility_as.cpp" (19 Jan 2012, 3084 Bytes) of package /linux/www/old/gnash-0.8.10.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 // accessibility_as.cpp:  ActionScript "Accessibility" class, for Gnash.
    2 //
    3 //   Copyright (C) 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
    4 //
    5 // This program is free software; you can redistribute it and/or modify
    6 // it under the terms of the GNU General Public License as published by
    7 // the Free Software Foundation; either version 3 of the License, or
    8 // (at your option) any later version.
    9 //
   10 // This program is distributed in the hope that it will be useful,
   11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
   12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   13 // GNU General Public License for more details.
   14 //
   15 // You should have received a copy of the GNU General Public License
   16 // along with this program; if not, write to the Free Software
   17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   18 //
   19 
   20 #include "namedStrings.h"
   21 #include "Accessibility_as.h"
   22 #include "as_object.h" // for inheritance
   23 #include "log.h"
   24 #include "fn_call.h"
   25 #include "Global_as.h"
   26 #include "NativeFunction.h"
   27 
   28 namespace gnash {
   29 
   30 // Forward declarations
   31 namespace {
   32     void attachAccessibilityStaticInterface(as_object& o);
   33 
   34     as_value accessibility_isActive(const fn_call& fn);
   35     as_value accessibility_updateProperties(const fn_call& fn);
   36     as_value accessibility_sendEvent(const fn_call& fn);
   37 }
   38 
   39 // extern (used by Global.cpp)
   40 void
   41 accessibility_class_init(as_object& where, const ObjectURI& uri)
   42 {
   43 
   44     Global_as& gl = getGlobal(where);
   45 
   46     const int flags = as_object::DefaultFlags | PropFlags::readOnly;
   47 
   48     // This object has unusual properties.
   49     as_object* obj = createObject(gl);
   50     obj->set_member_flags(NSV::PROP_uuPROTOuu, flags);
   51     obj->init_member(NSV::PROP_CONSTRUCTOR, getMember(gl, NSV::CLASS_OBJECT),
   52             flags);
   53 
   54     attachAccessibilityStaticInterface(*obj);
   55 
   56     // Register _global.Accessibility
   57     where.init_member(uri, obj, as_object::DefaultFlags);
   58 }
   59 
   60 void
   61 registerAccessibilityNative(as_object& global)
   62 {
   63     VM& vm = getVM(global);
   64     vm.registerNative(accessibility_isActive, 1999, 0);
   65     vm.registerNative(accessibility_sendEvent, 1999, 1);
   66     vm.registerNative(accessibility_updateProperties, 1999, 2);
   67 }
   68 
   69 namespace {
   70 
   71 void
   72 attachAccessibilityStaticInterface(as_object& o)
   73 {
   74     const int flags = PropFlags::dontDelete |
   75                       PropFlags::readOnly;
   76 
   77     VM& vm = getVM(o);
   78 
   79     o.init_member("isActive", vm.getNative(1999, 0), flags);
   80     o.init_member("sendEvent", vm.getNative(1999, 1), flags);
   81     o.init_member("updateProperties", vm.getNative(1999, 2), flags);
   82 }
   83 
   84 as_value
   85 accessibility_isActive(const fn_call& /*fn*/)
   86 {
   87     LOG_ONCE(log_unimpl(__FUNCTION__) );
   88     return as_value();
   89 }
   90 
   91 as_value
   92 accessibility_updateProperties(const fn_call& /*fn*/)
   93 {
   94     LOG_ONCE(log_unimpl(__FUNCTION__) );
   95     return as_value();
   96 }
   97 
   98 as_value
   99 accessibility_sendEvent(const fn_call& /*fn*/)
  100 {
  101     LOG_ONCE(log_unimpl(__FUNCTION__) );
  102     return as_value();
  103 }
  104 
  105 } // anonymous namespace 
  106 } // gnash namespace
  107 
  108 // local Variables:
  109 // mode: C++
  110 // indent-tabs-mode: nil
  111 // End:
  112