plugin.h

Go to the documentation of this file.
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_H
00029 #define __PLUGIN_H
00030 
00031 #include <config.h>
00032 #include <glib.h>
00033 #include <gmodule.h>
00034 
00035 #include "gxsm_app.h"
00036 #include "scan.h"
00037 
00038 class App;
00039 
00040 /*
00041  * Gxsm PlugIn Infostruct:
00042  *
00043  * PlugIn Function Call: 
00044  *   (void*) get_plugin_info( void )
00045  * should return a valid Pointer to "struct GxsmPlugin" as defined here:
00046  *
00047  */
00048 
00049 typedef struct
00050 {
00051   GModule *module;           /* Filled in by Gxsm */
00052   char *filename;         /* Filled in by Gxsm */
00053   int  Gxsm_session;      /* The session ID for attaching to the control socket */
00054   App *app;               /* Calling Application Object */
00055   char *name;             /* unique Plugin name */
00056   char *category;         /* Plugin's Category - used to autodecide on Pluginloading or ignoring */
00057   char *description;      /* The description that is shown in the preferences box */
00058   char *authors;          /* Plugins author */
00059   char *menupath;         /* The plugins menuposition to append to */
00060   char *menuentry;        /* The plugins menuentry */
00061   char *help;             /* The plugins help text */
00062   char *info;             /* Additional info about Plugin */
00063   char *errormsg;         /* Plugin Status Message */
00064   char *status;           /* Plugin Status, managed by Gxsm */
00065   void (*init) (void);    /* Called when the plugin is enabled */
00066   void (*query) (void);   /* Called after init and app is set. */
00067   void (*about) (void);   /* Show the about box */
00068   void (*configure) (void); /* User Configuration */
00069   void (*run) (GtkWidget *, void *); /* if run != NULL this handler is installed at menupath as default, else for special Gxsm-Plugins is searched! */
00070   void (*cleanup) (void); /* Called when the plugin is disabled or when Gxsm exits */
00071 }
00072 GxsmPlugin;
00073 
00074 /*
00075  * Gxsm special PlugIns...
00076  */
00077 
00078 /* Math Plugins */
00079 
00080 /* returned by
00081  * (void*) get_gxsm_math_one_src_plugin_info( void ) 
00082  */
00083 typedef struct
00084 {
00085   gboolean (*run) (Scan *Src, Scan *Dest);
00086 }
00087 GxsmMathOneSrcPlugin;
00088 
00089 /* returned by
00090  * (void*) get_gxsm_math_two_src_plugin_info( void ) 
00091  * or
00092  * (void*) get_gxsm_math_two_src_no_same_size_check_plugin_info( void ) 
00093  */
00094 typedef struct
00095 {
00096   gboolean (*run) (Scan *Src1, Scan *Src2, Scan *Dest);
00097 }
00098 GxsmMathTwoSrcPlugin;
00099 
00100 /* returned by
00101  * (void*) get_gxsm_math_one_src_no_dest_plugin_info( void ) 
00102  */
00103 typedef struct
00104 {
00105   gboolean (*run) (Scan *Src);
00106 }
00107 GxsmMathOneSrcNoDestPlugin;
00108 
00109 
00110 /* Instrument Control Plugins */
00111 
00112 /* GXSM Hardware Interface Plugins */
00113 
00114 /*
00115  * A pointer to allocated subclass of class XSM_hardware is returned by
00116  * (void*) get_gxsm_hwi_hardware_class( void *data )
00117  * It is allocated at PI-init
00118  * and
00119  * deleted at PI-cleanup
00120  */
00121 
00122 #endif

Generated on Sat Apr 1 09:04:02 2006 for GXSM by  doxygen 1.4.6