FLTK 1.3.0
Fl_Plugin.H
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   Fl_Preferences::ID id;
00072 public:
00073   Fl_Plugin(const char *klass, const char *name);
00074   virtual ~Fl_Plugin();
00075 };
00076 
00077 
00082 class FL_EXPORT Fl_Plugin_Manager : public Fl_Preferences {
00083 public:
00084   Fl_Plugin_Manager(const char *klass);
00085   ~Fl_Plugin_Manager();
00086   
00089   int plugins() { return groups(); }
00090   Fl_Plugin *plugin(int index);
00091   Fl_Plugin *plugin(const char *name);
00092   Fl_Preferences::ID addPlugin(const char *name, Fl_Plugin *plugin);
00093   
00094   static void removePlugin(Fl_Preferences::ID id);
00095   static int load(const char *filename);
00096   static int loadAll(const char *filepath, const char *pattern=0);
00097 };
00098 
00099 
00100 #endif // !Fl_Preferences_H
00101 
00102 //
00103 // End of "$Id: Fl_Preferences.H 6995 2010-01-12 08:48:55Z matt $".
00104 //