Gnash
0.8.10
|
This is a special type of function implementing AS-code in C++. More...
#include <builtin_function.h>
Public Member Functions | |
builtin_function (Global_as &gl, ASFunction func) | |
Construct a builtin function/class with a default interface. | |
virtual boost::uint8_t | registers () const |
Return the number of registers required for function execution. | |
virtual as_value | call (const fn_call &fn) |
Invoke this function or this Class constructor. | |
bool | isBuiltin () |
Return true if this is a built-in class. |
This is a special type of function implementing AS-code in C++.
Many functions (including classes) are implemented in ActionScript in the reference player. Gnash implements them in C++, but they must be treated like swf-defined functions. They are distinct from NativeFunctions, which are part of the player and do not go through the ActionScript interpreter.
gnash::builtin_function::builtin_function | ( | Global_as & | gl, |
ASFunction | func | ||
) | [inline] |
Construct a builtin function/class with a default interface.
The default interface will have a constructor member set as 'this'
func | The C function to call when this as_function is invoked. For classes, the function pointer is the constructor. |
Invoke this function or this Class constructor.
Implements gnash::as_function.
References gnash::getVM(), and assert.
bool gnash::builtin_function::isBuiltin | ( | ) | [inline, virtual] |
Return true if this is a built-in class.
Reimplemented from gnash::as_function.
virtual boost::uint8_t gnash::builtin_function::registers | ( | ) | const [inline, virtual] |
Return the number of registers required for function execution.
Gnash's C++ implementations of AS functions don't need any registers!
Implements gnash::UserFunction.