/* libsswf_tag_showframe.c++ -- written by Alexis WILKE for Made to Order Software Corp. (c) 2002-2008 */

/*

Copyright (c) 2002-2008 Made to Order Software Corp.

Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and
associated documentation files (the "Software"), to
deal in the Software without restriction, including
without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom
the Software is furnished to do so, subject to the
following conditions:

The above copyright notice and this permission notice
shall be included in all copies or substantial
portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

*/

/** \file
 *
 * \brief The implementation of the sswf::TagShowFrame class
 *
 * This file declares the body of the functions which are not
 * inline. It is part of the SSWF library.
 */

#include	"sswf/libsswf.h"

using namespace sswf;



/////////////////////////////////////////// TagShowFrame


/** \class sswf::TagShowFrame
 *
 * \brief Tag marking the limit between each frame.
 *
 * Whenever this tag is reached, the current image is shown to the user.
 *
 * A show frame tag is also the place where a movie stops if paused.
 *
 * \sa <a href="../SWFalexref.html#tag_showframe">SWF Alexis' Reference&mdash;Show Frame</a>
 * \sa <a href="../SWFalexref.html#swf_tag">SWF Alexis' Reference&mdash;swf_tag</a>
 */


/** \brief Initializes the show frame tag
 *
 * The constructor initializes the show frame tag.
 *
 * \param[in] parent The parent of the TagShowFrame (TagHeader or TagSprite)
 */
TagShowFrame::TagShowFrame(TagBase *parent)
	: TagBase("showframe", parent)
{
}


/** \brief Returns the type of the TagShowFrame
 *
 * This function returns SWF_TYPE_CONTROL.
 *
 * \return Returns SWF_TYPE_CONTROL
 */
TagBase::swf_type_t TagShowFrame::TypeFlags(void) const
{
	return SWF_TYPE_CONTROL;
}


/** \brief Save the ShowFrame in the Data buffer
 *
 * This function saves the TagShowFrame tag in the specified Data buffer.
 *
 * \param[in,out] data The Data buffer where the data is saved
 *
 * \return An error if one occurs, or ErrorManager::ERROR_CODE_NONE
 */
ErrorManager::error_code_t TagShowFrame::Save(Data& data)
{
	SaveTag(data, SWF_TAG_SHOW_FRAME, 0);

	Parent()->ShowFrame();

	return ErrorManager::ERROR_CODE_NONE;
}




/* The following options fold the documentation; use 'zi' to turn on and off
 *
 * vim: foldexpr=getline(v\:lnum)!~'^/\\*\\*'&&getline(v\:lnum)!~'^\ \\*'?0\:1 foldcolumn=2 foldmethod=expr
 */
