30 #ifndef _GG_PluginInterface_h_
31 #define _GG_PluginInterface_h_
35 #if defined(__APPLE__) && defined(__MACH__)
36 # include "../libltdl/ltdl.h"
61 struct ConvertibleToBoolDummy {
int _;};
65 typedef const char* (*PluginNameFn)();
68 typedef const char* (*DefaultFontNameFn)();
70 typedef unsigned int (*DefaultFontSizeFn)();
72 typedef boost::shared_ptr<StyleFactory> (*GetStyleFactoryFn)();
91 operator int ConvertibleToBoolDummy::* ()
const;
97 bool Load(
const std::string& lib_name);
106 lt_dlhandle m_handle;
107 boost::archive::xml_oarchive* m_out_archive;
108 boost::archive::xml_iarchive* m_in_archive;
124 boost::shared_ptr<PluginInterface> GetPlugin(
const std::string& name);
129 void FreePlugin(
const std::string& name);
135 static void InitDynamicLoader();
138 static void AddSearchDirectory(
const std::string& dir);
143 static void CleanupDynamicLoader();
148 std::map<std::string, boost::shared_ptr<PluginInterface> > m_plugins;
150 static bool s_lt_dl_initialized;