Gnash  0.8.11dev
as_object.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
3 // Free Software Foundation, Inc
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 
19 #ifndef GNASH_AS_OBJECT_H
20 #define GNASH_AS_OBJECT_H
21 
22 #ifdef HAVE_CONFIG_H
23 #include "gnashconfig.h"
24 #endif
25 
26 #include <map>
27 #include <vector>
28 #include <cmath>
29 #include <utility>
30 #include <memory>
31 #include <boost/noncopyable.hpp>
32 
33 #include "GC.h" // for inheritance from GcResource (to complete)
34 #include "PropertyList.h"
35 #include "PropFlags.h"
36 #include "Relay.h"
37 #include "ObjectURI.h"
38 #include "dsodefs.h" // for DSOTEXPORT
39 
40 // Forward declarations
41 namespace gnash {
42  class as_function;
43  class MovieClip;
44  class DisplayObject;
45  class as_environment;
46  class VM;
47  class IOChannel;
48  class movie_root;
49  class RunResources;
50  class Global_as;
51  class as_value;
52  class string_table;
53 }
54 
55 namespace gnash {
56 
57 
59 class Trigger
60 {
61 public:
62 
63  Trigger(std::string propname, as_function& trig,
64  as_value customArg)
65  :
66  _propname(std::move(propname)),
67  _func(&trig),
68  _customArg(std::move(customArg)),
69  _executing(false),
70  _dead(false)
71  {}
72 
74  //
84  as_value call(const as_value& oldval, const as_value& newval,
85  as_object& this_obj);
86 
88  bool dead() const { return _dead; }
89 
90  void kill() {
91  _dead = true;
92  }
93 
94  void setReachable() const;
95 
96 private:
97 
99  //
105  std::string _propname;
106 
108  as_function* _func;
109 
112  as_value _customArg;
113 
115  bool _executing;
116 
118  //
122  bool _dead;
123 
124 };
125 
127 //
132 //
134 //
139 //
142 //
144 //
146 //
152 //
155 //
157 //
161 class DSOEXPORT as_object : public GcResource, boost::noncopyable
162 {
163 
164 public:
165 
167  //
171  explicit DSOTEXPORT as_object(const Global_as& global);
172 
174  virtual ~as_object() {}
175 
177  //
181  virtual as_value call(const fn_call& fn);
182 
184  //
187  virtual std::string stringValue() const;
188 
190  //
192  static const int DefaultFlags = PropFlags::dontDelete |
194 
196  //
202  Property* findProperty(const ObjectURI& uri, as_object** owner = nullptr);
203 
205  VM& vm() const {
206  return _vm;
207  }
208 
210  //
214  //
216  void dump_members();
217 
219  //
228  virtual bool set_member(const ObjectURI& uri, const as_value& val,
229  bool ifFound = false);
230 
232  //
236  //
241  void init_member(const std::string& name, const as_value& val,
242  int flags = DefaultFlags);
243 
245  //
253  //
259  void init_member(const ObjectURI& uri, const as_value& val,
260  int flags = DefaultFlags);
261 
263  //
283  void init_property(const std::string& key, as_function& getter,
284  as_function& setter, int flags = DefaultFlags);
285 
286 
288  //
301  void init_property(const std::string& key, as_c_function_ptr getter,
302  as_c_function_ptr setter, int flags = DefaultFlags);
303 
305  //
309  //
317  void init_property(const ObjectURI& uri, as_function& getter,
318  as_function& setter, int flags = DefaultFlags);
319 
321  //
333  void init_property(const ObjectURI& uri, as_c_function_ptr getter,
334  as_c_function_ptr setter, int flags = DefaultFlags);
335 
337  //
342  //
347  bool init_destructive_property(const ObjectURI& uri, as_function& getter,
348  int flags = PropFlags::dontEnum);
349 
351  //
356  //
361  bool init_destructive_property(const ObjectURI& uri,
362  as_c_function_ptr getter, int flags = PropFlags::dontEnum);
363 
365  //
370  //
373  //
377  void init_readonly_property(const std::string& key, as_function& getter,
378  int flags = DefaultFlags);
379 
381  //
393  void init_readonly_property(const std::string& key,
394  as_c_function_ptr getter, int flags = DefaultFlags);
395 
397  //
406  bool watch(const ObjectURI& uri, as_function& trig, const as_value& cust);
407 
409  //
413  bool unwatch(const ObjectURI& uri);
414 
416  //
418  //
421  //
427  virtual bool get_member(const ObjectURI& uri, as_value* val);
428 
435  virtual as_object* get_super(const ObjectURI& fname);
436  as_object* get_super();
437 
439  //
441  //
450  DSOTEXPORT std::pair<bool, bool> delProperty(const ObjectURI& uri);
451 
453  //
455  //
460 
462  //
468  void set_member_flags(const ObjectURI& uri, int setTrue, int setFalse = 0);
469 
471  virtual as_function* to_function() { return nullptr; }
472 
474  virtual bool isSuper() const { return false; }
475 
477  //
483  //
486  void addInterface(as_object* ctor);
487 
489  //
493  //
497  //
503  bool instanceOf(as_object* ctor);
504 
506  //
508  //
512  bool prototypeOf(as_object& instance);
513 
515  //
520  //
523  void setPropFlags(const as_value& props, int set_false, int set_true);
524 
526  //
528  //
530  void copyProperties(const as_object& o);
531 
534  _members.clear();
535  }
536 
538  //
542  //
546  template<typename T>
547  void visitProperties(PropertyVisitor& visitor) const {
548  _members.visitValues<T>(visitor);
549  }
550 
552  //
555  //
560  //
563  void visitKeys(KeyVisitor& visitor) const;
564 
566  //
573  void add_property(const std::string& key, as_function& getter,
574  as_function* setter);
575 
577  //
582  as_object* get_prototype() const;
583 
585  //
588  void set_prototype(const as_value& proto);
589 
591  //
595  //
600  //
604  void setRelay(Relay* p) {
605  if (p) _array = false;
606  if (_relay) _relay->clean();
607  _relay.reset(p);
608  }
609 
611  //
616  //
620  Relay* relay() const {
621  return _relay.get();
622  }
623 
625  bool array() const {
626  return _array;
627  }
628 
630  void setArray(bool array = true) {
631  _array = array;
632  }
633 
635  //
639  return _displayObject;
640  }
641 
644  _displayObject = d;
645  }
646 
647 protected:
648 
650  //
659  explicit as_object(VM& vm);
660 
662  //
668  virtual void markReachableResources() const;
669 
670 private:
671 
673  //
675  //
683  Property* findUpdatableProperty(const ObjectURI& uri);
684 
685  void executeTriggers(Property* prop, const ObjectURI& uri,
686  const as_value& val);
687 
689  template<typename T> class PrototypeRecursor;
690 
692  //
695  DisplayObject* _displayObject;
696 
698  //
704  bool _array;
705 
707  //
710  std::unique_ptr<Relay> _relay;
711 
713  VM& _vm;
714 
716  PropertyList _members;
717 
719  //
722  std::vector<as_object*> _interfaces;
723 
724  typedef std::map<ObjectURI, Trigger, ObjectURI::LessThan> TriggerContainer;
725  std::unique_ptr<TriggerContainer> _trigs;
726 };
727 
729 //
733 //
735 //
740 void sendEvent(as_object& o, const as_environment& env, const ObjectURI& name);
741 
743 //
746 //
748 //
749 //
755 inline as_value
757 {
758  as_value ret;
759  o.get_member(uri, &ret);
760  return ret;
761 }
762 
764 //
767 //
770 //
776 inline as_value
778 {
779  Property* p = o.getOwnProperty(uri);
780  return p ? p->getValue(o) : as_value();
781 }
782 
785 {
786 public:
787  IsVisible(int version) : _version(version) {}
788  bool operator()(const Property& prop) const {
789  return visible(prop, _version);
790  }
791 private:
792  const int _version;
793 };
794 
795 class Exists
796 {
797 public:
798  Exists() {}
799  bool operator()(const Property&) const {
800  return true;
801  }
802 };
803 
805 {
806 public:
808  bool operator()(const Property& p) const {
809  return !p.getFlags().test<PropFlags::dontEnum>();
810  }
811 };
812 
814 //
819 //
823 std::string getURLEncodedVars(as_object& o);
824 
826 //
832 as_object* getPathElement(as_object& o, const ObjectURI& uri);
833 
834 
836 //
840 template<typename T>
841 T*
843 {
844  if (!o) return nullptr;
845  return dynamic_cast<T*>(o->displayObject());
846 }
847 
849 //
853 inline bool
855 {
856  return (o.getOwnProperty(uri));
857 }
858 
859 DSOTEXPORT as_object* getObjectWithPrototype(Global_as& gl, const ObjectURI& c);
860 
862 //
866 //
873 template<typename T>
874 bool
875 isNativeType(const as_object* obj, T*& relay)
876 {
877  if (!obj) return false;
878  relay = dynamic_cast<T*>(obj->relay());
879  return relay;
880 }
881 
883 //
887 typedef std::vector<std::pair<ObjectURI, as_value> > SortedPropertyList;
888 
890 //
893 //
897 //
900 //
904 
906 DSOTEXPORT VM& getVM(const as_object& o);
907 
910 
913 
915 const RunResources& getRunResources(const as_object& o);
916 
918 int getSWFVersion(const as_object& o);
919 
922 
924 inline bool caseless(const as_object& o) {
925  return getSWFVersion(o) < 7;
926 }
927 
928 } // namespace gnash
929 
930 #endif // GNASH_AS_OBJECT_H
gnash::isNativeType
bool isNativeType(const as_object *obj, T *&relay)
Check whether the object is an instance of a known type.
Definition: as_object.h:875
gnash::PropertyList::getProperty
DSOTEXPORT Property * getProperty(const ObjectURI &uri) const
Get a property if it exists.
Definition: PropertyList.cpp:139
gnash::key::l
@ l
Definition: GnashKey.h:158
gnash::GcResource
Collectable resource.
Definition: GC.h:75
gnash::Trigger::call
as_value call(const as_value &oldval, const as_value &newval, as_object &this_obj)
Call the trigger.
Definition: as_object.cpp:1039
movie_root.h
gnash::as_object::visitKeys
void visitKeys(KeyVisitor &visitor) const
Visit all visible property identifiers.
Definition: as_object.cpp:904
gnash::NSV::PROP_uuRESOLVE
@ PROP_uuRESOLVE
Definition: namedStrings.h:119
gnash::as_object::set_member_flags
void set_member_flags(const ObjectURI &uri, int setTrue, int setFalse=0)
Set member flags (probably used by ASSetPropFlags)
Definition: as_object.cpp:753
name
std::string name
Definition: LocalConnection_as.cpp:149
gnash::Property::setCache
void setCache(const as_value &v)
Set internal cached value of this property.
Definition: Property.cpp:172
gnash::as_object::visitProperties
void visitProperties(PropertyVisitor &visitor) const
Visit the properties of this object by key/as_value pairs.
Definition: as_object.h:547
gnash::visible
bool visible(const Property &prop, int version)
Is this member supposed to be visible by a VM of given version ?
Definition: Property.h:423
gnash::key::d
@ d
Definition: GnashKey.h:150
gnash::PropertyVisitor
An abstract property visitor.
Definition: PropertyList.h:49
_object
as_object * _object
Definition: Array_as.cpp:680
gnash::as_object
The base class for all ActionScript objects.
Definition: as_object.h:162
gnash::PropertyList::visitKeys
void visitKeys(KeyVisitor &v, PropertyTracker &donelist) const
Enumerate all non-hidden properties to the given container.
Definition: PropertyList.cpp:172
as_object.h
gnash::GnashException
Top-level gnash exception.
Definition: GnashException.h:31
gnash::as_object::setRelay
void setRelay(Relay *p)
Set the as_object's Relay object.
Definition: as_object.h:604
ObjectURI.h
gnash::as_object::as_object
DSOTEXPORT as_object(const Global_as &global)
Construct an ActionScript object with no prototype associated.
Definition: as_object.cpp:280
gnash::getOwnProperty
as_value getOwnProperty(as_object &o, const ObjectURI &uri)
Get an own member of an object.
Definition: as_object.h:777
gnash::toObject
as_object * toObject(const as_value &v, VM &vm)
Convert an as_value to an object.
Definition: VM.cpp:457
gnash::key::T
@ T
Definition: GnashKey.h:132
gnash::getName
string_table::key getName(const ObjectURI &o)
Get the name element of an ObjectURI.
Definition: ObjectURI.h:116
gnash::PropertyList::setFlagsAll
void setFlagsAll(int setTrue, int setFalse)
Set the flags of all properties.
Definition: PropertyList.cpp:129
gnash::string_table
A general use string table.
Definition: string_table.h:42
gnash::as_value::is_null
bool is_null() const
Definition: as_value.h:340
gnash::string_table::value
const std::string & value(key to_find) const
Find a string by its key.
Definition: string_table.h:102
dsodefs.h
gnash::as_object::isSuper
virtual bool isSuper() const
Return true if this is a 'super' object.
Definition: as_object.h:474
gnash::as_object::dump_members
void dump_members()
Dump all properties using log_debug.
Definition: as_object.cpp:852
gnash::log_debug
void log_debug(StringType msg, Args... args)
Definition: log.h:301
gnash::key::i
@ i
Definition: GnashKey.h:155
gnash::getPathElement
as_object * getPathElement(as_object &o, const ObjectURI &uri)
Resolve the given relative path component.
Definition: as_object.cpp:1089
gnash::as_object::set_prototype
void set_prototype(const as_value &proto)
Set this object's proto member.
Definition: as_object.cpp:518
gnash::Exists::Exists
Exists()
Definition: as_object.h:798
_
#define _(String)
Definition: log.h:44
gnash::as_environment
Provides information about timeline context.
Definition: as_environment.h:51
gnash::as_object::instanceOf
bool instanceOf(as_object *ctor)
Check whether this object is an instance of the given constructor.
Definition: as_object.cpp:769
gnash::as_object::init_member
void init_member(const std::string &name, const as_value &val, int flags=DefaultFlags)
Initialize a member value by string.
Definition: as_object.cpp:669
gnash::VM
The AVM1 virtual machine.
Definition: VM.h:72
gnash::as_object::prototypeOf
bool prototypeOf(as_object &instance)
Check whether this object is in another object's inheritance chain.
Definition: as_object.cpp:831
gnash::as_object::to_function
virtual as_function * to_function()
Cast to a as_function, or return NULL.
Definition: as_object.h:471
gnash::as_object::call
virtual as_value call(const fn_call &fn)
Function dispatch.
Definition: as_object.cpp:301
gnash
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:41
gnash::Exists::operator()
bool operator()(const Property &) const
Definition: as_object.h:799
gnash::as_object::unwatch
bool unwatch(const ObjectURI &uri)
Remove a watch trigger.
Definition: as_object.cpp:990
PropertyList.h
gnash::PropFlags::dontEnum
@ dontEnum
Protect from enumeration.
Definition: PropFlags.h:36
gnash::PropFlags::dontDelete
@ dontDelete
Protect from deletion.
Definition: PropFlags.h:39
gnash::IsEnumerable::IsEnumerable
IsEnumerable()
Definition: as_object.h:807
second
std::int32_t second
Definition: Date_as.cpp:93
gnash::as_object::clearProperties
void clearProperties()
Drop all properties from this object.
Definition: as_object.h:533
Global_as.h
gnash::as_object::init_property
void init_property(const std::string &key, as_function &getter, as_function &setter, int flags=DefaultFlags)
Initialize a getter/setter property by name.
Definition: as_object.cpp:690
gnash::Trigger
A trigger that can be associated with a property name.
Definition: as_object.h:60
gnash::getGlobal
Global_as & getGlobal(const as_environment &env)
Definition: as_environment.cpp:651
gnash::MovieClip
A MovieClip is a container for DisplayObjects.
Definition: MovieClip.h:84
gnash::getVM
VM & getVM(const as_environment &env)
Definition: as_environment.h:222
as_function.h
gnash::log_error
void log_error(StringType msg, Args... args)
Definition: log.h:283
gnash::getMember
as_value getMember(as_object &o, const ObjectURI &uri)
Get a member of an object using AS lookup rules.
Definition: as_object.h:756
gnash::as_object::array
bool array() const
Return true if this object should be treated as an array.
Definition: as_object.h:625
gnash::as_object::init_destructive_property
bool init_destructive_property(const ObjectURI &uri, as_function &getter, int flags=PropFlags::dontEnum)
Initialize a destructive getter property.
Definition: as_object.cpp:720
event_id.h
gnash::createObject
as_object * createObject(const Global_as &gl)
Definition: Global_as.cpp:303
gnash::enumerateProperties
SortedPropertyList enumerateProperties(as_object &obj)
Enumerate all non-hidden properties to the passed container.
Definition: as_object.cpp:1069
gnash::SortedPropertyList
std::vector< std::pair< ObjectURI, as_value > > SortedPropertyList
This is used to hold an intermediate copy of an as_object's properties.
Definition: as_object.h:887
gnash::fn_call
Parameters/environment for builtin or user-defined functions callable from ActionScript.
Definition: fn_call.h:118
gnash::KeyVisitor
An abstract key visitor.
Definition: PropertyList.h:58
gnash::as_object::DefaultFlags
static const int DefaultFlags
The most common flags for built-in properties.
Definition: as_object.h:192
gnash::Trigger::Trigger
Trigger(std::string propname, as_function &trig, as_value customArg)
Definition: as_object.h:63
gnash::Property::isGetterSetter
bool isGetterSetter() const
Is this a getter/setter property?
Definition: Property.h:377
gnash::DisplayObject::visitNonProperties
virtual void visitNonProperties(KeyVisitor &) const
Enumerate any non-proper properties.
Definition: DisplayObject.h:247
gnash::IsEnumerable::operator()
bool operator()(const Property &p) const
Definition: as_object.h:808
gnash::setDisplayObjectProperty
bool setDisplayObjectProperty(DisplayObject &obj, const ObjectURI &uri, const as_value &val)
Set special properties.
Definition: DisplayObject.cpp:961
gnash::NSV::PROP_uuCONSTRUCTORuu
@ PROP_uuCONSTRUCTORuu
Definition: namedStrings.h:117
gnash::fn_call::Args
FunctionArgs< as_value > Args
Definition: fn_call.h:121
gnash::renderer::opengl::for_each
void for_each(C &container, R(T::*pmf)(const A &), const A &arg)
Definition: Renderer_ogl.cpp:690
gnash::Relay
This is the base class for type-specific object data.
Definition: Relay.h:50
gnash::URL::encode
static void encode(std::string &str)
Encode a string to URL-encoded format converting all dodgy characters to AB hex sequences.
Definition: URL.cpp:391
gnash::getRunResources
const RunResources & getRunResources(const as_object &o)
Get the RunResources from an as_object.
Definition: as_object.cpp:1142
gnash::MovieClip::setTextFieldVariables
bool setTextFieldVariables(const ObjectURI &uri, const as_value &val)
TODO: this is also unlikely to be the best way to do it.
Definition: MovieClip.cpp:834
gnash::invoke
DSOEXPORT as_value invoke(const as_value &method, const as_environment &env, as_object *this_ptr, fn_call::Args &args, as_object *super=nullptr, const movie_definition *callerDef=nullptr)
Call an as_value on an as_object.
Definition: Global_as.h:166
Property.h
gnash::ActionTypeError
An ActionScript type error.
Definition: GnashException.h:161
gnash::as_value::to_string
DSOTEXPORT std::string to_string(int version=7) const
Get a std::string representation for this value.
Definition: as_value.cpp:205
GnashAlgorithm.h
gnash::FunctionArgs
A class to contain transferable arguments for a fn_call.
Definition: fn_call.h:57
IF_VERBOSE_ASCODING_ERRORS
#define IF_VERBOSE_ASCODING_ERRORS(x)
Definition: log.h:397
gnash::Trigger::kill
void kill()
Definition: as_object.h:90
gnash::get
T * get(as_object *o)
Extract the DisplayObject attached to an object.
Definition: as_object.h:842
gnash::as_object::~as_object
virtual ~as_object()
The as_object dtor does nothing special.
Definition: as_object.h:174
gnash::as_object::stringValue
virtual std::string stringValue() const
Return the string representation for this object.
Definition: as_object.cpp:307
gnash::ObjectURI::empty
bool empty() const
Definition: ObjectURI.h:76
gnash::Property
An abstract property.
Definition: Property.h:277
gnash::as_object::get_member
virtual bool get_member(const ObjectURI &uri, as_value *val)
Get a property by name if it exists.
Definition: as_object.cpp:378
gnash::IsVisible::operator()
bool operator()(const Property &prop) const
Definition: as_object.h:788
gnash::Trigger::dead
bool dead() const
True if this Trigger has been disposed of.
Definition: as_object.h:88
gnash::as_object::setPropFlags
void setPropFlags(const as_value &props, int set_false, int set_true)
Set property flags.
Definition: as_object.cpp:860
gnash::as_object::displayObject
DisplayObject * displayObject() const
Return the DisplayObject associated with this object.
Definition: as_object.h:638
gnash::Property::getValue
DSOTEXPORT as_value getValue(const as_object &this_ptr) const
Get value of this property.
Definition: Property.cpp:98
gnash::as_object::copyProperties
void copyProperties(const as_object &o)
Copy properties from the given object.
Definition: as_object.cpp:895
gnash::IsEnumerable
Definition: as_object.h:805
gnash::key::p
@ p
Definition: GnashKey.h:162
gnash::PropertyList::dump
void dump()
Dump all members (using log_debug)
Definition: PropertyList.cpp:189
gnash::PropertyList::delProperty
DSOTEXPORT std::pair< bool, bool > delProperty(const ObjectURI &uri)
Delete a Property, if existing and not protected from deletion.
Definition: PropertyList.cpp:154
gnash::key::_1
@ _1
Definition: GnashKey.h:95
gnash::PropertyList::setReachable
void setReachable() const
Mark all properties reachable.
Definition: PropertyList.h:295
gnash::RunResources
Class to group together per-run and external resources for Gnash.
Definition: RunResources.h:54
gnash::as_value
ActionScript value type.
Definition: as_value.h:95
gnash::as_c_function_ptr
as_value(* as_c_function_ptr)(const fn_call &fn)
Definition: Property.h:34
gnash::as_object::get_super
as_object * get_super()
Definition: as_object.cpp:467
VM.h
gnash::as_object::findProperty
Property * findProperty(const ObjectURI &uri, as_object **owner=nullptr)
Find a property, scanning the inheritance chain.
Definition: as_object.cpp:477
gnash::getDisplayObjectProperty
bool getDisplayObjectProperty(DisplayObject &obj, const ObjectURI &uri, as_value &val)
DisplayObject property lookup.
Definition: DisplayObject.cpp:897
gnash::as_object::init_readonly_property
void init_readonly_property(const std::string &key, as_function &getter, int flags=DefaultFlags)
Use this method for read-only properties.
Definition: as_object.cpp:734
gnash::as_function::call
virtual as_value call(const fn_call &fn)=0
Function dispatch.
gnash::ObjectURI::Logger
Definition: ObjectURI.h:164
gnash::as_object::vm
VM & vm() const
Return a reference to this as_object's global object.
Definition: as_object.h:205
gnash::log_aserror
void log_aserror(StringType msg, Args... args)
Definition: log.h:331
DisplayObject.h
Relay.h
log.h
gnash::getRoot
movie_root & getRoot(const as_environment &env)
Definition: as_environment.cpp:645
gnash::as_value::setReachable
void setReachable() const
Set any object value as reachable (for the GC)
Definition: as_value.cpp:691
gnash::as_object::relay
Relay * relay() const
Access the as_object's Relay object.
Definition: as_object.h:620
fn_call.h
gnash::as_object::delProperty
DSOTEXPORT std::pair< bool, bool > delProperty(const ObjectURI &uri)
Delete a property of this object, unless protected from deletion.
Definition: as_object.cpp:313
gnash::as_object::get_prototype
as_object * get_prototype() const
Return this object's proto member.
Definition: as_object.cpp:932
gnash::Property::clearVisible
void clearVisible(int swfVersion)
Clear visibility flags.
Definition: Property.h:382
gnash::PropertyList::setFlags
DSOTEXPORT void setFlags(const ObjectURI &uri, int setTrue, int setFalse)
Set the flags of a property.
Definition: PropertyList.cpp:118
gnash::EraseIf
void EraseIf(Container &c, Predicate p)
Erase elements from an associative container based on a predicate.
Definition: GnashAlgorithm.h:45
gnash::checkArrayLength
void checkArrayLength(as_object &array, const ObjectURI &uri, const as_value &val)
Genuine arrays handle the length property in a special way.
Definition: Array_as.cpp:920
gnash::as_object::watch
bool watch(const ObjectURI &uri, as_function &trig, const as_value &cust)
Add a watch trigger, overriding any other defined for same name.
Definition: as_object.cpp:972
as_environment.h
gnashconfig.h
gnash::movie_root
This class represents the 'Stage' and top-level movie.
Definition: movie_root.h:151
gnash::PropertyList::setValue
DSOTEXPORT bool setValue(const ObjectURI &uri, const as_value &value, const PropFlags &flagsIfMissing=0)
Set the value of a property, creating a new one if it doesn't exist.
Definition: PropertyList.cpp:94
DSOTEXPORT
#define DSOTEXPORT
Definition: dsodefs.h:63
namedStrings.h
gnash::Global_as
The Global object ultimately contains all objects in an ActionScript run.
Definition: Global_as.h:50
gnash::as_object::set_member
virtual bool set_member(const ObjectURI &uri, const as_value &val, bool ifFound=false)
Set a member value.
Definition: as_object.cpp:583
gnash::getSWFVersion
int getSWFVersion(const as_environment &env)
Definition: as_environment.cpp:657
RunResources.h
test.uri
uri
Definition: test.py:12
PropFlags.h
gnash::key::c
@ c
Definition: GnashKey.h:149
gnash::Property::getCache
as_value getCache() const
Get internal cached value of this property.
Definition: Property.cpp:127
gnash::getStringTable
string_table & getStringTable(const as_environment &env)
Definition: as_environment.cpp:639
gnash::getObjectWithPrototype
as_object * getObjectWithPrototype(Global_as &gl, const ObjectURI &c)
Definition: as_object.cpp:1109
gnash::as_object::markReachableResources
virtual void markReachableResources() const
Mark all reachable resources, override from GcResource.
Definition: as_object.cpp:1011
DSOEXPORT
#define DSOEXPORT
Definition: dsodefs.h:55
gnash::NSV::PROP_uuPROTOuu
@ PROP_uuPROTOuu
Definition: namedStrings.h:118
gnash::getURI
ObjectURI getURI(const VM &vm, const std::string &str, bool lowerCaseHint=false)
Definition: VM.h:290
GC.h
gnash::PropertyList::addDestructiveGetter
bool addDestructiveGetter(const ObjectURI &uri, as_function &getter, const PropFlags &flagsIfMissing=0)
Add a destructive getter property, if not already existant.
Definition: PropertyList.cpp:265
gnash::DisplayObject
DisplayObject is the base class for all DisplayList objects.
Definition: DisplayObject.h:169
Array_as.h
gnash::IsVisible::IsVisible
IsVisible(int version)
Definition: as_object.h:787
gnash::hasOwnProperty
bool hasOwnProperty(as_object &o, const ObjectURI &uri)
Return true if this object has the named property.
Definition: as_object.h:854
gnash::PropertyList::addGetterSetter
bool addGetterSetter(const ObjectURI &uri, as_function &getter, as_function *setter, const as_value &cacheVal, const PropFlags &flagsIfMissing=0)
Add a getter/setter property, if not already existing.
Definition: PropertyList.cpp:198
gnash::as_object::addInterface
void addInterface(as_object *ctor)
Add an interface to the list of interfaces.
Definition: as_object.cpp:759
gnash::FunctionArgs::container_type
std::vector< T > container_type
Definition: fn_call.h:61
gnash::as_object::setDisplayObject
void setDisplayObject(DisplayObject *d)
Set the DisplayObject associated with this as_object.
Definition: as_object.h:643
gnash::IsVisible
Function objects for visiting properties.
Definition: as_object.h:785
gnash::caseless
bool caseless(const as_object &o)
Return whether property matching is caseless.
Definition: as_object.h:924
gnash::sendEvent
void sendEvent(as_object &o, const as_environment &env, const ObjectURI &name)
Send a system event.
Definition: as_object.cpp:1099
gnash::as_object::setArray
void setArray(bool array=true)
Set whether this object should be treated as an array.
Definition: as_object.h:630
gnash::Trigger::setReachable
void setReachable() const
Definition: as_object.cpp:1032
gnash::key::o
@ o
Definition: GnashKey.h:161
gnash::PropFlags::readOnly
@ readOnly
Protect from assigning a value.
Definition: PropFlags.h:42
gnash::PropertyList::PropertyTracker
std::set< ObjectURI, ObjectURI::LessThan > PropertyTracker
Definition: PropertyList.h:85
gnash::NSV::PROP_PROTOTYPE
@ PROP_PROTOTYPE
Definition: namedStrings.h:87
gnash::as_value::is_object
bool is_object() const
Return true if this value is an object.
Definition: as_value.h:219
gnash::ObjectURI
A URI for describing as_objects.
Definition: ObjectURI.h:45
GnashException.h
gnash::PropertyList
Set of properties associated with an ActionScript object.
Definition: PropertyList.h:82
gnash::PropertyList::size
size_t size() const
Return number of properties in this list.
Definition: PropertyList.h:281
test.v
v
Definition: test.py:11
data
SimpleBuffer data
Definition: LocalConnection_as.cpp:151
gnash::as_object::add_property
void add_property(const std::string &key, as_function &getter, as_function *setter)
Add a getter/setter property if no member already has that name.
Definition: as_object.cpp:320
gnash::key::e
@ e
Definition: GnashKey.h:151
gnash::readOnly
bool readOnly(const Property &prop)
is this a read-only member ?
Definition: Property.h:417
gnash::getURLEncodedVars
std::string getURLEncodedVars(as_object &o)
Get url-encoded variables.
Definition: as_object.cpp:946
gnash::Property::setValue
bool setValue(as_object &this_ptr, const as_value &value) const
Set value of this property.
Definition: Property.cpp:133
gnash::as_function
ActionScript Function, either builtin or SWF-defined.
Definition: as_function.h:63
gnash::GcResource::setReachable
void setReachable() const
Mark this resource as being reachable.
Definition: GC.h:92
gnash::Exists
Definition: as_object.h:796
gnash::as_object::getOwnProperty
Property * getOwnProperty(const ObjectURI &uri)
Get this object's own named property, if existing.
Definition: as_object.cpp:926