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;
71 _v.push_back(std::move(t));
76 _v.push_back(std::move(t));
82 _v.emplace_back(std::forward<U>(
u));
88 _v.emplace_back(std::forward<U>(
u));
101 void swap(std::vector<T>& to) {
132 Args& args,
as_object* sup =
nullptr,
bool isNew =
false)
158 this_ptr(fn.this_ptr),
161 callerDef(fn.callerDef),
204 assert(!_args.empty());
205 _args.erase(_args.begin());
215 for (
size_t i = 0;
i < nargs; ++
i) {
228 _args.push_back(arg);
253 return dynamic_cast<value_type*
>(o->
relay());
260 template<
typename T = DisplayObject>
265 if (!o)
return nullptr;
298 typename T::value_type*
304 typename T::value_type* ret =
T()(obj);
310 std::string msg =
"Function requiring " + target +
" as 'this' " 311 "called from " + source +
" instance.";
An ActionScript type error.
Definition: GnashException.h:160
fn_call(as_object *this_in, const as_environment &env_in)
Definition: fn_call.h:144
Check that the 'this' pointer is a DisplayObject.
Definition: fn_call.h:261
FunctionArgs & operator,(U &&u)
Definition: fn_call.h:81
Global_as * getGlobal() const
Get a pointer to this VM's _global Object.
Definition: VM.cpp:149
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:690
Definition: klash_part.cpp:329
as_object * this_ptr
Definition: fn_call.h:170
movie_root & getRoot() const
Get a pointer to this VM's Root movie (stage)
Definition: VM.cpp:143
const Args::value_type & arg(unsigned int n) const
Access a particular argument.
Definition: fn_call.h:194
Check that the 'this' pointer is not null.
Definition: fn_call.h:271
string_table & getStringTable() const
Get a reference to the string table used by the VM.
Definition: VM.h:117
as_object value_type
Definition: fn_call.h:273
const Args::container_type & getArgs() const
Definition: fn_call.h:199
Definition: GnashKey.h:167
Global_as & getGlobal(const as_environment &env)
Definition: as_environment.cpp:651
const as_environment & _env
Definition: Array_as.cpp:682
Check that the 'this' pointer has a particular native type ('Relay').
Definition: fn_call.h:249
void setReachable() const
Mark any reachable resources.
Definition: fn_call.h:96
size_type size() const
Definition: fn_call.h:105
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:40
void drop_bottom()
Definition: fn_call.h:203
const movie_definition * callerDef
Definition containing caller code. 0 if spontaneous (system event).
Definition: fn_call.h:181
FunctionArgs & operator+=(T t)
Definition: fn_call.h:70
void resetArgs()
Definition: fn_call.h:221
The base class for all ActionScript objects.
Definition: as_object.h:161
Definition: GnashKey.h:161
DisplayObject * displayObject() const
Return the DisplayObject associated with this object.
Definition: as_object.h:638
A general use string table.
Definition: string_table.h:41
T value_type
Definition: fn_call.h:263
Definition: GnashKey.h:160
Provides information about timeline context.
Definition: as_environment.h:50
Definition: GnashKey.h:166
FunctionArgs & operator+=(U &&u)
Definition: fn_call.h:87
as_object * super
The "super" object in this function call context.
Definition: fn_call.h:175
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
bool isInstantiation() const
Return true if this call is an object instantiation.
Definition: fn_call.h:189
Relay * relay() const
Access the as_object's Relay object.
Definition: as_object.h:620
FunctionArgs & operator,(T t)
Definition: fn_call.h:75
void pushArg(const Args::value_type &arg)
Definition: fn_call.h:226
int getSWFVersion(const as_environment &env)
Definition: as_environment.cpp:657
FunctionArgs< as_value > Args
Definition: fn_call.h:121
Definition: GnashKey.h:133
value_type * operator()(as_object *o) const
Definition: fn_call.h:274
The Global object ultimately contains all objects in an ActionScript run.
Definition: Global_as.h:49
fn_call(as_object *this_in, const as_environment &env_in, Args &args, as_object *sup=nullptr, bool isNew=false)
Construct a fn_call.
Definition: fn_call.h:131
string_table & getStringTable(const as_environment &env)
Definition: as_environment.cpp:639
int getSWFVersion() const
Get SWF version context for the currently running actions.
Definition: VM.h:106
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:101
void dump_args(std::ostream &os) const
Dump arguments to given output stream.
Definition: fn_call.h:214
Definition: GnashKey.h:155
fn_call(const fn_call &fn)
Copy constructor.
Definition: fn_call.h:156
const as_environment & env() const
Definition: fn_call.h:209
value_type * operator()(const as_object *o) const
Definition: fn_call.h:252
Parameters/environment for builtin or user-defined functions callable from ActionScript.
Definition: fn_call.h:117
std::vector< T > container_type
Definition: fn_call.h:61
T value_type
Definition: fn_call.h:62
void setReachable() const
Set any object value as reachable (for the GC)
Definition: as_value.cpp:691
T::value_type * ensure(const fn_call &fn)
Templated function to check the validity of a function call.
Definition: fn_call.h:299
value_type * operator()(const as_object *o) const
Definition: fn_call.h:264
std::string typeName(const T &inst)
Definition: utility.h:93
T value_type
Definition: fn_call.h:251
VM & getVM() const
Return the VM this fn_call is running from.
Definition: fn_call.h:184
movie_root & getRoot(const as_environment &env)
Definition: as_environment.cpp:645
This class represents the 'Stage' and top-level movie.
Definition: movie_root.h:150
Args::size_type nargs
Number of arguments to this ActionScript function call.
Definition: fn_call.h:178