xoreos  0.0.5
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Aurora::ActionScript::AVM Class Reference

The Action script virtual machine (AVM). More...

#include <avm.h>

Collaboration diagram for Aurora::ActionScript::AVM:
Collaboration graph
[legend]

Public Member Functions

 AVM ()
 
void setRegisterClassFunction (RegisterClassFunction)
 Set a callback for the Object.registerClass() function. More...
 
void setFSCommandCallback (FSCommandFunction)
 Set a callback for the fscommand() function. More...
 
void fsCommand (const Common::UString &name, const Common::UString &value)
 fscommand is used for communicating with the host program. More...
 
void storeRegister (Variable value, byte index)
 
Variable getRegister (byte index)
 
bool hasVariable (const Common::UString &name)
 Check if a specific variable exists. More...
 
void setVariable (const Common::UString &name, Variable value)
 Set a specific variable. More...
 
Variable getVariable (const Common::UString &name)
 
Variable createNewObject (const Common::UString &name, std::vector< Variable > arguments=std::vector< Variable >())
 
void setStopFlag ()
 
bool getStopFlag ()
 
void setReturnValue (Variable returnValue=Variable())
 
Variable getReturnValue ()
 

Private Member Functions

Variable registerClass (AVM &avm)
 

Private Attributes

RegisterClassFunction _registerClass
 
FSCommandFunction _fscommand
 
std::vector< Variable_registers
 
std::map< Common::UString, Variable_variables
 
bool _stopFlag
 
Variable _returnValue
 

Detailed Description

The Action script virtual machine (AVM).

Definition at line 46 of file avm.h.

Constructor & Destructor Documentation

◆ AVM()

Aurora::ActionScript::AVM::AVM ( )

Definition at line 42 of file avm.cpp.

References _registers, _stopFlag, _variables, and registerClass().

Here is the call graph for this function:

Member Function Documentation

◆ createNewObject()

Variable Aurora::ActionScript::AVM::createNewObject ( const Common::UString name,
std::vector< Variable arguments = std::vector<Variable>() 
)

◆ fsCommand()

void Aurora::ActionScript::AVM::fsCommand ( const Common::UString name,
const Common::UString value 
)

fscommand is used for communicating with the host program.

It is one of Scaleforms ways for sending messages from the actionscript code to the c++ program.

Parameters
nameThe name of the fscommand like "PlayMovie".
valueThe parameters of the fscommand.

Definition at line 77 of file avm.cpp.

References _fscommand, Common::UString::c_str(), and info().

Referenced by Aurora::ActionScript::ASBuffer::actionGetURL(), and Aurora::ActionScript::ASBuffer::actionGetURL2().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRegister()

Variable Aurora::ActionScript::AVM::getRegister ( byte  index)

◆ getReturnValue()

Variable Aurora::ActionScript::AVM::getReturnValue ( )

Definition at line 160 of file avm.cpp.

References _returnValue.

Referenced by Aurora::ActionScript::Object::call(), and Aurora::ActionScript::ScriptedFunction::operator()().

Here is the caller graph for this function:

◆ getStopFlag()

bool Aurora::ActionScript::AVM::getStopFlag ( )

Definition at line 150 of file avm.cpp.

References _stopFlag.

◆ getVariable()

Variable Aurora::ActionScript::AVM::getVariable ( const Common::UString name)

◆ hasVariable()

bool Aurora::ActionScript::AVM::hasVariable ( const Common::UString name)

Check if a specific variable exists.

Definition at line 83 of file avm.cpp.

References _variables.

◆ registerClass()

Variable Aurora::ActionScript::AVM::registerClass ( AVM avm)
private

Definition at line 164 of file avm.cpp.

References _registerClass, Aurora::ActionScript::Variable::asString(), getRegister(), and Aurora::ActionScript::Variable::isString().

Referenced by AVM(), and setRegisterClassFunction().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setFSCommandCallback()

void Aurora::ActionScript::AVM::setFSCommandCallback ( FSCommandFunction  fscommand)

Set a callback for the fscommand() function.

Definition at line 65 of file avm.cpp.

References _fscommand.

◆ setRegisterClassFunction()

void Aurora::ActionScript::AVM::setRegisterClassFunction ( RegisterClassFunction  registerClass)

Set a callback for the Object.registerClass() function.

Definition at line 61 of file avm.cpp.

References _registerClass, and registerClass().

Here is the call graph for this function:

◆ setReturnValue()

void Aurora::ActionScript::AVM::setReturnValue ( Variable  returnValue = Variable())

Definition at line 156 of file avm.cpp.

References _returnValue.

Referenced by Aurora::ActionScript::ASBuffer::actionCallMethod(), Aurora::ActionScript::ASBuffer::actionReturn(), and Aurora::ActionScript::Object::call().

Here is the caller graph for this function:

◆ setStopFlag()

void Aurora::ActionScript::AVM::setStopFlag ( )

Definition at line 146 of file avm.cpp.

References _stopFlag.

Referenced by Aurora::ActionScript::ASBuffer::actionStop().

Here is the caller graph for this function:

◆ setVariable()

void Aurora::ActionScript::AVM::setVariable ( const Common::UString name,
Variable  value 
)

Set a specific variable.

Definition at line 92 of file avm.cpp.

References _variables.

Referenced by Aurora::ActionScript::ASBuffer::actionDefineLocal(), and Aurora::ActionScript::ASBuffer::actionSetVariable().

Here is the caller graph for this function:

◆ storeRegister()

void Aurora::ActionScript::AVM::storeRegister ( Variable  value,
byte  index 
)

Member Data Documentation

◆ _fscommand

FSCommandFunction Aurora::ActionScript::AVM::_fscommand
private

Definition at line 86 of file avm.h.

Referenced by fsCommand(), and setFSCommandCallback().

◆ _registerClass

RegisterClassFunction Aurora::ActionScript::AVM::_registerClass
private

Definition at line 85 of file avm.h.

Referenced by registerClass(), and setRegisterClassFunction().

◆ _registers

std::vector<Variable> Aurora::ActionScript::AVM::_registers
private

Definition at line 88 of file avm.h.

Referenced by AVM(), getRegister(), and storeRegister().

◆ _returnValue

Variable Aurora::ActionScript::AVM::_returnValue
private

Definition at line 92 of file avm.h.

Referenced by getReturnValue(), and setReturnValue().

◆ _stopFlag

bool Aurora::ActionScript::AVM::_stopFlag
private

Definition at line 91 of file avm.h.

Referenced by AVM(), getStopFlag(), and setStopFlag().

◆ _variables

std::map<Common::UString, Variable> Aurora::ActionScript::AVM::_variables
private

Definition at line 89 of file avm.h.

Referenced by AVM(), createNewObject(), getVariable(), hasVariable(), and setVariable().


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