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 namespace image {
00076 class JpegInput;
00077 }
00078 }
00079
00080 namespace gnash
00081 {
00082
00084
00103 class movie_definition : public SWF::DefinitionTag
00104 {
00105 public:
00106 typedef std::vector<boost::intrusive_ptr<SWF::ControlTag> > PlayList;
00107
00108 virtual int get_version() const = 0;
00109
00111
00113 virtual size_t get_width_pixels() const = 0;
00114
00116
00118 virtual size_t get_height_pixels() const = 0;
00119
00120 virtual size_t get_frame_count() const = 0;
00121 virtual float get_frame_rate() const = 0;
00122
00124 virtual const SWFRect& get_frame_size() const = 0;
00125
00126 virtual size_t get_bytes_loaded() const = 0;
00127
00129
00135 virtual size_t get_bytes_total() const = 0;
00136
00138
00151 virtual Movie* createMovie(Global_as& , DisplayObject* =0)
00152 {
00153 return NULL;
00154 }
00155
00156 virtual void incrementLoadedFrames() {}
00157
00159
00167 virtual const PlayList* getPlaylist(size_t ) const
00168 {
00169 return 0;
00170 }
00171
00172
00173 typedef std::pair<int, std::string> ImportSpec;
00174 typedef std::vector< ImportSpec > Imports;
00175
00177
00184 virtual void importResources(
00185 boost::intrusive_ptr<movie_definition> ,
00186 const Imports& )
00187 {
00188 IF_VERBOSE_MALFORMED_SWF(
00189 log_swferror(_("IMPORT tag appears outside SWF definition"));
00190 );
00191 }
00192
00193
00196
00204 virtual DefinitionTag* getDefinitionTag(boost::uint16_t ) const
00205 {
00206 return NULL;
00207 }
00208
00210
00224 virtual bool get_labeled_frame(const std::string& ,
00225 size_t& ) const
00226 {
00227 return false;
00228 }
00229
00230
00231
00232
00233
00235 virtual size_t get_loading_frame() const = 0;
00236
00238
00242
00245 virtual void addDisplayObject(boost::uint16_t , DefinitionTag* )
00246 {
00247 }
00248
00250
00254 virtual void add_font(int , Font* )
00255 {
00256 }
00257
00259
00265 virtual Font* get_font(int ) const
00266 {
00267 return NULL;
00268 }
00269
00271 virtual Font* get_font(const std::string& ,
00272 bool , bool ) const
00273 {
00274 return 0;
00275 }
00276
00278
00289 virtual void addControlTag(SWF::ControlTag* )
00290 {
00291 }
00292
00294
00301 virtual void add_frame_name(const std::string& )
00302 {
00303 }
00304
00312 virtual void set_jpeg_loader(std::auto_ptr<image::JpegInput> )
00313 {
00314 }
00315
00327 virtual image::JpegInput* get_jpeg_loader() const
00328 {
00329 return NULL;
00330 }
00331
00334
00345 virtual CachedBitmap* getBitmap(int ) const
00346 {
00347 return 0;
00348 }
00349
00353
00356 virtual void addBitmap(int , boost::intrusive_ptr<CachedBitmap> )
00357 {
00358 }
00359
00361
00367 virtual sound_sample* get_sound_sample(int ) const
00368 {
00369 return NULL;
00370 }
00371
00375
00378 virtual void add_sound_sample(int , sound_sample* )
00379 {
00380 }
00381
00383
00386 virtual void set_loading_sound_stream_id(int )
00387 {
00388 }
00389
00391
00398 virtual int get_loading_sound_stream_id() const
00399 {
00400 return -1;
00401 }
00402
00404
00406 virtual void registerExport(const std::string&, boost::uint16_t) {}
00407
00409
00412 virtual boost::uint16_t exportID(const std::string& ) const {
00413 return 0;
00414 }
00415
00417
00419 virtual void setAS3() {
00420 }
00421
00423
00426 virtual bool isAS3() const {
00427 return false;
00428 }
00429
00433 virtual const std::string& get_url() const = 0;
00434
00435
00436
00437 virtual bool completeLoad() {
00438 return true;
00439 }
00440
00444
00453 virtual bool ensure_frame_loaded(size_t ) const {
00454 return true;
00455 }
00456
00457 #ifdef USE_SWFTREE
00458
00459
00460
00461
00462
00463
00464 virtual void storeDescriptiveMetadata(const std::string& )
00465 {
00466 }
00467
00468 virtual const std::string& getDescriptiveMetadata() const
00469 {
00470 static const std::string s;
00471 return s;
00472 }
00473
00474 #endif
00475 protected:
00476 movie_definition(boost::uint16_t id = 0)
00477 :
00478 DefinitionTag(id)
00479 {}
00480 };
00481
00482 }
00483
00484 #endif // GNASH_MOVIE_DEFINITION_H