19 #ifndef GNASH_AS_METHOD_H
20 #define GNASH_AS_METHOD_H
74 _maxRegisters = maxRegisters;
109 _traits.push_back(t);
121 bool hasBody()
const {
return _body != NULL; }
129 return _needsActivation;
133 _needsActivation =
true;
155 std::uint32_t slotID,
Method *method);
182 bool isFinal()
const {
return _flags & FLAGS_FINAL; }
194 bool isPrivate()
const {
return _flags & FLAGS_PRIVATE; }
199 _flags = (_flags & ~(FLAGS_PUBLIC | FLAGS_PROTECTED)) | FLAGS_PRIVATE;
205 return _flags & FLAGS_PROTECTED;
211 _flags = (_flags & ~(FLAGS_PUBLIC | FLAGS_PRIVATE)) | FLAGS_PROTECTED; }
214 bool isPublic()
const {
return _flags & FLAGS_PUBLIC; }
218 _flags = (_flags & ~(FLAGS_PRIVATE | FLAGS_PROTECTED)) | FLAGS_PUBLIC;
266 FLAGS_PROTECTED = 0x02,
272 typedef std::map<string_table::key, asBinding> BindingContainer;
276 std::vector<Trait> _traits;
278 std::uint32_t _methodID;
280 abc_function* _prototype;
283 std::uint32_t _bodyLength;
285 ArgumentList _arguments;
286 std::list<as_value> _optionalArguments;
288 unsigned char _flags;
290 std::uint32_t _maxRegisters;
292 std::uint32_t _scopeDepth;
293 std::uint32_t _maxScope;
294 std::uint32_t _maxStack;
296 bool _needsActivation;
void setFinal()
Set the method as final.
Definition: Method.h:186
bool addSetter(string_table::key name, Namespace *ns, Method *method)
Definition: Method.cpp:142
bool addSlotFunction(string_table::key name, Namespace *ns, std::uint32_t slotID, Method *method)
Definition: Method.cpp:180
The ActionScript bytecode of a single ABC tag in a SWF.
Definition: AbcBlock.h:208
Class describing a static property.
Definition: AbcBlock.h:71
CodeStream * getBody()
Definition: Method.h:136
as_function * getImplementation()
Get an object capable of executing this function. Note: This may be NULL, because we might have infor...
Definition: Method.h:255
void setReturnType(Class *t)
Set the return type.
Definition: Method.cpp:89
bool isNative()
Definition: Method.h:120
bool addSlot(string_table::key name, Namespace *ns, std::uint32_t slotID, Class *type)
Definition: Method.cpp:169
bool addGetter(string_table::key name, Namespace *ns, Method *method)
Definition: Method.cpp:122
void pushArgument(Class *t)
Push an argument of type t into the method definition.
Definition: Method.h:236
SWFStream & s
Definition: DefineBitsTag.cpp:71
ActionScript value type.
Definition: as_value.h:95
An abstract property.
Definition: Property.h:276
void setMaxStack(std::uint32_t max)
Definition: Method.h:81
bool isPrivate() const
Is the method private?
Definition: Method.h:194
void initPrototype(Machine *machine)
Definition: Method.cpp:190
void setMaxArgumentCount(int i)
Set the required maximum arguments.
Definition: Method.h:231
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:40
void setMaxScope(std::uint32_t max)
Definition: Method.h:89
bool optionalArguments() const
Are any of the arguments optional?
Definition: Method.h:242
void setMaxRegisters(std::uint32_t maxRegisters)
Definition: Method.h:73
abc_function * getPrototype()
Definition: Method.h:105
type
Definition: GnashKey.h:329
std::uint32_t methodID() const
Definition: Method.h:61
Represent an ActionScript Namespace.
Definition: Namespace.h:48
void setScopeDepth(std::uint32_t depth)
Definition: Method.h:97
void setPrivate()
Make the method private.
Definition: Method.h:198
The base class for all ActionScript objects.
Definition: as_object.h:161
void setBody(CodeStream *b)
Definition: Method.h:137
void print_body()
Print the opcodes that define a method using log_parse.
Definition: Method.cpp:56
std::uint32_t scopeDepth() const
Definition: Method.h:101
Definition: CodeStream.h:40
void setOwner(Class *s)
Set the owner of this method.
Definition: Method.cpp:72
bool addValue(string_table::key name, Namespace *ns, std::uint32_t slotID, Class *type, as_value &val, bool isconst)
Definition: Method.cpp:95
void setMinArgumentCount(int i)
Set the required minimum arguments.
Definition: Method.h:225
Definition: GnashKey.h:166
as_object * construct(as_object *)
Definition: Method.h:123
void setNeedsActivation()
Definition: Method.h:132
A class to represent AS3 Classes.
Definition: Class.h:75
Class * getReturnType() const
Get the unique identifier for the return type. 0 is 'anything'. (This is the value of any dynamic pro...
Property asBinding
Definition: Method.h:48
void setMethodID(std::uint32_t m)
Definition: Method.h:65
Definition: klash_part.cpp:329
tuple v
Definition: test.py:11
void setProtected()
Make the method protected.
Definition: Method.h:210
Definition: GnashKey.h:148
const ArgumentList & getArgumentList() const
Get a reference to a list of argument types.
Definition: Method.h:249
void pushOptional(const as_value &v)
Push an optional argument's default value.
Definition: Method.h:239
void setBodyLength(std::uint32_t length)
Definition: Method.h:79
The virtual machine for executing ABC (ActionScript Bytecode).
Definition: Machine.h:73
asBinding * getBinding(string_table::key name)
std::uint32_t maxStack() const
Definition: Method.h:85
bool isFinal() const
Is the method final? If so, it may not be overridden.
Definition: Method.h:182
std::uint32_t getMaxRegisters()
Definition: Method.h:71
void unsetFinal()
Unset the method as final. Not final anymore.
Definition: Method.h:190
bool hasBody() const
Definition: Method.h:121
void initTraits(AbcBlock &bl)
Initialize Traits. This is bogus.
Definition: Method.cpp:82
Definition: GnashKey.h:155
std::list< Class * > ArgumentList
Definition: Method.h:57
int maxArgumentCount() const
How many arguments are allowed? -1 means unknown.
Definition: Method.h:228
bool addMethod(string_table::key name, Namespace *ns, Method *method)
Definition: Method.cpp:196
Definition: GnashKey.h:159
std::uint32_t getBodyLength()
Definition: Method.h:77
bool needsActivation() const
Definition: Method.h:128
ABC-defined Function.
Definition: abc_function.h:40
int minArgumentCount() const
How many arguments are required? -1 means unknown.
Definition: Method.h:222
bool addMemberScript(string_table::key name, Namespace *ns, std::uint32_t slotID, Class *type)
Definition: Method.cpp:162
Method()
Definition: Method.cpp:36
std::size_t key
Definition: string_table.h:83
std::string name
Definition: LocalConnection_as.cpp:149
void addTrait(const Trait &t)
Add a Trait to this Method.
Definition: Method.h:108
ActionScript Function, either builtin or SWF-defined.
Definition: as_function.h:62
void setPublic()
Make the method public.
Definition: Method.h:217
bool isProtected() const
Is the method protected?
Definition: Method.h:204
std::uint32_t maxScope() const
Definition: Method.h:93
bool isPublic() const
Is the method public?
Definition: Method.h:214