Gnash  0.8.11dev
Public Types | Public Member Functions | List of all members
gnash::as_environment Class Reference

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.

Public Member Functions

 as_environment (VM &vm)
VMgetVM () const
DisplayObjecttarget () const
void set_target (DisplayObject *target)
 Set default target for timeline opcodes.
void set_original_target (DisplayObject *target)
DisplayObjectget_original_target () const
void reset_target ()
void push (const as_value &val)
 Push a value on the stack.
as_value pop ()
 Pops an as_value off the stack top and return it.
as_valuetop (size_t dist) const
 Get stack value at the given distance from top.
void drop (size_t count)
 Drop 'count' values off the top of the stack.
size_t stack_size () const
void markReachableResources () const
 Mark all reachable resources.
int get_version () const
 Return the SWF version we're running for.

Detailed Description

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.

Member Typedef Documentation

A stack of objects used for variables/members lookup.

Constructor & Destructor Documentation

gnash::as_environment::as_environment ( VM vm)

Member Function Documentation

void gnash::as_environment::drop ( size_t  count)
inline

Drop 'count' values off the top of the stack.

References gnash::SafeStack< T >::drop(), and gnash::SafeStack< T >::size().

Referenced by gnash::ActionExec::operator()().

DisplayObject* gnash::as_environment::get_original_target ( ) const
inline
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().

VM& gnash::as_environment::getVM ( ) const
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 gnash::Function::markReachableResources().

as_value gnash::as_environment::pop ( )
inline

Pops an as_value off the stack top and return it.

References gnash::SafeStack< T >::pop().

void gnash::as_environment::push ( const as_value val)
inline

Push a value on the stack.

References gnash::SafeStack< T >::push().

void gnash::as_environment::reset_target ( )
inline
void gnash::as_environment::set_original_target ( DisplayObject target)
inline
void gnash::as_environment::set_target ( DisplayObject target)
inline

Set default target for timeline opcodes.

Parameters
targetA 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::TargetGuard::TargetGuard(), and gnash::TargetGuard::~TargetGuard().

size_t gnash::as_environment::stack_size ( ) const
inline
DisplayObject* gnash::as_environment::target ( ) const
inline
as_value& gnash::as_environment::top ( size_t  dist) const
inline

Get stack value at the given distance from top.

top(0) is actual stack top

Throw StackException if index is out of range

References dist, and gnash::SafeStack< T >::top().

Referenced by gnash::ActionExec::operator()().


The documentation for this class was generated from the following files: