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
gnash::InputDevice::input_data_t::x
int x
Definition: InputDevice.h:76
gnash::as_object
The base class for all ActionScript objects.
Definition: as_object.h:162
gnash::MouseDevice::command
bool command(unsigned char cmd, unsigned char *buf, int count)
Sends a command to the mouse and waits for the response.
Definition: MouseDevice.cpp:368
gnash::Movie::widthPixels
virtual size_t widthPixels() const =0
gnash::SWF::DefinitionTag
Immutable data representing the definition of a movie display element.
Definition: DefinitionTag.h:48
gnash::log_debug
void log_debug(StringType msg, Args... args)
Definition: log.h:301
gnash::key::i
@ i
Definition: GnashKey.h:155
gnash::DisplayObject::object
as_object * object() const
Definition: DisplayObject.h:931
_
#define _(String)
Definition: log.h:44
gnash::InputDevice::UNKNOWN
@ UNKNOWN
Definition: InputDevice.h:95
gnash
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:41
gnash::InputDevice::input_data_t::y
int y
Definition: InputDevice.h:77
gnash::InputDevice::addData
void addData(bool pressed, key::code key, int modifier, int x, int y)
Definition: InputDevice.cpp:92
GNASH_REPORT_FUNCTION
#define GNASH_REPORT_FUNCTION
Definition: log.h:452
gnash::InputDevice::readData
std::unique_ptr< std::uint8_t[]> readData(size_t size)
Definition: InputDevice.cpp:112
gnash::key::n
@ n
Definition: GnashKey.h:160
gnash::MovieClip
A MovieClip is a container for DisplayObjects.
Definition: MovieClip.h:84
gnash::Movie::addCharacter
virtual void addCharacter(std::uint16_t)
Add a character to the list of known characters.
Definition: Movie.h:97
gnash::movie_definition
Client program's interface to the definition of a movie or sprite.
Definition: movie_definition.h:96
gnash::Movie::initializeCharacter
virtual bool initializeCharacter(std::uint16_t)
Attempt to mark a character as initialized.
Definition: Movie.h:103
gnash::log_error
void log_error(StringType msg, Args... args)
Definition: log.h:283
gnash::InputDevice::_filespec
std::string _filespec
Definition: InputDevice.h:156
gnash::MouseDevice::~MouseDevice
~MouseDevice()
Definition: MouseDevice.cpp:43
gnash::MouseDevice::check
bool check()
Definition: MouseDevice.cpp:236
gnash::Movie::advance
virtual void advance()=0
Advance to the next frame of the MovieClip.
GnashSleep.h
gnash::amf::write
void write(SimpleBuffer &buf, const std::string &str)
Write a string to an AMF buffer.
Definition: AMF.cpp:161
gnash::Movie::Movie
Movie(as_object *object, const movie_definition *def, DisplayObject *parent)
Definition: Movie.h:51
gnash::Movie::heightPixels
virtual size_t heightPixels() const =0
gnash::Movie::definition
virtual const movie_definition * definition() const =0
gnash::key::type
type
Definition: GnashKey.h:330
gnash::InputDevice::_fd
int _fd
Definition: InputDevice.h:157
gnash::InputDevice::MOUSE
@ MOUSE
Definition: InputDevice.h:98
MovieClip.h
gnash::key::INVALID
@ INVALID
Definition: GnashKey.h:45
gnash::MouseDevice::scanForDevices
static std::vector< std::shared_ptr< InputDevice > > scanForDevices()
Definition: MouseDevice.cpp:49
gnash::Movie
A top-level, standalone Movie that can be loaded and played.
Definition: Movie.h:47
gnash::Movie::frameRate
virtual float frameRate() const =0
gnash::InputDevice::convertAbsCoords
static DSOEXPORT std::unique_ptr< int[]> convertAbsCoords(int x, int y, int width, int height)
Definition: InputDevice.cpp:179
InputDevice.h
gnash::InputDevice::_screen_width
int _screen_width
Definition: InputDevice.h:162
log.h
gnash::DisplayObject::parent
DisplayObject * parent() const
Return the parent of this DisplayObject, or NULL if the DisplayObject has no parent.
Definition: DisplayObject.h:252
gnash::gnashSleep
void gnashSleep(time_t useconds)
Sleep compatibly for the specified number of microseconds.
Definition: GnashSleep.h:35
gnash::InputDevice::_type
devicetype_e _type
Definition: InputDevice.h:155
gnash::Movie::~Movie
virtual ~Movie()
Definition: Movie.h:57
gnashconfig.h
gnash::Movie::url
virtual const std::string & url() const =0
Get the URL the Movie was loaded from.
gnash::Movie::exportedCharacter
virtual SWF::DefinitionTag * exportedCharacter(const std::string &)
Get an exported character definition by its symbol name.
Definition: Movie.h:88
gnash::InputDevice::_input_data
input_data_t _input_data
Definition: InputDevice.h:158
gnash::DisplayObject
DisplayObject is the base class for all DisplayList objects.
Definition: DisplayObject.h:169
gnash::MouseDevice::MouseDevice
MouseDevice()
Definition: MouseDevice.cpp:36
gnash::InputDevice::TOUCHMOUSE
@ TOUCHMOUSE
Definition: InputDevice.h:101
gnash::InputDevice::devicetype_e
devicetype_e
Definition: InputDevice.h:94
gnash::InputDevice::_screen_height
int _screen_height
Definition: InputDevice.h:163
gnash::Movie::version
virtual int version() const =0
Get the version of the Movie.
gnash::Movie::ensureFrameLoaded
virtual bool ensureFrameLoaded(size_t) const
Definition: Movie.h:67
gnash::InputDevice::input_data_t::button
int button
Definition: InputDevice.h:79
gnash::MouseDevice::init
bool init()
Definition: MouseDevice.cpp:127