You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.8KB

  1. /* SpiralSound
  2. * Copyleft (C) 2002 David Griffiths <dave@pawfal.org>
  3. *
  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 2 of the License, or
  7. * (at your option) any later version.
  8. *
  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.
  13. *
  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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17. */
  18. #include <FL/Fl_Double_Window.H>
  19. #include <FL/Fl_Pixmap.H>
  20. #include <iostream>
  21. #include <vector>
  22. #include "Plugins/SpiralPlugin.h"
  23. struct HostsideInfo
  24. {
  25. void* Handle;
  26. int ID;
  27. char **(*GetIcon)(void);
  28. SpiralPlugin *(*CreateInstance)(void);
  29. int (*GetID)(void);
  30. string (*GetGroupName)(void);
  31. };
  32. //////////////////////////////////////////////////////////
  33. typedef int PluginID;
  34. #define PluginError -1
  35. class PluginManager
  36. {
  37. public:
  38. static PluginManager *Get() { if(!m_Singleton) m_Singleton=new PluginManager; return m_Singleton; }
  39. static void PackUpAndGoHome() { if(m_Singleton) delete m_Singleton; }
  40. PluginID LoadPlugin(const char *PluginName);
  41. void UnLoadPlugin(PluginID ID);
  42. void UnloadAll();
  43. const HostsideInfo* GetPlugin(PluginID ID);
  44. bool IsValid(PluginID ID);
  45. int GetIdByName(string Name);
  46. private:
  47. PluginManager();
  48. ~PluginManager();
  49. HostsideInfo *GetPlugin_i(PluginID ID);
  50. vector<HostsideInfo*> m_PluginVec;
  51. static PluginManager *m_Singleton;
  52. };