#include <libsswf.h>
Public Member Functions | |
const SRectangle & | Grid (void) const |
Returns the currently defined grid rectangle. | |
ErrorManager::error_code_t | GridPreSave (void) |
Ensures the minimum version. | |
ErrorManager::error_code_t | GridSave (Data &data, sswf_id_t id) |
Save the scaling grid tag. | |
ErrorManager::error_code_t | ParseGridTag (TagBase::swf_tag_t tag, const Data &data) |
Parse data from a file into a ScalingGrid tag. | |
void | SetGrid (const SRectangle &rect) |
Define the Scaling Grid rectangle. | |
virtual | ~TagScalingGrid () |
Cleans up the object. | |
Private Attributes | |
SRectangle | f_grid |
The Scaling Grid tag defines a grid used to scale a button or a sprite (some window like object which has a border/edge and corners not to be scalled as usual.)
This tag is derived by the TagButton and TagSprite and is not otherwise supposed to be used by itself.
This tag adds the Grid() and SetGrid() functionality to the TagButton and TagSprite.
Internally, it also adds the GridPreSave() and GridSave() functions.
TagScalingGrid::~TagScalingGrid | ( | ) | [virtual] |
The destructor is virtual. It has nothing to do otherwise.
const SRectangle & TagScalingGrid::Grid | ( | void | ) | const |
This function returns the currently defined grid rectangle.
References f_grid.
ErrorManager::error_code_t TagScalingGrid::GridPreSave | ( | void | ) |
This function requests that the movie be at least of version 8.
This function is automatically called by the TagButton::PreSave(Data& data) and TagSprite::PreSave(Data& data) functions.
References sswf::ErrorManager::ERROR_CODE_NONE, f_grid, sswf::SRectangle::IsEmpty(), and sswf::TagBase::MinimumVersion().
Referenced by sswf::TagSprite::PreSave(), and sswf::TagButton::PreSave().
ErrorManager::error_code_t TagScalingGrid::GridSave | ( | Data & | data, | |
sswf_id_t | id | |||
) |
This function saves the button or sprite reference and grid rectangle.
This function is automatically called by the TagButton::PreSave(Data& data) and TagSprite::PreSave(Data& data) functions.
data | The Data buffer where the result is saved | |
id | The identification of the button or sprite |
References sswf::Data::Append(), sswf::Data::ByteSize(), sswf::ErrorManager::ERROR_CODE_NONE, f_grid, sswf::SRectangle::IsEmpty(), sswf::Data::PutShort(), sswf::SRectangle::Save(), sswf::TagBase::SaveTag(), and sswf::TagBase::SWF_TAG_DEFINE_SCALING_GRID.
Referenced by sswf::TagSprite::Save(), and sswf::TagButton::Save().
ErrorManager::error_code_t TagScalingGrid::ParseGridTag | ( | TagBase::swf_tag_t | tag, | |
const Data & | data | |||
) |
This function reads the password saved in the ScalingGrid tag.
Note that the password is kept encrypted.
[in] | tag | The tag that generated this call |
[in] | data | The Data buffer from the Flash file being loaded |
References sswf::ErrorManager::ERROR_CODE_NONE, f_grid, sswf::Data::GetShort(), and sswf::SRectangle::Parse().
Referenced by sswf::TagSprite::ParseTag(), and sswf::TagButton::ParseTag().
void TagScalingGrid::SetGrid | ( | const SRectangle & | rect | ) |
This function copies the input rectangle as the new Scaling Grid rectangle of the button or sprite.
You use this function directly from the button or sprite as follow:
TagButton *button; ... button->SetGrid(my_grid); ...
rect | The new Scaling Grid rectangle |
References f_grid.
SRectangle sswf::TagScalingGrid::f_grid [private] |
Referenced by Grid(), GridPreSave(), GridSave(), ParseGridTag(), and SetGrid().