sswf::TagText Class Reference

#include <libsswf.h>

Inheritance diagram for sswf::TagText:

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

Public Member Functions

void AddColor (Color &color)
void AddFont (const TagFont *font, long height)
void AddOffsets (long x, long y)
void AddText (const char *string, long advance=LONG_MIN)
virtual ErrorManager::error_code_t Save (Data &data)
 Pre-save all the children tags of this tag.
void SetBounds (const SRectangle &bounds)
void SetMatrix (const Matrix &matrix)
 TagText (TagBase *parent)
virtual swf_type_t TypeFlags (void) const
 Retrieve a set of flags desribing the type of the tag.

Private Types

 TEXT_ENTRY_SETUP
 TEXT_ENTRY_TEXT = 0
enum  text_type_t { TEXT_ENTRY_TEXT = 0, TEXT_ENTRY_SETUP }

Private Member Functions

int DefineText (int start, text_setup_t *s, const TagFont *font, int font_height)
void NewSetup (void)
virtual ErrorManager::error_code_t PreSave (void)
 Pre-save all the children tags of this tag.
void RecordSetup (void)

Private Attributes

SRectangle f_bounds
Matrix f_matrix
bool f_new_text
Vectors f_records
text_setup_t f_setup
int f_version

Classes

struct  text_define_t
struct  text_entry_t
struct  text_setup_t

Member Enumeration Documentation

enum sswf::TagText::text_type_t [private]

Enumerator:
TEXT_ENTRY_TEXT 
TEXT_ENTRY_SETUP 


Constructor & Destructor Documentation

TagText::TagText ( TagBase parent  ) 


Member Function Documentation

void TagText::AddColor ( Color color  ) 

void TagText::AddFont ( const TagFont font,
long  height 
)

void TagText::AddOffsets ( long  x,
long  y 
)

void TagText::AddText ( const char *  string,
long  advance = LONG_MIN 
)

int TagText::DefineText ( int  start,
text_setup_t s,
const TagFont font,
int  font_height 
) [private]

void sswf::TagText::NewSetup ( void   )  [private]

ErrorManager::error_code_t TagText::PreSave ( void   )  [private, virtual]

This function calls the PreSave() function of all the children unless one returns a non-zero value in which case that value will be returned and the process stopped.

This function is aumatically called by the TagHeader and TagSprite in order to pre-save their children.

The PreSave() functions are expected to be used to test whether a tag can be saved. Especially, most tags will call the MinimumVersion() function with the version required to save these tags. This ensures that you can save the entire movie in a valid SWF. Please, see the reference of each tag for more information about what their PreSave() function does.

You should not have to call this function directly.

Returns:
Zero if the PreSave() succeeds; non-zero otherwise

Reimplemented from sswf::TagBase.

void TagText::RecordSetup ( void   )  [private]

ErrorManager::error_code_t TagText::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.

void TagText::SetBounds ( const SRectangle bounds  ) 

void TagText::SetMatrix ( const Matrix matrix  ) 

TagBase::swf_type_t TagText::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::TagText::f_bounds [private]

Matrix sswf::TagText::f_matrix [private]

bool sswf::TagText::f_new_text [private]

Vectors sswf::TagText::f_records [private]

text_setup_t sswf::TagText::f_setup [private]

int sswf::TagText::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