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

This is a special type of function implementing AS-code in C++. More...

#include <builtin_function.h>

Inheritance diagram for gnash::builtin_function:
gnash::UserFunction gnash::as_function gnash::as_object gnash::GcResource

Public Member Functions

 builtin_function (Global_as &gl, ASFunction func)
 Construct a builtin function/class with a default interface. More...
 
virtual boost::uint8_t registers () const
 Return the number of registers required for function execution. More...
 
virtual as_value call (const fn_call &fn)
 Invoke this function or this Class constructor. More...
 
bool isBuiltin ()
 Return true if this is a built-in class. More...
 

Additional Inherited Members

- Static Public Attributes inherited from gnash::as_object
static const int DefaultFlags
 The most common flags for built-in properties. More...
 
- Protected Member Functions inherited from gnash::UserFunction
 UserFunction (Global_as &gl)
 
virtual ~UserFunction ()=0
 This is an abstract base class! More...
 

Detailed Description

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.

Constructor & Destructor Documentation

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'

Parameters
funcThe C function to call when this as_function is invoked. For classes, the function pointer is the constructor.

Member Function Documentation

virtual as_value gnash::builtin_function::call ( const fn_call fn)
inlinevirtual

Invoke this function or this Class constructor.

Implements gnash::as_function.

References gnash::getVM().

bool gnash::builtin_function::isBuiltin ( )
inlinevirtual

Return true if this is a built-in class.

Reimplemented from gnash::as_function.

virtual boost::uint8_t gnash::builtin_function::registers ( ) const
inlinevirtual

Return the number of registers required for function execution.

Gnash's C++ implementations of AS functions don't need any registers!

Implements gnash::UserFunction.


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