Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef GNASH_SWF_DOINITACTIONTAG_H
00019 #define GNASH_SWF_DOINITACTIONTAG_H
00020
00021 #include "ControlTag.h"
00022 #include "SWF.h"
00023 #include "action_buffer.h"
00024 #include "MovieClip.h"
00025 #include "SWFStream.h"
00026
00027
00028 namespace gnash {
00029 class movie_definition;
00030 }
00031
00032 namespace gnash {
00033 namespace SWF {
00034
00036
00039 class DoInitActionTag : public ControlTag
00040 {
00041 public:
00042
00043 DoInitActionTag(SWFStream& in, movie_definition& md, int cid)
00044 :
00045 _buf(md),
00046 _cid(cid)
00047 {
00048 read(in);
00049 }
00050
00052
00055
00058 virtual void executeState(MovieClip* m, DisplayList& ) const {
00059 m->execute_init_action_buffer(_buf, _cid);
00060 }
00061
00062 static void loader(SWFStream& in, TagType tag, movie_definition& m,
00063 const RunResources& )
00064 {
00065 if (m.isAS3()) {
00066 IF_VERBOSE_MALFORMED_SWF(
00067 log_swferror("SWF contains DoInitAction tag, but is an "
00068 "AS3 SWF!");
00069 );
00070 throw ParserException("DoInitAction tag found in AS3 SWF!");
00071 }
00072
00073 in.ensureBytes(2);
00074 const boost::uint16_t cid = in.read_u16();
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089 DoInitActionTag* da = new DoInitActionTag(in, m, cid);
00090
00091 IF_VERBOSE_PARSE(
00092 log_parse(_(" tag %d: do_init_action_loader"), tag);
00093 log_parse(_(" -- init actions for sprite %d"), cid);
00094 );
00095
00096 m.addControlTag(da);
00097 }
00098
00099 private:
00100
00102
00103 void read(SWFStream& in)
00104 {
00105 _buf.read(in, in.get_tag_end_position());
00106 }
00107
00108
00109 action_buffer _buf;
00110
00111
00112 int _cid;
00113 };
00114
00115 }
00116 }
00117
00118
00119 #endif // GNASH_SWF_DOINITACTIONTAG_H
00120
00121
00122
00123
00124
00125
00126