Public Types | Public Member Functions | Friends

gnash::abc::AbcBlock Class Reference

The ActionScript bytecode of a single ABC tag in a SWF. More...

#include <AbcBlock.h>

Collaboration diagram for gnash::abc::AbcBlock:
Collaboration graph
[legend]

List of all members.

Public Types

enum  NamespaceConstant {
  PRIVATE_NS = 0x05, CONSTANT_NS = 0x08, PACKAGE_NS = 0x16, PACKAGE_INTERNAL_NS = 0x17,
  PROTECTED_NS = 0x18, EXPLICIT_NS = 0x19, STATIC_PROTECTED_NS = 0x1A
}
enum  MethodConstant {
  METHOD_ARGS = 0x01, METHOD_ACTIVATION = 0x02, METHOD_MORE = 0x04, METHOD_OPTIONAL_ARGS = 0x08,
  METHOD_IGNORE = 0x10, METHOD_NATIVE = 0x20, METHOD_DEFAULT_NS = 0x40, METHOD_ARG_NAMES = 0x80
}
enum  InstanceConstant {
  INSTANCE_SEALED = 0x01, INSTANCE_FINAL = 0x02, INSTANCE_INTERFACE = 0x04, INSTANCE_DYNAMIC = 0x00,
  INSTANCE_PROTECTED_NS = 0x08
}
enum  PoolConstant {
  POOL_STRING = 0x01, POOL_INTEGER = 0x03, POOL_UINTEGER = 0x04, POOL_DOUBLE = 0x06,
  POOL_NAMESPACE = 0x08, POOL_FALSE = 0x0A, POOL_TRUE = 0x0B, POOL_NULL = 0x0C
}
typedef std::vector< Namespace * > NamespaceSet

Public Member Functions

 AbcBlock ()
abc::ClasslocateClass (MultiName &m)
abc::ClasslocateClass (const std::string &className)
bool read (SWFStream &in)
void update_global_name (unsigned int multiname_index)
const std::vector< abc::Class * > & scripts () const
 Scripts can contain several classes.
boost::uint32_t uIntegerPoolAt (size_t i) const
const std::string & stringPoolAt (size_t i) const
boost::int32_t integerPoolAt (size_t i) const
double doublePoolAt (size_t i) const
MethodmethodPoolAt (size_t i) const
MultiName multinamePoolAt (size_t i) const
abc::ClassclassPoolAt (size_t i) const
NamespacenamespacePoolAt (size_t i) const
void prepare (Machine *mach)

Friends

class abc::Trait

Detailed Description

The ActionScript bytecode of a single ABC tag in a SWF.

ABC blocks have their own "names" for all resources. In Gnash, these are a string table index. They are different from global names. These are used to locate resources inside the ABC block. ABC blocks have a set of "namespace" resources. Some namespaces are private. We make these into anonymous namespaces. We assume all non-private namespaces are public. Some are "package" namespaces; these seem to coincide with the built-in packages or 0, the global namespace.

We always search for these public namespaces by global URI in our ClassHierarchy. If we use ABC names, "flash.text" will not find the built-in flash.text namespace. Using the global name means that we 'import' the built-in namespace into our own resources. Instances / Scriptes Likewise, classes are always given a global name, not an ABC name. This is because they become globally available, including (we assume) to other ABC blocks, so using an ABC name means they cannot be located externally. Even if ABC block resources should not be available to other blocks (which seems unlikely), using an ABC name for classes risks name conflicts with the built-in classes already in a namespace: ABC names and global names can have the same index even when the names are different. Class lookup This is particularly important for locateClass (called by instantiateScript from SymbolScript tag execution). The SymbolScript tag identifies a class using a global name, which may be qualified with a namespace. If it is not qualified, we look in the global namespace 0. When we call locateClass, we use global names, not ABC names, because classes are identified by global names (see above). However, we still look only in the ABC block's namespaces. The block's first namespace is always the global namespace; other package namespaces are imported according to the block's namespace constants.


Member Typedef Documentation


Member Enumeration Documentation

Enumerator:
INSTANCE_SEALED 
INSTANCE_FINAL 
INSTANCE_INTERFACE 
INSTANCE_DYNAMIC 
INSTANCE_PROTECTED_NS 
Enumerator:
METHOD_ARGS 
METHOD_ACTIVATION 
METHOD_MORE 
METHOD_OPTIONAL_ARGS 
METHOD_IGNORE 
METHOD_NATIVE 
METHOD_DEFAULT_NS 
METHOD_ARG_NAMES 
Enumerator:
PRIVATE_NS 
CONSTANT_NS 
PACKAGE_NS 
PACKAGE_INTERNAL_NS 
PROTECTED_NS 
EXPLICIT_NS 
STATIC_PROTECTED_NS 
Enumerator:
POOL_STRING 
POOL_INTEGER 
POOL_UINTEGER 
POOL_DOUBLE 
POOL_NAMESPACE 
POOL_FALSE 
POOL_TRUE 
POOL_NULL 

Constructor & Destructor Documentation

gnash::abc::AbcBlock::AbcBlock (  ) 

Member Function Documentation

abc::Class* gnash::abc::AbcBlock::classPoolAt ( size_t  i  )  const [inline]
double gnash::abc::AbcBlock::doublePoolAt ( size_t  i  )  const [inline]
boost::int32_t gnash::abc::AbcBlock::integerPoolAt ( size_t  i  )  const [inline]
abc::Class * gnash::abc::AbcBlock::locateClass ( MultiName m  ) 
abc::Class * gnash::abc::AbcBlock::locateClass ( const std::string &  className  ) 
Method* gnash::abc::AbcBlock::methodPoolAt ( size_t  i  )  const [inline]
MultiName gnash::abc::AbcBlock::multinamePoolAt ( size_t  i  )  const [inline]
Namespace* gnash::abc::AbcBlock::namespacePoolAt ( size_t  i  )  const [inline]
void gnash::abc::AbcBlock::prepare ( Machine mach  ) 
bool gnash::abc::AbcBlock::read ( SWFStream in  ) 
const std::vector<abc::Class*>& gnash::abc::AbcBlock::scripts (  )  const [inline]

Scripts can contain several classes.

TODO: why on earth are Scripts implemented using Classes?

const std::string& gnash::abc::AbcBlock::stringPoolAt ( size_t  i  )  const [inline]
boost::uint32_t gnash::abc::AbcBlock::uIntegerPoolAt ( size_t  i  )  const [inline]
void gnash::abc::AbcBlock::update_global_name ( unsigned int  multiname_index  ) 

Friends And Related Function Documentation

friend class abc::Trait [friend]

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