Gnash
0.8.10
|
A class to represent AS3 Classes. More...
#include <Class.h>
Public Member Functions | |
Class () | |
void | setDeclared () |
bool | isDeclared () |
void | setInherited () |
bool | isInherited () |
void | setSystem () |
void | unsetSystem () |
bool | isSystem () |
void | setName (string_table::key name) |
Set our Name. | |
void | dump () |
bool | addValue (string_table::key name, Namespace *ns, boost::uint32_t slotID, Class *type, as_value &val, bool isconst, bool isstatic) |
bool | addSlot (string_table::key name, Namespace *ns, boost::uint32_t slotID, Class *type, bool isstatic) |
bool | addMethod (string_table::key name, Namespace *ns, Method *method, bool isstatic) |
bool | addGetter (string_table::key name, Namespace *ns, Method *method, bool isstatic) |
bool | addSetter (string_table::key name, Namespace *ns, Method *method, bool isstatic) |
bool | addMemberScript (string_table::key name, Namespace *ns, boost::uint32_t slotID, Class *type, bool isstatic) |
bool | addSlotFunction (string_table::key name, Namespace *ns, boost::uint32_t slotID, Method *method, bool isstatic) |
bool | isFinal () const |
Is the class final? | |
void | setFinal () |
Set the class as final. | |
void | unsetFinal () |
Set the class as not final. | |
bool | isSealed () const |
Is the class sealed? | |
void | setSealed () |
Set the class as sealed. | |
void | unsetSealed () |
bool | isInterface () const |
Is the class an interface type? | |
void | setInterface () |
Set the class as an interface. | |
void | unsetInterface () |
Set the class as not an interface. | |
bool | isDynamic () const |
Is the class dynamic? | |
void | setDynamic () |
Set the class as dynamic. | |
void | unsetDynamic () |
Set the class as not dynamic. | |
bool | hasProtectedNs () const |
Does the class have a protected namespace to be inherited? | |
Namespace * | getProtectedNs () |
Get the protected namespace. | |
void | setProtectedNs (Namespace *n) |
Set the protected namespace. | |
string_table::key | getName () const |
The global name of the class. | |
Class * | getSuper () const |
Retrieve the Class from which this Class derives. | |
void | setSuper (Class *p) |
Set the Super Class. | |
void | pushInterface (Class *p) |
We implement this interface. | |
void | setConstructor (Method *m) |
Set the iinit method. | |
Method * | getConstructor () const |
Get the iinit method or 'constructor'. | |
void | setStaticConstructor (Method *m) |
Set the cinit method. | |
Method * | getStaticConstructor () const |
Get the cinit method or 'static constructor'. | |
void | addStaticTrait (const Trait &t) |
void | addInstanceTrait (const Trait &t) |
Property * | getBinding (string_table::key name) |
Property * | getGetBinding (as_value &v, abc::MultiName &n) |
Property * | getSetBinding (as_value &v, abc::MultiName &n) |
void | initTraits (AbcBlock &bl) |
This initializes all the traits. | |
void | setPrototype (as_object *prototype) |
Necessary for the current bogus implementation. | |
void | initPrototype () |
Necessary for the current bogus implementation. | |
as_object * | getPrototype () |
Necessary for the current bogus implementation. |
A class to represent AS3 Classes.
Used to store ABC classes. These are not themselves AS-referenceable objects, but can be associated with AS3 Class objects in a way that is yet to be determined. TODO: update this documentation when we've worked it out. An abc::Class is a static description of an ActionScript Class. Classes have the following important properties: 1. A static initialization method ("cinit"). This is executed during the opcode NewClass, which is generally called only once per class. 2. A constructor method ("iinit"). This is run every time the Class is constructed. As not all Classes are constructed, the iinit method may never be executed. 3. A set of class Traits. 4. A set of instance Traits. Classes are parsed from the "instances" and "classes" section of an ABCBlock. Each of these contains the same number of entries. The iinit methods are found in the instances section, the cinit methods in the classes section.
gnash::abc::Class::Class | ( | ) | [inline] |
bool gnash::abc::Class::addGetter | ( | string_table::key | name, |
Namespace * | ns, | ||
Method * | method, | ||
bool | isstatic | ||
) |
void gnash::abc::Class::addInstanceTrait | ( | const Trait & | t | ) | [inline] |
bool gnash::abc::Class::addMemberScript | ( | string_table::key | name, |
Namespace * | ns, | ||
boost::uint32_t | slotID, | ||
Class * | type, | ||
bool | isstatic | ||
) |
References addSlot().
Referenced by gnash::abc::Trait::finalize().
bool gnash::abc::Class::addMethod | ( | string_table::key | name, |
Namespace * | ns, | ||
Method * | method, | ||
bool | isstatic | ||
) |
References gnash::getVM(), and gnash::as_object::init_member().
Referenced by gnash::abc::Trait::finalize().
bool gnash::abc::Class::addSetter | ( | string_table::key | name, |
Namespace * | ns, | ||
Method * | method, | ||
bool | isstatic | ||
) |
bool gnash::abc::Class::addSlot | ( | string_table::key | name, |
Namespace * | ns, | ||
boost::uint32_t | slotID, | ||
Class * | type, | ||
bool | isstatic | ||
) |
References gnash::abc::Namespace::getURI(), and gnash::as_object::init_member().
Referenced by addMemberScript().
bool gnash::abc::Class::addSlotFunction | ( | string_table::key | name, |
Namespace * | ns, | ||
boost::uint32_t | slotID, | ||
Method * | method, | ||
bool | isstatic | ||
) |
References gnash::key::a, setName(), gnash::NSV::CLASS_FUNCTION, gnash::key::b, gnash::abc::Method::getPrototype(), and addValue().
Referenced by gnash::abc::Trait::finalize().
void gnash::abc::Class::addStaticTrait | ( | const Trait & | t | ) | [inline] |
bool gnash::abc::Class::addValue | ( | string_table::key | name, |
Namespace * | ns, | ||
boost::uint32_t | slotID, | ||
Class * | type, | ||
as_value & | val, | ||
bool | isconst, | ||
bool | isstatic | ||
) |
References gnash::key::g, gnash::get(), gnash::as_value::is_object(), gnash::as_value::to_object(), gnash::as_object::set_member(), gnash::NSV::INTERNAL_TYPE, getName(), gnash::abc::Namespace::getURI(), gnash::readOnly(), and gnash::as_object::init_member().
Referenced by gnash::abc::Trait::finalize(), and addSlotFunction().
void gnash::abc::Class::dump | ( | ) |
Property* gnash::abc::Class::getBinding | ( | string_table::key | name | ) | [inline] |
References gnash::key::i.
Referenced by gnash::abc::Machine::setMember().
Method* gnash::abc::Class::getConstructor | ( | ) | const [inline] |
Get the iinit method or 'constructor'.
A Class is also valid if it does not have an iinit method, so this function can return 0.
Referenced by gnash::abc::Machine::execute(), gnash::abc::Machine::initMachine(), and gnash::abc::Machine::instantiateClass().
Property* gnash::abc::Class::getGetBinding | ( | as_value & | v, |
abc::MultiName & | n | ||
) |
string_table::key gnash::abc::Class::getName | ( | ) | const [inline] |
The global name of the class.
Referenced by gnash::abc::Trait::finalize(), addValue(), gnash::abc::Machine::execute(), and gnash::abc::Method::addValue().
Namespace* gnash::abc::Class::getProtectedNs | ( | ) | [inline] |
Get the protected namespace.
as_object* gnash::abc::Class::getPrototype | ( | ) | [inline] |
Necessary for the current bogus implementation.
Referenced by gnash::abc::Machine::execute(), gnash::abc::Machine::instantiateClass(), and gnash::abc::Method::setOwner().
Property* gnash::abc::Class::getSetBinding | ( | as_value & | v, |
abc::MultiName & | n | ||
) |
Method* gnash::abc::Class::getStaticConstructor | ( | ) | const [inline] |
Get the cinit method or 'static constructor'.
A Class may have no cinit method, so this function can return 0.
Referenced by gnash::abc::Machine::execute().
Class* gnash::abc::Class::getSuper | ( | ) | const [inline] |
Retrieve the Class from which this Class derives.
Referenced by gnash::abc::Machine::findSuper().
bool gnash::abc::Class::hasProtectedNs | ( | ) | const [inline] |
Does the class have a protected namespace to be inherited?
void gnash::abc::Class::initPrototype | ( | ) |
Necessary for the current bogus implementation.
References gnash::get().
Referenced by gnash::abc::AbcBlock::prepare().
void gnash::abc::Class::initTraits | ( | AbcBlock & | bl | ) |
This initializes all the traits.
Note: this is only necessary because the implementation is bogus. TODO: fix it.
References gnash::renderer::opengl::for_each(), gnash::abc::Trait::finalize(), and gnash::key::_1.
Referenced by gnash::abc::AbcBlock::prepare().
bool gnash::abc::Class::isDeclared | ( | ) | [inline] |
bool gnash::abc::Class::isDynamic | ( | ) | const [inline] |
Is the class dynamic?
bool gnash::abc::Class::isFinal | ( | ) | const [inline] |
Is the class final?
bool gnash::abc::Class::isInherited | ( | ) | [inline] |
bool gnash::abc::Class::isInterface | ( | ) | const [inline] |
Is the class an interface type?
bool gnash::abc::Class::isSealed | ( | ) | const [inline] |
Is the class sealed?
bool gnash::abc::Class::isSystem | ( | ) | [inline] |
void gnash::abc::Class::pushInterface | ( | Class * | p | ) | [inline] |
We implement this interface.
void gnash::abc::Class::setConstructor | ( | Method * | m | ) | [inline] |
void gnash::abc::Class::setDeclared | ( | ) | [inline] |
void gnash::abc::Class::setDynamic | ( | ) | [inline] |
Set the class as dynamic.
void gnash::abc::Class::setFinal | ( | ) | [inline] |
Set the class as final.
void gnash::abc::Class::setInherited | ( | ) | [inline] |
void gnash::abc::Class::setInterface | ( | ) | [inline] |
Set the class as an interface.
void gnash::abc::Class::setName | ( | string_table::key | name | ) | [inline] |
Set our Name.
Referenced by addSlotFunction(), gnash::abc::Method::addSlotFunction(), and gnash::abc::Namespace::stubPrototype().
void gnash::abc::Class::setProtectedNs | ( | Namespace * | n | ) | [inline] |
Set the protected namespace.
References gnash::key::n.
void gnash::abc::Class::setPrototype | ( | as_object * | prototype | ) | [inline] |
Necessary for the current bogus implementation.
Referenced by gnash::abc::AbcBlock::prepare().
void gnash::abc::Class::setSealed | ( | ) | [inline] |
Set the class as sealed.
void gnash::abc::Class::setStaticConstructor | ( | Method * | m | ) | [inline] |
void gnash::abc::Class::setSuper | ( | Class * | p | ) | [inline] |
void gnash::abc::Class::setSystem | ( | ) | [inline] |
void gnash::abc::Class::unsetDynamic | ( | ) | [inline] |
Set the class as not dynamic.
void gnash::abc::Class::unsetFinal | ( | ) | [inline] |
Set the class as not final.
void gnash::abc::Class::unsetInterface | ( | ) | [inline] |
Set the class as not an interface.
void gnash::abc::Class::unsetSealed | ( | ) | [inline] |
void gnash::abc::Class::unsetSystem | ( | ) | [inline] |