2
// Copyright (C) 2007, 2008 Free Software Foundation, Inc.
4
// This program is free software; you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation; either version 3 of the License, or
7
// (at your option) any later version.
9
// This program is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
// GNU General Public License for more details.
14
// You should have received a copy of the GNU General Public License
15
// along with this program; if not, write to the Free Software
16
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
#ifndef GNASH_SWF_DOINITACTIONTAG_H
19
#define GNASH_SWF_DOINITACTIONTAG_H
21
#include "ControlTag.h" // for inheritance
22
#include "swf.h" // for tag_type definition
23
#include "action_buffer.h" // for composition
24
#include "sprite_instance.h" // for inlines
25
#include "SWFStream.h" // for inlines
27
// Forward declarations
29
class movie_definition;
35
/// SWF Tag DoInitAction (59)
37
/// Thin wrapper around action_buffer.
39
class DoInitActionTag : public ControlTag
43
DoInitActionTag(SWFStream& in, movie_definition& md, int cid)
51
virtual void execute_state(sprite_instance* m, DisplayList& /*dlist*/) const
53
m->execute_init_action_buffer(_buf, _cid);
56
virtual void execute(sprite_instance* m, DisplayList& /*dlist*/) const
58
m->execute_init_action_buffer(_buf, _cid);
61
// Tell the caller that we are an action tag.
62
virtual bool is_action_tag() const
67
static void doInitActionLoader(SWFStream& in, tag_type tag, movie_definition& m)
70
int cid = in.read_u16();
71
DoInitActionTag* da = new DoInitActionTag(in, m, cid);
74
log_parse(_(" tag %d: do_init_action_loader"), tag);
75
log_parse(_(" -- init actions for sprite %d"), cid);
78
//m->add_init_action(da, cid); // ownership transferred
79
m.addControlTag(da); // ownership transferred
84
/// Read a DoInitAction block from the SWFStream
86
void read(SWFStream& in)
88
_buf.read(in, in.get_tag_end_position());
94
// id of referenced character definition
98
} // namespace gnash::SWF
102
#endif // GNASH_SWF_DOINITACTIONTAG_H
107
// indent-tabs-mode: t