Gnash
0.8.10
|
The Global object ultimately contains all objects in an ActionScript run. More...
#include <Global_as.h>
Public Types | |
typedef as_value(* | ASFunction )(const fn_call &fn) |
typedef void(* | Properties )(as_object &) |
Public Member Functions | |
Global_as (VM &vm) | |
virtual | ~Global_as () |
void | registerClasses () |
as_object * | createArray () |
Construct an Array. | |
VM & | getVM () const |
as_function * | createFunction (Global_as::ASFunction function) |
Create an ActionScript function. | |
as_object * | createClass (Global_as::ASFunction ctor, as_object *prototype) |
Create an ActionScript class. | |
void | makeObject (as_object &o) const |
Protected Member Functions | |
virtual void | markReachableResources () const |
Mark all reachable resources, override from GcResource. |
The Global object ultimately contains all objects in an ActionScript run.
An ActionScript run is a single version (AS1/2 or AS3) and includes all resources parsed from the SWF, created dynamically, loaded, or imported that are available to ActionScript code. Each VM (VM for AS1/2, Machine for AS3) has different resources in its Global object. The two objects should be entirely separate.
typedef as_value(* gnash::Global_as::ASFunction)(const fn_call &fn) |
typedef void(* gnash::Global_as::Properties)(as_object &) |
gnash::Global_as::Global_as | ( | VM & | vm | ) | [explicit] |
gnash::Global_as::~Global_as | ( | ) | [virtual] |
as_object * gnash::Global_as::createArray | ( | ) |
Construct an Array.
This uses the _global Array class to initialize the "constructor" and "__proto__" properties. If Array.prototype is undefined, those properties are not added.
References gnash::as_object::array(), gnash::as_object::as_object(), gnash::getMember(), gnash::NSV::CLASS_ARRAY, gnash::toObject(), gnash::getVM(), gnash::as_object::get_member(), gnash::NSV::PROP_PROTOTYPE, gnash::as_object::init_member(), gnash::NSV::PROP_CONSTRUCTOR, gnash::as_object::set_prototype(), gnash::NSV::PROP_LENGTH, and gnash::as_object::setArray().
Referenced by gnash::AsBroadcaster::initialize(), gnash::fileio_scandir(), gnash::Function::call(), gnash::Function2::call(), gnash::abc::Machine::execute(), gnash::mysql_fetch(), and gnash::XMLNode_as::childNodes().
as_object * gnash::Global_as::createClass | ( | Global_as::ASFunction | ctor, |
as_object * | prototype | ||
) |
Create an ActionScript class.
An AS2 class is generally a function (the constructor) with a prototype.
References gnash::as_object::init_member(), gnash::NSV::PROP_CONSTRUCTOR, gnash::NSV::PROP_PROTOTYPE, gnash::as_object::getOwnProperty(), gnash::NSV::CLASS_FUNCTION, gnash::as_object::DefaultFlags, gnash::NSV::PROP_uuPROTOuu, and gnash::getMember().
Referenced by gnash::registerBitmapClass(), gnash::button_class_init(), gnash::date_class_init(), gnash::dbus_class_init(), gnash::dejagnu_class_init(), gnash::fileio_class_init(), gnash::filereference_class_init(), gnash::gtkext_class_init(), gnash::lirc_class_init(), gnash::movieclip_class_init(), gnash::moviecliploader_class_init(), gnash::mysql_class_init(), gnash::sharedobject_class_init(), gnash::sound_class_init(), gnash::textfield_class_init(), gnash::textformat_class_init(), gnash::video_class_init(), gnash::xml_class_init(), and gnash::xmlnode_class_init().
as_function * gnash::Global_as::createFunction | ( | Global_as::ASFunction | function | ) |
Create an ActionScript function.
References gnash::createObject(), gnash::key::f, gnash::as_object::init_member(), gnash::NSV::PROP_CONSTRUCTOR, gnash::NSV::PROP_PROTOTYPE, gnash::as_object::getOwnProperty(), gnash::NSV::CLASS_FUNCTION, gnash::as_object::DefaultFlags, gnash::NSV::PROP_uuPROTOuu, and gnash::getMember().
Referenced by gnash::attachAsBroadcasterStaticInterface(), registerClasses(), gnash::attachKeyInterface(), and gnash::attachLoadableInterface().
VM& gnash::Global_as::getVM | ( | ) | const [inline] |
References gnash::as_object::vm().
Referenced by registerClasses().
void gnash::Global_as::makeObject | ( | as_object & | o | ) | const |
References gnash::as_object::set_prototype().
Referenced by gnash::createObject().
void gnash::Global_as::markReachableResources | ( | ) | const [protected, virtual] |
Mark all reachable resources, override from GcResource.
The default implementation marks all properties
If a derived class provides access to more GC-managed resources, it should override this function and call this function directly as the last step.
Reimplemented from gnash::as_object.
References gnash::ClassHierarchy::markReachableResources(), and gnash::GcResource::setReachable().
void gnash::Global_as::registerClasses | ( | ) |
References gnash::function_class_init(), gnash::NSV::CLASS_FUNCTION, gnash::initObjectClass(), gnash::NSV::CLASS_OBJECT, gnash::string_class_init(), gnash::NSV::CLASS_STRING, gnash::array_class_init(), gnash::NSV::CLASS_ARRAY, gnash::as_value::set_null(), gnash::as_object::init_member(), gnash::PropFlags::dontEnum, gnash::as_object::vm(), getVM(), createFunction(), gnash::VM::getNative(), gnash::getMember(), gnash::getURI(), gnash::ClassHierarchy::declareAll(), and gnash::flash_package_init().
Referenced by gnash::VM::VM().