Gnash  0.8.11dev
extension.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_EXTENSION_H
20 #define GNASH_EXTENSION_H
21 
22 #include <map>
23 #include <vector>
24 #include <string>
25 #include <boost/tokenizer.hpp>
26 #include "dsodefs.h"
27 
28 namespace gnash {
29  class SharedLib;
30  class as_object;
31 }
32 
33 
34 namespace gnash
35 {
36 
38 {
39  typedef boost::char_separator<char> Sep;
40  typedef boost::tokenizer< Sep > Tok;
41 
42 public:
43 
44  Extension();
45 
46  Extension(const std::string& dir);
47 
49 
51  bool scanDir();
52 
54  //
56  bool scanDir(const std::string& dir);
57 
60  //
63  bool scanAndLoad(as_object &where);
64 
67  //
71  bool scanAndLoad(const std::string& dir, as_object &where);
72 
73  // open a module, initialize the module within Gnash. Known function name.
74  bool initModuleWithFunc(const std::string& module, const std::string& func, as_object &obj);
75  bool initNewObject(as_object &obj);
76  void dumpModules();
77 protected:
78 
80  //
84  bool initModule(const std::string& module, as_object &obj);
85 
87  std::vector<std::string> _modules;
88 
90  std::map<std::string, SharedLib *> _plugins;
91 
93  std::string _pluginsdir;
94 };
95 
96 } // end of gnash namespace
97 
98 // GNASH_EXTENSION_H
99 #endif
100 
101 // Local Variables:
102 // mode: C++
103 // indent-tabs-mode: t
104 // End:
std::string _pluginsdir
The default directory to search for modules.
Definition: extension.h:93
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:40
std::vector< std::string > _modules
A list of modules.
Definition: extension.h:87
The base class for all ActionScript objects.
Definition: as_object.h:161
#define DSOEXPORT
Definition: dsodefs.h:55
std::map< std::string, SharedLib * > _plugins
A map of loaded modules.
Definition: extension.h:90
~Extension()
Definition: extension.h:48
Definition: extension.h:37