Gnash
0.8.10
|
Class describing a static property. More...
#include <AbcBlock.h>
Public Types | |
enum | Kind { KIND_SLOT = 0, KIND_CONST = 6, KIND_METHOD = 1, KIND_GETTER = 2, KIND_SETTER = 3, KIND_CLASS = 4, KIND_FUNCTION = 5 } |
Public Member Functions | |
Trait () | |
bool | read (SWFStream *in, AbcBlock *block) |
Read an AS3 'trait'. | |
bool | finalize (AbcBlock *block, abc::Class *cl, bool do_static) |
bool | finalize_mbody (AbcBlock *block, Method *m) |
void | set_target (abc::Class *cl, bool do_static) |
void | set_target (Method *m) |
bool | finalize (AbcBlock *block) |
Friends | |
class | AbcBlock |
Class describing a static property.
Traits are non-dynamic properties. That is, they are not deletable or modifiable in certain ways through ActionScript. They exist for reasons of performance. A property lookup on an object always checks the Traits before dynamic properties. Traits can belong to Methods, Classes, and Scripts. Classes have both instance and Class traits. TODO: Traits currently need finalization. This performs two tasks. At least one, and possibly both, are wrong: 1. Trait definitions contain references to AbcBlock definitions. Currently these references are resolved during finalization. It may be possible to do this during parsing. 2. Traits should be made available to ActionScript. Currently this is done by attaching them to an object. This is plain wrong and doesn't even work in many cases. TODO: As Traits are stored in the correct Class, Method etc, they do not need to store a target.
gnash::abc::Trait::Trait | ( | ) | [inline] |
bool gnash::abc::Trait::finalize | ( | AbcBlock * | block, |
abc::Class * | cl, | ||
bool | do_static | ||
) |
References gnash::string_table::value(), gnash::abc::Class::getName(), KIND_SLOT, KIND_CONST, gnash::abc::AbcBlock::locateClass(), _, gnash::abc::Class::addValue(), KIND_METHOD, gnash::abc::Class::addMethod(), KIND_GETTER, gnash::abc::Class::addGetter(), KIND_SETTER, gnash::abc::Class::addSetter(), KIND_CLASS, gnash::abc::Class::addMemberScript(), KIND_FUNCTION, and gnash::abc::Class::addSlotFunction().
Referenced by finalize(), gnash::abc::Class::initTraits(), and gnash::abc::Method::initTraits().
bool gnash::abc::Trait::finalize | ( | AbcBlock * | block | ) | [inline] |
References finalize(), and finalize_mbody().
References KIND_SLOT, KIND_CONST, gnash::abc::AbcBlock::locateClass(), _, gnash::abc::Method::addValue(), KIND_METHOD, gnash::abc::Method::addMethod(), KIND_GETTER, gnash::abc::Method::addGetter(), KIND_SETTER, gnash::abc::Method::addSetter(), KIND_CLASS, gnash::abc::Method::addMemberScript(), KIND_FUNCTION, and gnash::abc::Method::addSlotFunction().
Referenced by finalize().
Read an AS3 'trait'.
References gnash::SWFStream::read_V32(), _, gnash::SWFStream::read_u8(), gnash::abc::MultiName::getABCName(), KIND_SLOT, KIND_CONST, gnash::key::c, KIND_METHOD, KIND_GETTER, KIND_SETTER, gnash::SWFStream::skip_V32(), KIND_CLASS, gnash::string_table::value(), KIND_FUNCTION, and gnash::key::i.
void gnash::abc::Trait::set_target | ( | abc::Class * | cl, |
bool | do_static | ||
) | [inline] |
void gnash::abc::Trait::set_target | ( | Method * | m | ) | [inline] |
References gnash::key::m.
friend class AbcBlock [friend] |