Gnash  0.8.11dev
BitmapMovie.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012
3 // Free Software Foundation, Inc.
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 
19 
20 #ifndef GNASH_BITMAP_MOVIE_H
21 #define GNASH_BITMAP_MOVIE_H
22 
23 #include <string>
24 #include "BitmapMovieDefinition.h"
25 #include "Movie.h" // for inheritance
26 
27 // Forward declarations
28 namespace gnash {
29  class DisplayObject;
30 }
31 
32 namespace gnash
33 {
34 
35 
37 //
40 class BitmapMovie : public Movie
41 {
42 
43 public:
44 
45  BitmapMovie(as_object* object, const BitmapMovieDefinition* def,
47 
48  virtual ~BitmapMovie() {}
49 
51  //
53  virtual void advance() { MovieClip::advance(); }
54 
55  virtual float frameRate() const {
56  return _def->get_frame_rate();
57  }
58 
59  virtual size_t widthPixels() const {
60  return _def->get_width_pixels();
61  }
62 
63  virtual size_t heightPixels() const {
64  return _def->get_height_pixels();
65  }
66 
67  virtual const std::string& url() const {
68  return _def->get_url();
69  }
70 
71  virtual int version() const {
72  return _def->get_version();
73  }
74 
75  virtual const movie_definition* definition() const {
76  return _def;
77  }
78 
79 private:
80 
81  const BitmapMovieDefinition* const _def;
82 
83 };
84 
85 } // end of namespace gnash
86 
87 #endif // GNASH_BITMAPMOVIEINSTANCE_H
BitmapMovie(as_object *object, const BitmapMovieDefinition *def, DisplayObject *parent)
Definition: BitmapMovie.cpp:25
Client program&#39;s interface to the definition of a movie or sprite.
Definition: movie_definition.h:95
DisplayObject is the base class for all DisplayList objects.
Definition: DisplayObject.h:168
virtual ~BitmapMovie()
Definition: BitmapMovie.h:48
DisplayObject * parent() const
Return the parent of this DisplayObject, or NULL if the DisplayObject has no parent.
Definition: DisplayObject.h:252
virtual const std::string & get_url() const
Return the URL of the SWF stream this definition has been read from.
Definition: BitmapMovieDefinition.h:111
A top-level, standalone Movie that can be loaded and played.
Definition: Movie.h:46
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:40
virtual void advance()
Advance to the next frame of the MovieClip.
Definition: MovieClip.cpp:869
virtual int get_version() const
Definition: BitmapMovieDefinition.h:67
virtual float get_frame_rate() const
Definition: BitmapMovieDefinition.h:83
The base class for all ActionScript objects.
Definition: as_object.h:161
virtual void advance()
BitmapMovies do need an advance method.
Definition: BitmapMovie.h:53
A "movie" definition for a bitmap file.
Definition: BitmapMovieDefinition.h:45
virtual size_t heightPixels() const
Definition: BitmapMovie.h:63
virtual float frameRate() const
Definition: BitmapMovie.h:55
virtual size_t get_width_pixels() const
Frame width in pixels.
Definition: BitmapMovieDefinition.h:71
virtual const movie_definition * definition() const
Definition: BitmapMovie.h:75
virtual size_t get_height_pixels() const
Frame height in pixels.
Definition: BitmapMovieDefinition.h:75
virtual size_t widthPixels() const
Definition: BitmapMovie.h:59
virtual const std::string & url() const
Get the URL the Movie was loaded from.
Definition: BitmapMovie.h:67
A top-level movie displaying a still bitmap.
Definition: BitmapMovie.h:40
virtual int version() const
Get the version of the Movie.
Definition: BitmapMovie.h:71