Gnash  0.8.11dev
Movie.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2005, 2006, 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 // Stateful live Movie instance
20 
21 
22 #ifndef GNASH_MOVIE_H
23 #define GNASH_MOVIE_H
24 
25 #include <string>
26 
27 #include "MovieClip.h" // for inheritance
28 
29 // Forward declarations
30 namespace gnash {
31  class DisplayObject;
32  class movie_definition;
33 }
34 
35 namespace gnash
36 {
37 
39 //
42 //
46 class Movie : public MovieClip
47 {
48 
49 public:
50 
51  Movie(as_object* object, const movie_definition* def,
53  :
54  MovieClip(object, def, this, parent)
55  {}
56 
57  virtual ~Movie() {}
58 
59  virtual void advance() = 0;
60 
61  virtual float frameRate() const = 0;
62 
63  virtual size_t widthPixels() const = 0;
64 
65  virtual size_t heightPixels() const = 0;
66 
67  virtual bool ensureFrameLoaded(size_t /*frameNo*/) const {
68  return true;
69  }
70 
72  virtual const std::string& url() const = 0;
73 
75  //
78  virtual int version() const = 0;
79 
81  //
84  //
88  virtual SWF::DefinitionTag* exportedCharacter(const std::string& /*s*/) {
89  return nullptr;
90  }
91 
93  //
97  virtual void addCharacter(std::uint16_t /*id*/) {}
98 
100  //
103  virtual bool initializeCharacter(std::uint16_t /*id*/) {
104  return false;
105  }
106 
107  virtual const movie_definition* definition() const = 0;
108 
109 };
110 
111 
112 } // end of namespace gnash
113 
114 #endif
virtual void addCharacter(std::uint16_t)
Add a character to the list of known characters.
Definition: Movie.h:97
Client program&#39;s interface to the definition of a movie or sprite.
Definition: movie_definition.h:95
A MovieClip is a container for DisplayObjects.
Definition: MovieClip.h:83
DisplayObject is the base class for all DisplayList objects.
Definition: DisplayObject.h:168
virtual const movie_definition * definition() const =0
DisplayObject * parent() const
Return the parent of this DisplayObject, or NULL if the DisplayObject has no parent.
Definition: DisplayObject.h:252
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
Immutable data representing the definition of a movie display element.
Definition: DefinitionTag.h:47
virtual void advance()=0
Advance to the next frame of the MovieClip.
The base class for all ActionScript objects.
Definition: as_object.h:161
virtual size_t widthPixels() const =0
virtual bool ensureFrameLoaded(size_t) const
Definition: Movie.h:67
Movie(as_object *object, const movie_definition *def, DisplayObject *parent)
Definition: Movie.h:51
virtual size_t heightPixels() const =0
virtual SWF::DefinitionTag * exportedCharacter(const std::string &)
Get an exported character definition by its symbol name.
Definition: Movie.h:88
virtual int version() const =0
Get the version of the Movie.
virtual const std::string & url() const =0
Get the URL the Movie was loaded from.
virtual bool initializeCharacter(std::uint16_t)
Attempt to mark a character as initialized.
Definition: Movie.h:103
virtual ~Movie()
Definition: Movie.h:57
virtual float frameRate() const =0