sswf::TagShape Class Reference

#include <libsswf.h>

Inheritance diagram for sswf::TagShape:

sswf::TagBaseID sswf::TagBase sswf::MemoryManager List of all members.

Public Types

 MORPH_MODE_BOTH_SHAPES = 2
 MORPH_MODE_SHAPE0 = 0
 MORPH_MODE_SHAPE1 = 1
enum  morph_t { MORPH_MODE_SHAPE0 = 0, MORPH_MODE_SHAPE1 = 1, MORPH_MODE_BOTH_SHAPES = 2 }

Public Member Functions

void AddEdge (morph_t morph_mode, const Edges::edge_t &edge)
void AddEdge (morph_t morph_mode, long x, long y, long ctrl_x, long ctrl_y)
void AddEdge (morph_t morph_mode, long x, long y)
void AddMove (morph_t morph_mode, long x, long y)
void AddStyle (const Style &style, int fill=0)
const SRectangleBounds (int index) const
void Glyph (void)
bool HasBounds (void) const
bool IsEmpty (void) const
bool IsGlyph (void) const
void NewStyles (void)
virtual ErrorManager::error_code_t Save (Data &data)
 Pre-save all the children tags of this tag.
ErrorManager::error_code_t SaveWithoutStyles (Data &data)
void SetBounds (int index, const SRectangle &rect, bool show=false)
void ShowBounds (bool show=true)
void ShowOrigin (bool show=true)
 TagShape (TagBase *parent)
virtual swf_type_t TypeFlags (void) const
 Retrieve a set of flags desribing the type of the tag.

Private Types

 SHAPE_EDGES
 SHAPE_SETUP
enum  what_t { SHAPE_EDGES, SHAPE_SETUP }

Private Member Functions

void NewEdges (void)
void NewSetup (void)
void RecordEdges (void)
void RecordSetup (void)
ErrorManager::error_code_t SaveMorph (Data &data)
ErrorManager::error_code_t SaveSetup (save_info_t &info, const shape_setup_t &setup, shape_setup_t &last)
ErrorManager::error_code_t SaveShape (save_info_t &info, shape_setup_t &last_setup)
ErrorManager::error_code_t SaveStyles (save_info_t &info)
ErrorManager::error_code_t SaveStylesCount (save_info_t &info, long count)
void SetMorph (void)

Private Attributes

SRectangle f_bounds [2]
shape_edges_tf_edges
Vectors f_fill_styles
bool f_is_glyph
Vectors f_line_styles
bool f_morph
shape_edges_tf_morph_edges
Vectors f_morph_record
Vectors f_record
shape_setup_tf_setup
Vectors f_shapes
bool f_show_bounds
bool f_show_origin
unsigned char f_version

Classes

struct  save_info_t
struct  shape_edges_t
struct  shape_record_t
struct  shape_setup_t
struct  shape_what_t

Member Enumeration Documentation

enum sswf::TagShape::morph_t

Enumerator:
MORPH_MODE_SHAPE0 
MORPH_MODE_SHAPE1 
MORPH_MODE_BOTH_SHAPES 

enum sswf::TagShape::what_t [private]

Enumerator:
SHAPE_EDGES 
SHAPE_SETUP 


Constructor & Destructor Documentation

TagShape::TagShape ( TagBase parent  ) 


Member Function Documentation

void TagShape::AddEdge ( morph_t  morph_mode,
const Edges::edge_t edge 
)

void sswf::TagShape::AddEdge ( morph_t  morph_mode,
long  x,
long  y,
long  ctrl_x,
long  ctrl_y 
) [inline]

void sswf::TagShape::AddEdge ( morph_t  morph_mode,
long  x,
long  y 
) [inline]

void TagShape::AddMove ( morph_t  morph_mode,
long  x,
long  y 
)

void TagShape::AddStyle ( const Style style,
int  fill = 0 
)

const SRectangle& sswf::TagShape::Bounds ( int  index  )  const [inline]

void TagShape::Glyph ( void   ) 

bool sswf::TagShape::HasBounds ( void   )  const [inline]

bool TagShape::IsEmpty ( void   )  const

bool TagShape::IsGlyph ( void   )  const

void TagShape::NewEdges ( void   )  [private]

void TagShape::NewSetup ( void   )  [private]

