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
00046
00047
00048 #ifndef GNASH_MOVIE_DEFINITION_H
00049 #define GNASH_MOVIE_DEFINITION_H
00050
00051 #ifdef HAVE_CONFIG_H
00052 #include "gnashconfig.h"
00053 #endif
00054
00055 #include <string>
00056 #include <memory>
00057 #include <vector>
00058 #include <set>
00059 #include <boost/intrusive_ptr.hpp>
00060 #include <boost/cstdint.hpp>
00061
00062 #include "DefinitionTag.h"
00063 #include "log.h"
00064
00065
00066 namespace gnash {
00067 class CachedBitmap;
00068 class Movie;
00069 class MovieClip;
00070 namespace SWF {
00071 class ControlTag;
00072 }
00073 class Font;
00074 class sound_sample;
00075 class JpegImageInput;
00076 }
00077
00078 namespace gnash
00079 {
00080
00082
00101 class movie_definition : public SWF::DefinitionTag
00102 {
00103 public:
00104 typedef std::vector<boost::intrusive_ptr<SWF::ControlTag> > PlayList;
00105
00106 virtual int get_version() const = 0;
00107
00109
00111 virtual size_t get_width_pixels() const = 0;
00112
00114
00116 virtual size_t get_height_pixels() const = 0;
00117
00118 virtual size_t get_frame_count() const = 0;
00119 virtual float get_frame_rate() const = 0;
00120
00122 virtual const SWFRect& get_frame_size() const = 0;
00123
00124 virtual size_t get_bytes_loaded() const = 0;
00125
00127
00133 virtual size_t get_bytes_total() const = 0;
00134
00136
00149 virtual Movie* createMovie(Global_as& , DisplayObject* =0)
00150 {
00151 return NULL;
00152 }
00153
00154 virtual void incrementLoadedFrames() {}
00155
00157
00165 virtual const PlayList* getPlaylist(size_t ) const
00166 {
00167 return 0;
00168 }
00169
00170
00171 typedef std::pair<int, std::string> ImportSpec;
00172 typedef std::vector< ImportSpec > Imports;
00173
00175
00182 virtual void importResources(
00183 boost::intrusive_ptr<movie_definition> ,
00184 const Imports& )
00185 {
00186 IF_VERBOSE_MALFORMED_SWF(
00187 log_swferror(_("IMPORT tag appears outside SWF definition"));
00188 );
00189 }
00190
00191
00194
00202 virtual DefinitionTag* getDefinitionTag(boost::uint16_t ) const
00203 {
00204 return NULL;
00205 }
00206
00208
00222 virtual bool get_labeled_frame(const std::string& ,
00223 size_t& ) const
00224 {
00225 return false;
00226 }
00227
00228
00229
00230
00231
00233 virtual size_t get_loading_frame() const = 0;
00234
00236
00240
00243 virtual void addDisplayObject(boost::uint16_t , DefinitionTag* )
00244 {
00245 }
00246
00248
00252 virtual void add_font(int , Font* )
00253 {
00254 }
00255
00257
00263 virtual Font* get_font(int ) const
00264 {
00265 return NULL;
00266 }
00267
00269 virtual Font* get_font(const std::string& ,
00270 bool , bool ) const
00271 {
00272 return 0;
00273 }
00274
00276
00287 virtual void addControlTag(SWF::ControlTag* )
00288 {
00289 }
00290
00292
00299 virtual void add_frame_name(const std::string& )
00300 {
00301 }
00302
00310 virtual void set_jpeg_loader(std::auto_ptr<JpegImageInput> )
00311 {
00312 }
00313
00325 virtual JpegImageInput* get_jpeg_loader() const
00326 {
00327 return NULL;
00328 }
00329
00332
00343 virtual CachedBitmap* getBitmap(int ) const
00344 {
00345 return 0;
00346 }
00347
00351
00354 virtual void addBitmap(int , boost::intrusive_ptr<CachedBitmap> )
00355 {
00356 }
00357
00359
00365 virtual sound_sample* get_sound_sample(int ) const
00366 {
00367 return NULL;
00368 }
00369
00373
00376 virtual void add_sound_sample(int , sound_sample* )
00377 {
00378 }
00379
00381
00384 virtual void set_loading_sound_stream_id(int )
00385 {
00386 }
00387
00389
00396 virtual int get_loading_sound_stream_id() const
00397 {
00398 return -1;
00399 }
00400
00402
00404 virtual void registerExport(const std::string&, boost::uint16_t) {}
00405
00407
00410 virtual boost::uint16_t exportID(const std::string& ) const {
00411 return 0;
00412 }
00413
00415
00417 virtual void setAS3() {
00418 }
00419
00421
00424 virtual bool isAS3() const {
00425 return false;
00426 }
00427
00431 virtual const std::string& get_url() const = 0;
00432
00433
00434
00435 virtual bool completeLoad() {
00436 return true;
00437 }
00438
00442
00451 virtual bool ensure_frame_loaded(size_t ) const {
00452 return true;
00453 }
00454
00455 #ifdef USE_SWFTREE
00456
00457
00458
00459
00460
00461
00462 virtual void storeDescriptiveMetadata(const std::string& )
00463 {
00464 }
00465
00466 virtual const std::string& getDescriptiveMetadata() const
00467 {
00468 static const std::string s;
00469 return s;
00470 }
00471
00472 #endif
00473 protected:
00474 movie_definition(boost::uint16_t id = 0)
00475 :
00476 DefinitionTag(id)
00477 {}
00478 };
00479
00480 }
00481
00482 #endif // GNASH_MOVIE_DEFINITION_H