Gnash
0.8.11dev
|
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. More... | |
void | dump () |
bool | addValue (string_table::key name, Namespace *ns, std::uint32_t slotID, Class *type, as_value &val, bool isconst, bool isstatic) |
bool | addSlot (string_table::key name, Namespace *ns, std::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, std::uint32_t slotID, Class *type, bool isstatic) |
bool | addSlotFunction (string_table::key name, Namespace *ns, std::uint32_t slotID, Method *method, bool isstatic) |
bool | isFinal () const |
Is the class final? More... | |
void | setFinal () |
Set the class as final. More... | |
void | unsetFinal () |
Set the class as not final. More... | |
bool | isSealed () const |
Is the class sealed? More... | |
void | setSealed () |
Set the class as sealed. More... | |
void | unsetSealed () |
bool | isInterface () const |
Is the class an interface type? More... | |
void | setInterface () |
Set the class as an interface. More... | |
void | unsetInterface () |
Set the class as not an interface. More... | |
bool | isDynamic () const |
Is the class dynamic? More... | |
void | setDynamic () |
Set the class as dynamic. More... | |
void | unsetDynamic () |
Set the class as not dynamic. More... | |
bool | hasProtectedNs () const |
Does the class have a protected namespace to be inherited? More... | |
Namespace * | getProtectedNs () |
Get the protected namespace. More... | |
void | setProtectedNs (Namespace *n) |
Set the protected namespace. More... | |
string_table::key | getName () const |
The global name of the class. More... | |
Class * | getSuper () const |
Retrieve the Class from which this Class derives. More... | |
void | setSuper (Class *p) |
Set the Super Class. More... | |
void | pushInterface (Class *p) |
We implement this interface. More... | |
void | setConstructor (Method *m) |
Set the iinit method. More... | |
Method * | getConstructor () const |
Get the iinit method or 'constructor'. More... | |
void | setStaticConstructor (Method *m) |
Set the cinit method. More... | |
Method * | getStaticConstructor () const |
Get the cinit method or 'static constructor'. More... | |
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. More... | |
void | setPrototype (as_object *prototype) |
Necessary for the current bogus implementation. More... | |
void | initPrototype () |
Necessary for the current bogus implementation. More... | |
as_object * | getPrototype () |
Necessary for the current bogus implementation. More... | |
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.
|
inline |
bool gnash::abc::Class::addGetter | ( | string_table::key | name, |
Namespace * | ns, | ||
Method * | method, | ||
bool | isstatic | ||
) |
|
inline |
Referenced by gnash::abc::AbcBlock::locateClass().
bool gnash::abc::Class::addMemberScript | ( | string_table::key | name, |
Namespace * | ns, | ||
std::uint32_t | slotID, | ||
Class * | type, | ||
bool | isstatic | ||
) |
References addSlot().
Referenced by addSetter(), and 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 addSetter(), and gnash::abc::Trait::finalize().
bool gnash::abc::Class::addSetter | ( | string_table::key | name, |
Namespace * | ns, | ||
Method * | method, | ||
bool | isstatic | ||
) |
References addMemberScript(), addMethod(), addSlot(), addSlotFunction(), addValue(), gnash::PropFlags::dontDelete, gnash::PropFlags::dontEnum, gnash::as_object::getOwnProperty(), gnash::abc::Method::getPrototype(), gnash::abc::Namespace::getURI(), gnash::as_object::init_property(), name, and test::uri.
Referenced by gnash::abc::Trait::finalize().
bool gnash::abc::Class::addSlot | ( | string_table::key | name, |
Namespace * | ns, | ||
std::uint32_t | slotID, | ||
Class * | type, | ||
bool | isstatic | ||
) |
References gnash::abc::Namespace::getURI(), and gnash::as_object::init_member().
Referenced by addMemberScript(), and addSetter().
bool gnash::abc::Class::addSlotFunction | ( | string_table::key | name, |
Namespace * | ns, | ||
std::uint32_t | slotID, | ||
Method * | method, | ||
bool | isstatic | ||
) |
References gnash::key::a, addValue(), gnash::key::b, gnash::NSV::CLASS_FUNCTION, gnash::abc::Method::getPrototype(), and setName().
Referenced by addSetter(), and gnash::abc::Trait::finalize().
|
inline |
Referenced by gnash::abc::AbcBlock::locateClass().
bool gnash::abc::Class::addValue | ( | string_table::key | name, |
Namespace * | ns, | ||
std::uint32_t | slotID, | ||
Class * | type, | ||
as_value & | val, | ||
bool | isconst, | ||
bool | isstatic | ||
) |
References gnash::PropFlags::dontDelete, gnash::key::g, gnash::get(), getName(), gnash::abc::Namespace::getURI(), gnash::as_object::init_member(), gnash::NSV::INTERNAL_TYPE, gnash::as_value::is_object(), gnash::PropFlags::readOnly, gnash::as_object::set_member(), gnash::as_value::to_object(), and test::uri.
Referenced by addSetter(), addSlotFunction(), and gnash::abc::Trait::finalize().
void gnash::abc::Class::dump | ( | ) |
|
inline |
References gnash::key::i, gnash::key::n, and test::v.
Referenced by gnash::abc::Machine::setMember().
|
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 | ||
) |
|
inline |
The global name of the class.
Referenced by addValue(), gnash::abc::Method::addValue(), gnash::abc::Machine::execute(), and gnash::abc::Trait::finalize().
|
inline |
Get the protected namespace.
Referenced by gnash::abc::AbcBlock::locateClass().
|
inline |
Necessary for the current bogus implementation.
References gnash::key::b, and gnash::key::i.
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 | ||
) |
|
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().
|
inline |
Retrieve the Class from which this Class derives.
Referenced by gnash::abc::Machine::findSuper(), and gnash::abc::AbcBlock::locateClass().
|
inline |
Does the class have a protected namespace to be inherited?
Referenced by gnash::abc::AbcBlock::locateClass().
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::key::_1, gnash::abc::Trait::finalize(), and gnash::renderer::opengl::for_each().
Referenced by gnash::abc::AbcBlock::prepare().
|
inline |
|
inline |
Is the class dynamic?
|
inline |
Is the class final?
Referenced by gnash::abc::AbcBlock::locateClass().
|
inline |
|
inline |
Is the class an interface type?
Referenced by gnash::abc::AbcBlock::locateClass().
|
inline |
Is the class sealed?
|
inline |
|
inline |
We implement this interface.
Referenced by gnash::abc::AbcBlock::locateClass().
|
inline |
Set the iinit method.
This is used to construct instances of the Class.
References gnash::key::m.
Referenced by gnash::abc::AbcBlock::locateClass().
|
inline |
Referenced by gnash::abc::AbcBlock::locateClass().
|
inline |
Set the class as dynamic.
Referenced by gnash::abc::AbcBlock::locateClass().
|
inline |
Set the class as final.
Referenced by gnash::abc::AbcBlock::locateClass().
|
inline |
Referenced by gnash::abc::AbcBlock::locateClass().
|
inline |
Set the class as an interface.
Referenced by gnash::abc::AbcBlock::locateClass().
|
inline |
Set our Name.
Referenced by addSlotFunction(), gnash::abc::Method::addSlotFunction(), gnash::abc::AbcBlock::locateClass(), and gnash::abc::Namespace::stubPrototype().
|
inline |
Set the protected namespace.
References gnash::key::n.
Referenced by gnash::abc::AbcBlock::locateClass().
|
inline |
Necessary for the current bogus implementation.
Referenced by gnash::abc::AbcBlock::prepare().
|
inline |
Set the class as sealed.
Referenced by gnash::abc::AbcBlock::locateClass().
|
inline |
Set the cinit method.
This is used to initialize the Class.
References gnash::key::m.
Referenced by gnash::abc::AbcBlock::locateClass().
|
inline |
Set the Super Class.
This is the base class for this Class.
Referenced by gnash::abc::AbcBlock::locateClass().
|
inline |
|
inline |
Set the class as not dynamic.
|
inline |
Set the class as not final.
|
inline |
Set the class as not an interface.
|
inline |
|
inline |