- Port xmlsave to the new plugin system
git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@726 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
1b018234be
commit
3dd8403f0a
|
@ -88,7 +88,7 @@ libxmlsave_la_LDFLAGS = \
|
||||||
|
|
||||||
# Please keep this in sorted order:
|
# Please keep this in sorted order:
|
||||||
libxmlsave_la_SOURCES = \
|
libxmlsave_la_SOURCES = \
|
||||||
src/hook.cc
|
src/plugin.cc
|
||||||
|
|
||||||
noinst_HEADERS +=
|
noinst_HEADERS +=
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// src/hook.cc - Copyright 2005, 2006, University
|
// src/plugin.cc - Copyright 2005, 2006, University
|
||||||
// of Padova, dept. of Pure and Applied
|
// of Padova, dept. of Pure and Applied
|
||||||
// Mathematics
|
// Mathematics
|
||||||
//
|
//
|
||||||
|
@ -18,32 +18,50 @@
|
||||||
// along with SGPEMv2; if not, write to the Free Software
|
// along with SGPEMv2; if not, write to the Free Software
|
||||||
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
// The idea of this file is to provide a static function to execute
|
|
||||||
// when the plugin (this library) is loaded. Thus the name "hook".
|
|
||||||
|
|
||||||
// For the moment, instead of a function hook to be called by the
|
|
||||||
// libbackend.so module, we have a static PythonPolicyManager object.
|
|
||||||
// This is a risk.
|
|
||||||
#warning FIXME : this code is quite a bad idea. Replace me with \
|
|
||||||
a hookable structure, and execute a pointer to function stored \
|
|
||||||
therein. See "info libtool": "dlopened modules"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C"
|
|
||||||
{
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#define SG_CONSTRUCTOR __attribute__ ((constructor))
|
#include "plugin.hh"
|
||||||
#define SG_DESTRUCTOR __attribute__ ((destructor))
|
|
||||||
|
|
||||||
void SG_DLLEXPORT SG_CONSTRUCTOR hook_ctor(void)
|
#include <glibmm/ustring.h>
|
||||||
{}
|
|
||||||
|
|
||||||
void SG_DLLEXPORT SG_DESTRUCTOR hook_dtor(void)
|
using namespace sgpem;
|
||||||
{}
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
// static XMLSerializer* _serializer = NULL;
|
||||||
|
|
||||||
|
void
|
||||||
|
Plugin::on_init()
|
||||||
|
{
|
||||||
|
// if(_serializer == NULL)
|
||||||
|
// _serializer = new sgpem::XMLSerializer();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Plugin::on_exit()
|
||||||
|
{
|
||||||
|
// delete _serializer;
|
||||||
|
// _serializer = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
Glib::ustring
|
||||||
|
Plugin::describe()
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
Glib::ustring
|
||||||
|
Plugin::get_name()
|
||||||
|
{
|
||||||
|
return "XmlSave";
|
||||||
|
}
|
||||||
|
|
||||||
|
Glib::ustring
|
||||||
|
Plugin::get_author()
|
||||||
|
{
|
||||||
|
return "Copyright 2005, 2006, University of Padova, dept. of Pure and Applied Mathematics";
|
||||||
|
}
|
||||||
|
|
||||||
|
float
|
||||||
|
Plugin::get_version()
|
||||||
|
{
|
||||||
|
return 1.0f;
|
||||||
}
|
}
|
||||||
#endif
|
|
Loading…
Reference in New Issue