#include <Globals.h>
Public Member Functions | |
AVM1Global (VM &vm) | |
~AVM1Global () | |
void | registerClasses () |
virtual as_object * | createString (const std::string &s) |
Create a String object. | |
virtual as_object * | createNumber (double d) |
Create a Number object. | |
virtual as_object * | createBoolean (bool b) |
Create a Boolean object. | |
virtual as_object * | createObject () |
Create an Object. | |
virtual as_object * | createArray () |
Construct an Array. | |
virtual const ClassHierarchy & | classHierarchy () const |
virtual ClassHierarchy & | classHierarchy () |
virtual VM & | getVM () const |
virtual builtin_function * | createFunction (Global_as::ASFunction function) |
Create an ActionScript function. | |
virtual as_object * | createClass (Global_as::ASFunction ctor, as_object *prototype) |
Create an ActionScript class. | |
AVM1Global (VM &vm) | |
~AVM1Global () | |
void | registerClasses () |
virtual as_object * | createString (const std::string &s) |
Create a String object. | |
virtual as_object * | createNumber (double d) |
Create a Number object. | |
virtual as_object * | createBoolean (bool b) |
Create a Boolean object. | |
virtual as_object * | createObject () |
Create an Object. | |
virtual as_object * | createArray () |
Create an Array object. | |
virtual const ClassHierarchy & | classHierarchy () const |
virtual ClassHierarchy & | classHierarchy () |
virtual VM & | getVM () const |
virtual builtin_function * | createFunction (Global_as::ASFunction function) |
Create an ActionScript function. | |
virtual as_object * | createClass (Global_as::ASFunction ctor, as_object *prototype) |
Create an ActionScript class. | |
Protected Member Functions | |
virtual void | markReachableResources () const |
Mark all reachable resources, override from GcResource. | |
virtual void | markReachableResources () const |
Mark all reachable resources, override from GcResource. |
gnash::AVM1Global::AVM1Global | ( | VM & | vm | ) |
gnash::AVM1Global::~AVM1Global | ( | ) | [inline] |
gnash::AVM1Global::AVM1Global | ( | VM & | vm | ) |
gnash::AVM1Global::~AVM1Global | ( | ) | [inline] |
virtual const ClassHierarchy& gnash::AVM1Global::classHierarchy | ( | ) | const [inline, virtual] |
Implements gnash::Global_as.
virtual ClassHierarchy& gnash::AVM1Global::classHierarchy | ( | ) | [inline, virtual] |
Implements gnash::Global_as.
virtual const ClassHierarchy& gnash::AVM1Global::classHierarchy | ( | ) | const [inline, virtual] |
Implements gnash::Global_as.
virtual ClassHierarchy& gnash::AVM1Global::classHierarchy | ( | ) | [inline, virtual] |
Implements gnash::Global_as.
virtual as_object* gnash::AVM1Global::createArray | ( | ) | [virtual] |
Create an Array object.
This creates an Array object without calling the Array constructor.
Implements gnash::Global_as.
as_object * gnash::AVM1Global::createArray | ( | ) | [virtual] |
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.
Implements gnash::Global_as.
References gnash::as_object::array(), gnash::as_object::as_object(), gnash::NSV::CLASS_ARRAY, gnash::as_object::get_member(), gnash::as_object::getMember(), gnash::as_object::init_member(), gnash::NSV::PROP_CONSTRUCTOR, gnash::NSV::PROP_LENGTH, gnash::NSV::PROP_PROTOTYPE, gnash::as_object::set_prototype(), gnash::as_object::setArray(), and gnash::as_value::to_object().
virtual as_object* gnash::AVM1Global::createBoolean | ( | bool | b | ) | [virtual] |
Create a Boolean object.
This calls the Boolean constructor. If that has been changed, this function may not produce a Boolean object. This is generally expected behaviour.
Implements gnash::Global_as.
as_object * gnash::AVM1Global::createBoolean | ( | bool | b | ) | [virtual] |
Create a Boolean object.
This calls the Boolean constructor. If that has been changed, this function may not produce a Boolean object. This is generally expected behaviour.
Implements gnash::Global_as.
References gnash::NSV::CLASS_BOOLEAN.
as_object * gnash::AVM1Global::createClass | ( | Global_as::ASFunction | ctor, | |
as_object * | prototype | |||
) | [virtual] |
Create an ActionScript class.
An AS2 class is generally a function (the constructor) with a prototype.
Implements gnash::Global_as.
References gnash::as_function::getFunctionConstructor(), gnash::as_object::init_member(), gnash::NSV::PROP_CONSTRUCTOR, and gnash::NSV::PROP_PROTOTYPE.
virtual as_object* gnash::AVM1Global::createClass | ( | Global_as::ASFunction | ctor, | |
as_object * | prototype | |||
) | [virtual] |
Create an ActionScript class.
An AS2 class is generally a function (the constructor) with a prototype.
Implements gnash::Global_as.
virtual builtin_function* gnash::AVM1Global::createFunction | ( | Global_as::ASFunction | function | ) | [virtual] |
Create an ActionScript function.
Implements gnash::Global_as.
builtin_function * gnash::AVM1Global::createFunction | ( | Global_as::ASFunction | function | ) | [virtual] |
Create an ActionScript function.
Implements gnash::Global_as.
References createObject(), s2x::f, gnash::as_function::getFunctionConstructor(), gnash::as_object::init_member(), gnash::NSV::PROP_CONSTRUCTOR, and gnash::NSV::PROP_PROTOTYPE.
Referenced by registerClasses().
as_object * gnash::AVM1Global::createNumber | ( | double | d | ) | [virtual] |
Create a Number object.
This calls the Number constructor. If that has been changed, this function may not produce a Number object. This is generally expected behaviour.
Implements gnash::Global_as.
References gnash::NSV::CLASS_NUMBER.
virtual as_object* gnash::AVM1Global::createNumber | ( | double | d | ) | [virtual] |
Create a Number object.
This calls the Number constructor. If that has been changed, this function may not produce a Number object. This is generally expected behaviour.
Implements gnash::Global_as.
virtual as_object* gnash::AVM1Global::createObject | ( | ) | [virtual] |
Create an Object.
This function returns an Object with Object.prototype as its __proto__ member. It should probably call the Object constructor, but Gnash creates some of its classes on demand. If the Object class has changed before this happens, Gnash's behaviour would differ from the reference player's. TODO: think whether it's better to return the original Object class, a possibly altered one, or allow both.
Implements gnash::Global_as.
as_object * gnash::AVM1Global::createObject | ( | ) | [virtual] |
Create an Object.
This function returns an Object with Object.prototype as its __proto__ member. It should probably call the Object constructor, but Gnash creates some of its classes on demand. If the Object class has changed before this happens, Gnash's behaviour would differ from the reference player's. TODO: think whether it's better to return the original Object class, a possibly altered one, or allow both.
Implements gnash::Global_as.
References gnash::as_object::as_object(), and gnash::as_object::set_prototype().
Referenced by createFunction().
virtual as_object* gnash::AVM1Global::createString | ( | const std::string & | s | ) | [virtual] |
Create a String object.
This calls the String constructor. If that has been changed, this function may not produce a String object. This is generally expected behaviour.
Implements gnash::Global_as.
as_object * gnash::AVM1Global::createString | ( | const std::string & | s | ) | [virtual] |
Create a String object.
This calls the String constructor. If that has been changed, this function may not produce a String object. This is generally expected behaviour.
Implements gnash::Global_as.
References gnash::NSV::CLASS_STRING.
virtual VM& gnash::AVM1Global::getVM | ( | ) | const [inline, virtual] |
Implements gnash::Global_as.
References gnash::as_object::vm().
virtual VM& gnash::AVM1Global::getVM | ( | ) | const [inline, virtual] |
virtual void gnash::AVM1Global::markReachableResources | ( | ) | const [protected, virtual] |
Mark all reachable resources, override from GcResource.
The default implementation marks all properties as being reachable, calling markAsObjectReachable().
If a derived class provides access to more GC-managed resources, it should override this method and call markAsObjectReachable() as the last step.
Reimplemented from gnash::as_object.
void gnash::AVM1Global::markReachableResources | ( | ) | const [protected, virtual] |
Mark all reachable resources, override from GcResource.
The default implementation marks all properties as being reachable, calling markAsObjectReachable().
If a derived class provides access to more GC-managed resources, it should override this method and call markAsObjectReachable() as the last step.
Reimplemented from gnash::as_object.
References gnash::as_object::markAsObjectReachable(), gnash::ClassHierarchy::markReachableResources(), and gnash::GcResource::setReachable().
void gnash::AVM1Global::registerClasses | ( | ) |
void gnash::AVM1Global::registerClasses | ( | ) |
References gnash::array_class_init(), gnash::NSV::CLASS_ARRAY, gnash::NSV::CLASS_FUNCTION, gnash::NSV::CLASS_OBJECT, gnash::NSV::CLASS_STRING, createFunction(), gnash::ClassHierarchy::declareAll(), gnash::PropFlags::dontEnum, gnash::flash_package_init(), gnash::function_class_init(), gnash::as_object::getMember(), gnash::VM::getNative(), gnash::getStringTable(), gnash::VM::getSWFVersion(), getVM(), gnash::as_object::init_member(), gnash::initObjectClass(), gnash::as_value::set_null(), gnash::string_class_init(), and gnash::as_object::vm().
Referenced by gnash::VM::init().