void TagShape::NewStyles ( void   ) 

void TagShape::RecordEdges ( void   )  [private]

void TagShape::RecordSetup ( void   )  [private]

ErrorManager::error_code_t TagShape::Save ( Data data  )  [virtual]

The Save() function is the one you want to call to save an SWF movie.

You may use the Save() on any tag, however, if you do so you need to properly initialize the system. For that purpose, you may want to look at the code in the TagHeader::Save(Data& data) function.

Otherwise, you simply have to call the Save() function of the TagHeader. That will save the entire movie with the smallest possible version (or fail if something cannot be saved with the present parameters.)

The TagHeader::Save() function first calls the PreSave() functions, the PreSave2ndPass() and then the Save() functions of all the children.

The other tag Save() function simply save the tag within the specified Data buffer. Note however that the TagSprite will also call the Save() function of all of its children. Yet it does not call the PreSave() functions.

The Save() function saves the movie in a Data buffer. Later you need to save that buffer on disk or some other medium.

Returns:
Zero when the Save() succeeds, non-zero if it fails
See also:
TagBase::PreSave()

TagBase::PreSave2ndPass()

Implements sswf::TagBase.

ErrorManager::error_code_t sswf::TagShape::SaveMorph ( Data data  )  [private]

ErrorManager::error_code_t TagShape::SaveSetup ( save_info_t info,
const shape_setup_t setup,
shape_setup_t last 
) [private]

ErrorManager::error_code_t TagShape::SaveShape ( save_info_t info,
shape_setup_t last_setup 
) [private]

ErrorManager::error_code_t TagShape::SaveStyles ( save_info_t info  )  [private]

ErrorManager::error_code_t TagShape::SaveStylesCount ( save_info_t info,
long  count 
) [private]

ErrorManager::error_code_t TagShape::SaveWithoutStyles ( Data data  ) 

void TagShape::SetBounds ( int  index,
const SRectangle rect,
bool  show = false 
)

void TagShape::SetMorph ( void   )  [private]

void sswf::TagShape::ShowBounds ( bool  show = true  )  [inline]

void sswf::TagShape::ShowOrigin ( bool  show = true  )  [inline]

TagBase::swf_type_t TagShape::TypeFlags ( void   )  const [virtual]

This function returns some flags that can be used to know where to place a tag in a movie, whether a tag is unique, etc.

If a tag has specifics which are not described here, it often can be checked using its name and special handling.

The existing flags are:

SWF_TYPE_DEFINE This is a definition tag (Sprite, Shape...)

SWF_TYPE_CONTROL This is a control tag (ShowFrame, PlaceObject...)

SWF_TYPE_UNIQUE This can be used once throughout the whole movie

SWF_TYPE_START This tag should be at the start of the movie

SWF_TYPE_ONE At most one per frame

SWF_TYPE_REFERENCE This tag references another

SWF_TYPE_HAS_ID This tag has an identifier

SWF_TYPE_SCRIPT This object can accept action scripts

SWF_TYPE_SPRITE This is a sprite (can include other tags)

SWF_TYPE_HEADER The header object

Note:
These flags are constant (actually hard coded!) and will not change between calls. They even rarely change between versions.
Returns:
The set of flags for the given tag
See also:
sswf::TagBase::Name(void) const

Implements sswf::TagBase.


Member Data Documentation

SRectangle sswf::TagShape::f_bounds[2] [private]

shape_edges_t* sswf::TagShape::f_edges [private]

Vectors sswf::TagShape::f_fill_styles [private]

bool sswf::TagShape::f_is_glyph [private]

Vectors sswf::TagShape::f_line_styles [private]

bool sswf::TagShape::f_morph [private]

shape_edges_t* sswf::TagShape::f_morph_edges [private]

Vectors sswf::TagShape::f_morph_record [private]

Vectors sswf::TagShape::f_record [private]

shape_setup_t* sswf::TagShape::f_setup [private]

Vectors sswf::TagShape::f_shapes [private]

bool sswf::TagShape::f_show_bounds [private]

bool sswf::TagShape::f_show_origin [private]

unsigned char sswf::TagShape::f_version [private]


The documentation for this class was generated from the following files:
Generated on Sun May 13 23:29:41 2007 for libsswf by  doxygen 1.4.7