Gnash  0.8.11dev
TagLoadersTable.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 #ifndef GNASH_SWF_TAGLOADERSTABLE_H
20 #define GNASH_SWF_TAGLOADERSTABLE_H
21 
22 #include "SWF.h"
23 
24 #include <map>
25 #include <boost/noncopyable.hpp>
26 
27 // Forward declarations
28 namespace gnash {
29  class SWFStream;
30  class movie_definition;
31  class RunResources;
32 }
33 
34 namespace gnash {
35 namespace SWF {
36 
38 class TagLoadersTable : boost::noncopyable
39 {
40 public:
41 
43  //
48  typedef void (*TagLoader)(SWFStream& input, TagType type,
49  movie_definition& m, const RunResources& r);
50 
51  typedef std::map<SWF::TagType, TagLoader> Loaders;
52 
55 
58  :
59  _loaders(std::move(loaders))
60  {}
61 
63 
65  //
68  bool get(TagType t, TagLoader& lf) const;
69 
71  //
78 
79 private:
80 
81  Loaders _loaders;
82 
83 };
84 
85 } // namespace gnash::SWF
86 } // namespace gnash
87 
88 #endif // GNASH_SWF_TAGLOADERSTABLE_H
gnash::SWF::TagLoadersTable::TagLoader
void(* TagLoader)(SWFStream &input, TagType type, movie_definition &m, const RunResources &r)
Signature of an SWF tag loader.
Definition: TagLoadersTable.h:48
gnash::SWF::TagType
TagType
SWF tag types. Symbolic names copied from Ming.
Definition: SWF.h:31
gnash::SWF::TagLoadersTable::TagLoadersTable
TagLoadersTable(Loaders loaders)
Construct a TagLoadersTable by copying another table.
Definition: TagLoadersTable.h:57
TagLoadersTable.h
gnash::SWF::TagLoadersTable::TagLoadersTable
TagLoadersTable()
Construct an empty TagLoadersTable.
Definition: TagLoadersTable.h:54
gnash
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:41
gnash::SWF::TagLoadersTable::~TagLoadersTable
~TagLoadersTable()
Definition: TagLoadersTable.h:62
gnash::key::m
@ m
Definition: GnashKey.h:159
gnash::movie_definition
Client program's interface to the definition of a movie or sprite.
Definition: movie_definition.h:96
gnash::key::t
@ t
Definition: GnashKey.h:166
gnash::key::r
@ r
Definition: GnashKey.h:164
gnash::key::type
type
Definition: GnashKey.h:330
gnash::SWF::TagLoadersTable::Loaders
std::map< SWF::TagType, TagLoader > Loaders
Definition: TagLoadersTable.h:51
gnash::RunResources
Class to group together per-run and external resources for Gnash.
Definition: RunResources.h:54
gnash::SWF::TagLoadersTable::get
bool get(TagType t, TagLoader &lf) const
Get the TagLoader for a specified TagType.
Definition: TagLoadersTable.cpp:29
SWF.h
gnash::SWF::TagLoadersTable
Table of SWF tags loaders.
Definition: TagLoadersTable.h:39
gnash::SWFStream
SWF stream wrapper class.
Definition: SWFStream.h:59
gnash::key::SWF
@ SWF
Definition: GnashKey.h:331
gnash::SWF::TagLoadersTable::registerLoader
bool registerLoader(TagType t, TagLoader lf)
Register a loader for the specified SWF::TagType.
Definition: TagLoadersTable.cpp:42