19 #ifndef GNASH_FN_CALL_H
20 #define GNASH_FN_CALL_H
38 class movie_definition;
60 typedef typename std::vector<T>::size_type
size_type;
91 void swap(std::vector<T>& to) {
194 assert(!_args.empty());
195 _args.erase(_args.begin());
205 for (
size_t i = 0;
i <
nargs; ++
i) {
218 _args.push_back(arg);
250 template<
typename T = DisplayObject>
288 typename T::value_type*
294 typename T::value_type* ret =
T()(obj);
300 std::string msg =
"Function requiring " + target +
" as 'this' "
301 "called from " + source +
" instance.";
movie_root & getRoot() const
Get a pointer to this VM's Root movie (stage)
Definition: VM.cpp:143
An ActionScript type error.
Definition: GnashException.h:160
fn_call(as_object *this_in, const as_environment &env_in)
Definition: fn_call.h:134
Check that the 'this' pointer is a DisplayObject.
Definition: fn_call.h:251
Client program's interface to the definition of a movie or sprite.
Definition: movie_definition.h:95
void for_each(C &container, R(T::*pmf)(const A &), const A &arg)
Definition: Renderer_ogl.cpp:692
Definition: klash_part.cpp:329
value_type * operator()(const as_object *o) const
Definition: fn_call.h:242
DisplayObject * displayObject() const
Return the DisplayObject associated with this object.
Definition: as_object.h:638
as_object * this_ptr
Definition: fn_call.h:160
Check that the 'this' pointer is not null.
Definition: fn_call.h:261
as_object value_type
Definition: fn_call.h:263
Global_as & getGlobal(const as_environment &env)
Definition: as_environment.cpp:651
FunctionArgs & operator+=(const T &t)
Definition: fn_call.h:72
size_type size() const
Definition: fn_call.h:95
Check that the 'this' pointer has a particular native type ('Relay').
Definition: fn_call.h:239
bool isInstantiation() const
Return true if this call is an object instantiation.
Definition: fn_call.h:179
void drop_bottom()
Definition: fn_call.h:193
const movie_definition * callerDef
Definition containing caller code. 0 if spontaneous (system event).
Definition: fn_call.h:171
void resetArgs()
Definition: fn_call.h:211
int getSWFVersion() const
Get SWF version context for the currently running actions.
Definition: VM.h:106
The base class for all ActionScript objects.
Definition: as_object.h:161
Definition: GnashKey.h:161
const Args::value_type & arg(unsigned int n) const
Access a particular argument.
Definition: fn_call.h:184
T value_type
Definition: fn_call.h:253
Definition: GnashKey.h:160
Provides information about timeline context.
Definition: as_environment.h:50
Definition: GnashKey.h:166
as_object * super
The "super" object in this function call context.
Definition: fn_call.h:165
void dump_args(std::ostream &os) const
Dump arguments to given output stream.
Definition: fn_call.h:204
VM & getVM(const as_environment &env)
Definition: as_environment.h:222
A class to contain transferable arguments for a fn_call.
Definition: as_function.h:30
FunctionArgs()
Definition: fn_call.h:64
fn_call(as_object *this_in, const as_environment &env_in, Args &args, as_object *sup=0, bool isNew=false)
Construct a fn_call.
Definition: fn_call.h:121
void pushArg(const Args::value_type &arg)
Definition: fn_call.h:216
value_type * operator()(as_object *o) const
Definition: fn_call.h:264
int getSWFVersion(const as_environment &env)
Definition: as_environment.cpp:657
VM & getVM() const
Definition: as_environment.h:59
FunctionArgs< as_value > Args
Definition: fn_call.h:111
void setReachable() const
Mark any reachable resources.
Definition: fn_call.h:86
string_table & getStringTable(const as_environment &env)
Definition: as_environment.cpp:639
VM & getVM() const
Return the VM this fn_call is running from.
Definition: fn_call.h:174
The AVM1 virtual machine.
Definition: VM.h:71
Definition: GnashKey.h:132
std::vector< T >::size_type size_type
Definition: fn_call.h:60
void swap(std::vector< T > &to)
Definition: fn_call.h:91
const Args::container_type & getArgs() const
Definition: fn_call.h:189
Definition: GnashKey.h:155
fn_call(const fn_call &fn)
Copy constructor.
Definition: fn_call.h:146
string_table & getStringTable() const
Get a reference to the string table used by the VM.
Definition: VM.h:117
Relay * relay() const
Access the as_object's Relay object.
Definition: as_object.h:620
const as_environment & env() const
Definition: fn_call.h:199
FunctionArgs(const FunctionArgs &other)
The copy constructor copies all the arguments.
Definition: fn_call.h:67
Parameters/environment for builtin or user-defined functions callable from ActionScript.
Definition: fn_call.h:107
std::vector< T > container_type
Definition: fn_call.h:61
T value_type
Definition: fn_call.h:62
FunctionArgs & operator,(const T &t)
Definition: fn_call.h:77
Global_as * getGlobal() const
Get a pointer to this VM's _global Object.
Definition: VM.cpp:149
void setReachable() const
Set any object value as reachable (for the GC)
Definition: as_value.cpp:692
T::value_type * ensure(const fn_call &fn)
Templated function to check the validity of a function call.
Definition: fn_call.h:289
value_type * operator()(const as_object *o) const
Definition: fn_call.h:254
std::string typeName(const T &inst)
Definition: utility.h:93
T value_type
Definition: fn_call.h:241
movie_root & getRoot(const as_environment &env)
Definition: as_environment.cpp:645
Args::size_type nargs
Number of arguments to this ActionScript function call.
Definition: fn_call.h:168