xoreos
0.0.5
|
The Action script virtual machine (AVM). More...
#include <avm.h>
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 |
Aurora::ActionScript::AVM::AVM | ( | ) |
Definition at line 42 of file avm.cpp.
References _registers, _stopFlag, _variables, and registerClass().
Variable Aurora::ActionScript::AVM::createNewObject | ( | const Common::UString & | name, |
std::vector< Variable > | arguments = std::vector<Variable>() |
||
) |
Definition at line 107 of file avm.cpp.
References _variables, Aurora::ActionScript::Variable::asObject(), Aurora::ActionScript::Function::getPreloadRootFlag(), Aurora::ActionScript::Function::getPreloadSuperFlag(), Aurora::ActionScript::Function::getPreloadThisFlag(), getVariable(), Aurora::ActionScript::Variable::isFunction(), and storeRegister().
Referenced by Aurora::ActionScript::ASBuffer::actionNewObject().
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.
name | The name of the fscommand like "PlayMovie". |
value | The 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().
Definition at line 73 of file avm.cpp.
References _registers.
Referenced by Aurora::ActionScript::ASBuffer::actionCallMethod(), Aurora::ActionScript::ASBuffer::actionPush(), Aurora::ActionScript::as_pop(), Aurora::ActionScript::as_push(), and registerClass().
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()().
bool Aurora::ActionScript::AVM::getStopFlag | ( | ) |
Variable Aurora::ActionScript::AVM::getVariable | ( | const Common::UString & | name | ) |
Definition at line 96 of file avm.cpp.
References _variables.
Referenced by Aurora::ActionScript::ASBuffer::actionCallMethod(), Aurora::ActionScript::ASBuffer::actionGetVariable(), Aurora::ActionScript::Object::call(), and createNewObject().
bool Aurora::ActionScript::AVM::hasVariable | ( | const Common::UString & | name | ) |
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().
void Aurora::ActionScript::AVM::setFSCommandCallback | ( | FSCommandFunction | fscommand | ) |
Set a callback for the fscommand() function.
Definition at line 65 of file avm.cpp.
References _fscommand.
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().
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().
void Aurora::ActionScript::AVM::setStopFlag | ( | ) |
Definition at line 146 of file avm.cpp.
References _stopFlag.
Referenced by Aurora::ActionScript::ASBuffer::actionStop().
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().
Definition at line 69 of file avm.cpp.
References _registers.
Referenced by Aurora::ActionScript::ASBuffer::actionCallMethod(), Aurora::ActionScript::ASBuffer::actionStoreRegister(), Aurora::ActionScript::Object::call(), and createNewObject().
|
private |
Definition at line 86 of file avm.h.
Referenced by fsCommand(), and setFSCommandCallback().
|
private |
Definition at line 85 of file avm.h.
Referenced by registerClass(), and setRegisterClassFunction().
|
private |
Definition at line 88 of file avm.h.
Referenced by AVM(), getRegister(), and storeRegister().
|
private |
Definition at line 92 of file avm.h.
Referenced by getReturnValue(), and setReturnValue().
|
private |
Definition at line 91 of file avm.h.
Referenced by AVM(), getStopFlag(), and setStopFlag().
|
private |
Definition at line 89 of file avm.h.
Referenced by AVM(), createNewObject(), getVariable(), hasVariable(), and setVariable().