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 
57  TagLoadersTable(Loaders loaders)
58  :
59  _loaders(std::move(loaders))
60  {}
61 
63 
65  //
68  bool get(TagType t, TagLoader& lf) const;
69 
71  //
77  bool registerLoader(TagType t, TagLoader lf);
78 
79 private:
80 
81  Loaders _loaders;
82 
83 };
84 
85 } // namespace gnash::SWF
86 } // namespace gnash
87 
88 #endif // GNASH_SWF_TAGLOADERSTABLE_H
Client program&#39;s interface to the definition of a movie or sprite.
Definition: movie_definition.h:95
TagType
SWF tag types. Symbolic names copied from Ming.
Definition: SWF.h:30
TagLoadersTable()
Construct an empty TagLoadersTable.
Definition: TagLoadersTable.h:54
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:40
type
Definition: GnashKey.h:329
void(* TagLoader)(SWFStream &input, TagType type, movie_definition &m, const RunResources &r)
Signature of an SWF tag loader.
Definition: TagLoadersTable.h:48
~TagLoadersTable()
Definition: TagLoadersTable.h:62
Definition: GnashKey.h:164
Definition: GnashKey.h:166
std::map< SWF::TagType, TagLoader > Loaders
Definition: TagLoadersTable.h:51
Class to group together per-run and external resources for Gnash.
Definition: RunResources.h:53
Definition: GnashKey.h:159
TagLoadersTable(Loaders loaders)
Construct a TagLoadersTable by copying another table.
Definition: TagLoadersTable.h:57
Table of SWF tags loaders.
Definition: TagLoadersTable.h:38
Definition: GnashKey.h:331
SWF stream wrapper class.
Definition: SWFStream.h:58
bool registerLoader(TagType t, TagLoader lf)
Register a loader for the specified SWF::TagType.
Definition: TagLoadersTable.cpp:42