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
00019
00020
00021
00022 #ifndef GNASH_SWF_MOVIE_H
00023 #define GNASH_SWF_MOVIE_H
00024
00025 #include "Movie.h"
00026 #include "SWFMovieDefinition.h"
00027
00028 #include <boost/intrusive_ptr.hpp>
00029 #include <string>
00030 #include <map>
00031
00032
00033 namespace gnash {
00034 class DisplayObject;
00035 }
00036
00037 namespace gnash
00038 {
00039
00041
00043
00049 class SWFMovie : public Movie
00050 {
00051
00053 typedef std::map<boost::uint16_t, bool> Characters;
00054
00055 public:
00056
00057 SWFMovie(as_object* object, const SWFMovieDefinition* def,
00058 DisplayObject* parent);
00059
00060 virtual ~SWFMovie() {}
00061
00062 virtual void advance();
00063
00064 virtual float frameRate() const {
00065 return _def->get_frame_rate();
00066 }
00067
00068 virtual size_t widthPixels() const {
00069 return _def->get_width_pixels();
00070 }
00071
00072 virtual size_t heightPixels() const {
00073 return _def->get_height_pixels();
00074 }
00075
00076 virtual bool ensureFrameLoaded(size_t frameNo) const {
00077 return _def->ensure_frame_loaded(frameNo);
00078 }
00079
00081
00086 void construct(as_object* init = 0);
00087
00089 const std::string& url() const {
00090 return _def->get_url();
00091 }
00092
00094
00096 int version() const {
00097 return _def->get_version();
00098 }
00099
00101
00104
00108 virtual SWF::DefinitionTag* exportedCharacter(const std::string& symbol);
00109
00111
00115
00119 void addCharacter(boost::uint16_t id);
00120
00122
00125
00132 bool initializeCharacter(boost::uint16_t id);
00133
00134 const movie_definition* definition() const {
00135 return _def.get();
00136 }
00137
00138 private:
00139
00141 Characters _characters;
00142
00144 const boost::intrusive_ptr<const SWFMovieDefinition> _def;
00145 };
00146
00147
00148 }
00149
00150 #endif // GNASH_MOVIE_INSTANCE_H