Gnash 0.8.9
|
00001 // 00002 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 00003 // 2011 Free Software Foundation, Inc 00004 // 00005 // This program is free software; you can redistribute it and/or modify 00006 // it under the terms of the GNU General Public License as published by 00007 // the Free Software Foundation; either version 3 of the License, or 00008 // (at your option) any later version. 00009 // 00010 // This program is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 // GNU General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU General Public License 00016 // along with this program; if not, write to the Free Software 00017 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00018 00019 #ifndef GNASH_EXTENSION_H 00020 #define GNASH_EXTENSION_H 00021 00022 #include <map> 00023 #include <vector> 00024 #include <string> 00025 #include <boost/tokenizer.hpp> 00026 #include "sharedlib.h" 00027 #include "dsodefs.h" 00028 00029 00030 namespace gnash 00031 { 00032 00033 class DSOEXPORT Extension 00034 { 00035 typedef boost::char_separator<char> Sep; 00036 typedef boost::tokenizer< Sep > Tok; 00037 00038 public: 00039 00040 Extension(); 00041 00042 Extension(const std::string& dir); 00043 00044 ~Extension(); 00045 00047 bool scanDir(); 00048 00050 // 00052 bool scanDir(const std::string& dir); 00053 00056 // 00059 bool scanAndLoad(as_object &where); 00060 00063 // 00067 bool scanAndLoad(const std::string& dir, as_object &where); 00068 00069 // open a module, initialize the module within Gnash. Known function name. 00070 bool initModuleWithFunc(const std::string& module, const std::string& func, as_object &obj); 00071 bool initNewObject(as_object &obj); 00072 void dumpModules(); 00073 protected: 00074 00076 // 00080 bool initModule(const std::string& module, as_object &obj); 00081 00083 std::vector<std::string> _modules; 00084 00086 std::map<std::string, SharedLib *> _plugins; 00087 00089 std::string _pluginsdir; 00090 }; 00091 00092 } // end of gnash namespace 00093 00094 // GNASH_EXTENSION_H 00095 #endif 00096 00097 // Local Variables: 00098 // mode: C++ 00099 // indent-tabs-mode: t 00100 // End: