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 | |
virtual const ClassHierarchy & | classHierarchy () const =0 |
virtual ClassHierarchy & | classHierarchy ()=0 |
Global_as (VM &vm) | |
virtual builtin_function * | createFunction (ASFunction function)=0 |
Create an ActionScript function. | |
virtual as_object * | createClass (ASFunction ctor, as_object *prototype)=0 |
Create an ActionScript class. | |
virtual as_object * | createString (const std::string &s)=0 |
Create a String object. | |
virtual as_object * | createNumber (double d)=0 |
Create a Number object. | |
virtual as_object * | createBoolean (bool b)=0 |
Create a Boolean object. | |
virtual as_object * | createArray ()=0 |
Create an Array object. | |
virtual as_object * | createObject ()=0 |
Create an Object. | |
virtual Global_as & | global () |
virtual VM & | getVM () const =0 |
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 | ) | [inline, explicit] |
virtual const ClassHierarchy& gnash::Global_as::classHierarchy | ( | ) | const [pure virtual] |
Implemented in gnash::AVM1Global.
virtual ClassHierarchy& gnash::Global_as::classHierarchy | ( | ) | [pure virtual] |
Implemented in gnash::AVM1Global.
virtual as_object* gnash::Global_as::createArray | ( | ) | [pure virtual] |
Create an Array object.
This creates an Array object without calling the Array constructor.
Implemented in gnash::AVM1Global.
Referenced by gnash::Function2::call(), gnash::XMLNode_as::childNodes(), gnash::fileio_scandir(), and gnash::mysql_fetch().
virtual as_object* gnash::Global_as::createBoolean | ( | bool | b | ) | [pure 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.
Implemented in gnash::AVM1Global.
Referenced by gnash::as_value::to_object().
virtual as_object* gnash::Global_as::createClass | ( | ASFunction | ctor, | |
as_object * | prototype | |||
) | [pure virtual] |
Create an ActionScript class.
The type of a class is different in AS2 and AS3. In AS2 it is generally a function (the constructor) with a prototype. In AS3 it is generally an object (the prototype) with a constructor.
Implemented in gnash::AVM1Global.
Referenced by gnash::registerBuiltinClass().
virtual builtin_function* gnash::Global_as::createFunction | ( | ASFunction | function | ) | [pure virtual] |
Create an ActionScript function.
Implemented in gnash::AVM1Global.
Referenced by gnash::attachKeyInterface().
virtual as_object* gnash::Global_as::createNumber | ( | double | d | ) | [pure 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.
Implemented in gnash::AVM1Global.
Referenced by gnash::as_value::to_object().
virtual as_object* gnash::Global_as::createObject | ( | ) | [pure 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.
Implemented in gnash::AVM1Global.
Referenced by main(), gnash::NetConnection_as::notifyStatus(), gnash::XMLNode_as::object(), gnash::registerBuiltinClass(), and gnash::registerBuiltinObject().
virtual as_object* gnash::Global_as::createString | ( | const std::string & | s | ) | [pure 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.
Implemented in gnash::AVM1Global.
Referenced by gnash::as_value::to_object().
virtual VM& gnash::Global_as::getVM | ( | ) | const [pure virtual] |
Implemented in gnash::AVM1Global.
virtual Global_as& gnash::Global_as::global | ( | ) | [inline, virtual] |