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. More...
 

Public Member Functions

DSOTEXPORT as_environment (VM &vm)
 
VMgetVM () const
 
DisplayObjecttarget () const
 
void set_target (DisplayObject *target)
 Set default target for timeline opcodes. More...
 
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. More...
 
as_value pop ()
 Pops an as_value off the stack top and return it. More...
 
as_valuetop (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...
 

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

§ ScopeStack

A stack of objects used for variables/members lookup.

Constructor & Destructor Documentation

§ as_environment()

gnash::as_environment::as_environment ( VM vm)

Member Function Documentation

§ drop()

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

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

Referenced by gnash::SWF::SWFHandlers::execute(), and gnash::ActionExec::operator()().

§ get_original_target()

DisplayObject* gnash::as_environment::get_original_target ( ) const
inline

§ get_version()

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().

§ getVM()

VM& gnash::as_environment::getVM ( ) const
inline

§ markReachableResources()

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().

§ pop()

as_value gnash::as_environment::pop ( )
inline

Pops an as_value off the stack top and return it.

Referenced by gnash::SWF::SWFHandlers::execute(), and gnash::ActionExec::operator()().

§ push()

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

Push a value on the stack.

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

§ reset_target()

void gnash::as_environment::reset_target ( )
inline

§ set_original_target()

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

§ set_target()

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

§ stack_size()

size_t gnash::as_environment::stack_size ( ) const
inline

§ target()

DisplayObject* gnash::as_environment::target ( ) const
inline

§ top()

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

Referenced by gnash::SWF::SWFHandlers::execute(), and gnash::ActionExec::operator()().


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