00001 // 00002 // "$Id: Fl_Plugin.H 6995 2010-01-12 08:48:55Z matt $" 00003 // 00004 // A Plugin system for FLTK, implemented in Fl_Preferences.cxx. 00005 // 00006 // Copyright 2002-2010 by Matthias Melcher. 00007 // 00008 // This library is free software; you can redistribute it and/or 00009 // modify it under the terms of the GNU Library General Public 00010 // License as published by the Free Software Foundation; either 00011 // version 2 of the License, or (at your option) any later version. 00012 // 00013 // This library is distributed in the hope that it will be useful, 00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 // Library General Public License for more details. 00017 // 00018 // You should have received a copy of the GNU Library General Public 00019 // License along with this library; if not, write to the Free Software 00020 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00021 // USA. 00022 // 00023 // Please report all bugs and problems on the following page: 00024 // 00025 // http://www.fltk.org/str.php 00026 // 00027 00028 /* \file 00029 Fl_Plugin class . */ 00030 00031 #ifndef Fl_Plugin_H 00032 # define Fl_Plugin_H 00033 00034 # include "Fl_Preferences.H" 00035 00036 00070 class FL_EXPORT Fl_Plugin 00071 { 00072 Fl_Preferences::ID id; 00073 public: 00074 Fl_Plugin(const char *klass, const char *name); 00075 virtual ~Fl_Plugin(); 00076 }; 00077 00078 00083 class FL_EXPORT Fl_Plugin_Manager : public Fl_Preferences 00084 { 00085 public: 00086 Fl_Plugin_Manager(const char *klass); 00087 ~Fl_Plugin_Manager(); 00088 00091 int plugins() { return groups(); } 00092 Fl_Plugin *plugin(int index); 00093 Fl_Plugin *plugin(const char *name); 00094 Fl_Preferences::ID addPlugin(const char *name, Fl_Plugin *plugin); 00095 00096 static void removePlugin(Fl_Preferences::ID id); 00097 static int load(const char *filename); 00098 static int loadAll(const char *filepath, const char *pattern=0); 00099 }; 00100 00101 00102 #endif // !Fl_Preferences_H 00103 00104 // 00105 // End of "$Id: Fl_Preferences.H 6995 2010-01-12 08:48:55Z matt $". 00106 //