2
// Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
4
// This program is free software; you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation; either version 3 of the License, or
7
// (at your option) any later version.
9
// This program is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
// GNU General Public License for more details.
14
// You should have received a copy of the GNU General Public License
15
// along with this program; if not, write to the Free Software
16
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
#ifndef GNASH_SWF_TAGLOADERSTABLE_H
19
#define GNASH_SWF_TAGLOADERSTABLE_H
22
#include "gnashconfig.h"
29
// Forward declarations
32
class movie_definition;
38
/// Table of SWF tags loaders
43
/// Signature of an SWF tag loader
45
/// 'in' is the SWF input stream
46
/// 't' is the tag type
47
/// 'm' a pointer to the movie (or sprite) being read
49
typedef void (*loader_function)(
50
stream* input, tag_type type, movie_definition* m);
53
/// Get a pointer to the loader_function for the
54
/// specified SWF::tag_type.
56
/// @return false if no loader is associated with the tag.
58
bool get(tag_type t, loader_function* lf);
61
/// Register a loader for the specified SWF::tag_type.
63
/// @return false if a loader is already registered
66
bool register_loader(tag_type t, loader_function lf);
69
/// Return a reference to the singleton instance
71
static TagLoadersTable& getInstance();
75
/// The container being used for the table
76
typedef std::map<int, loader_function> container;
78
container _tag_loaders;
88
TagLoadersTable(const TagLoadersTable& tl)
90
_tag_loaders(tl._tag_loaders)
93
TagLoadersTable& operator=(const TagLoadersTable& tl)
95
_tag_loaders = tl._tag_loaders;
101
} // namespace gnash::SWF
104
#endif // GNASH_SWF_TAGLOADERSTABLE_H