00001 /* Gxsm - Gnome X Scanning Microscopy 00002 * universal STM/AFM/SARLS/SPALEED/... controlling and 00003 * data analysis software 00004 * 00005 * Copyright (C) 1999,2000,2001,2002,2003 Percy Zahl 00006 * 00007 * Authors: Percy Zahl <zahl@users.sf.net> 00008 * additional features: Andreas Klust <klust@users.sf.net> 00009 * WWW Home: http://gxsm.sf.net 00010 * 00011 * This program is free software; you can redistribute it and/or modify 00012 * it under the terms of the GNU General Public License as published by 00013 * the Free Software Foundation; either version 2 of the License, or 00014 * (at your option) any later version. 00015 * 00016 * This program is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU General Public License 00022 * along with this program; if not, write to the Free Software 00023 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. 00024 */ 00025 00026 /* -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 8 c-style: "K&R" -*- */ 00027 00028 #ifndef __PLUGIN_CTRL_H 00029 #define __PLUGIN_CTRL_H 00030 00031 #include <config.h> 00032 #include <glib.h> 00033 #include <libgnome/libgnome.h> 00034 #include <dlfcn.h> 00035 00036 #include "plugin.h" 00037 00038 #define SHARED_LIB_EXT_LINUX ".so" 00039 #define SHARED_LIB_EXT_DARWIN ".so" 00040 00041 class XSM_Hardware; 00042 class App; 00043 00044 class plugin_ctrl{ 00045 public: 00046 plugin_ctrl(GList *pi_dirlist, gint (*check)(const gchar *) = NULL); 00047 ~plugin_ctrl(); 00048 00049 void view_pi_info(void); 00050 GList *get_pluginlist(){ return plugins; }; 00051 00052 int how_many(void){ 00053 GList *node=plugins; int i=0; 00054 while(node){ ++i; node=node->next; } 00055 return i; 00056 }; 00057 00058 private: 00059 void scan_for_pi(gchar *dirname); 00060 void add_pi(gchar *filename); 00061 void init_pi(void *pi); 00062 void cleanup_pi(void *pi); 00063 00064 gint (*Check)(const gchar *); 00065 00066 protected: 00067 GList *plugins; 00068 }; 00069 00070 00071 class gxsm_plugins : public plugin_ctrl{ 00072 public: 00073 gxsm_plugins(App *app, GList *pi_dirlist, gint (*check)(const gchar *) = NULL); 00074 ~gxsm_plugins(); 00075 00076 private: 00077 App *a; 00078 }; 00079 00080 00081 class gxsm_hwi_plugins : public plugin_ctrl{ 00082 public: 00083 gxsm_hwi_plugins(GList *pi_dirlist, gint (*check)(const gchar *) = NULL, gchar *fulltype=NULL, App *app=NULL); 00084 ~gxsm_hwi_plugins(); 00085 00086 XSM_Hardware* get_xsm_hwi_class (gchar *hwi_sub_type=NULL); 00087 00088 private: 00089 XSM_Hardware *xsm_hwi_class; // there can only be one active at a time! 00090 }; 00091 00092 00093 #endif