Gnash
0.8.11dev
|
Provides information about timeline context. More...
#include <as_environment.h>
Public Types | |
typedef std::vector< as_object * > | ScopeStack |
A stack of objects used for variables/members lookup. More... | |
Public Member Functions | |
DSOTEXPORT | as_environment (VM &vm) |
VM & | getVM () const |
DisplayObject * | target () const |
void | set_target (DisplayObject *target) |
Set default target for timeline opcodes. More... | |
void | set_original_target (DisplayObject *target) |
DisplayObject * | get_original_target () const |
void | reset_target () |
void | push (const as_value &val) |
Push a value on the stack. More... | |
as_value | pop () |
Pops an as_value off the stack top and return it. More... | |
as_value & | top (size_t dist) const |
Get stack value at the given distance from top. More... | |
void | drop (size_t count) |
Drop 'count' values off the top of the stack. More... | |
size_t | stack_size () const |
void | markReachableResources () const |
Mark all reachable resources. More... | |
int | get_version () const |
Return the SWF version we're running for. More... | |
Provides information about timeline context.
This class stores information about the current and original "target" of execution. A target is a MovieClip or other AS-referenceable DisplayObject. Non-timeline code has no target. Why should a timeline context provide access to the VM stack? It shouldn't! TODO: remove stack access proxy functions, SWF version, etc.
typedef std::vector<as_object*> gnash::as_environment::ScopeStack |
A stack of objects used for variables/members lookup.
gnash::as_environment::as_environment | ( | VM & | vm | ) |
|
inline |
Drop 'count' values off the top of the stack.
Referenced by gnash::SWF::SWFHandlers::execute(), and gnash::ActionExec::operator()().
|
inline |
Referenced by gnash::Function2::call(), gnash::findObject(), gnash::ActionExec::getThisPointer(), and gnash::parsePath().
int gnash::as_environment::get_version | ( | ) | const |
Return the SWF version we're running for.
This is merely a proxy for VM::getSWFVersion.
References gnash::VM::getSWFVersion().
Referenced by gnash::SWF::SWFHandlers::execute(), and stack_size().
|
inline |
void gnash::as_environment::markReachableResources | ( | ) | const |
Mark all reachable resources.
Only the targets are reachable.
References gnash::GcResource::setReachable().
Referenced by gnash::MovieClip::markOwnResources(), and stack_size().
|
inline |
Pops an as_value off the stack top and return it.
Referenced by gnash::SWF::SWFHandlers::execute(), and gnash::ActionExec::operator()().
|
inline |
Push a value on the stack.
Referenced by gnash::ActionExec::operator()().
|
inline |
|
inline |
References target().
Referenced by gnash::TargetGuard::TargetGuard(), and gnash::TargetGuard::~TargetGuard().
|
inline |
Set default target for timeline opcodes.
target | A DisplayObject to apply timeline opcodes on. Zero is a valid target, disabling timeline opcodes (would get ignored). |
References target().
Referenced by gnash::MovieClip::MovieClip(), gnash::ActionExec::operator()(), gnash::TargetGuard::TargetGuard(), and gnash::TargetGuard::~TargetGuard().
|
inline |
References gnash::delVariable(), DSOEXPORT, gnash::findObject(), gnash::findTarget(), get_version(), gnash::getVariable(), markReachableResources(), gnash::parsePath(), path, and gnash::setVariable().
Referenced by gnash::ActionExec::operator()().
|
inline |
Referenced by gnash::Function2::call(), gnash::delVariable(), gnash::SWF::SWFHandlers::execute(), gnash::findObject(), gnash::TextField::getDefinitionVersion(), gnash::ActionExec::getTarget(), gnash::getVariable(), gnash::initObjectClass(), gnash::ActionExec::operator()(), gnash::parsePath(), gnash::registerBitmapDataNative(), set_original_target(), set_target(), and gnash::setVariable().
|
inline |
Get stack value at the given distance from top.
top(0) is actual stack top
Throw StackException if index is out of range
Referenced by gnash::SWF::SWFHandlers::execute(), and gnash::ActionExec::operator()().