Skip to content
Snippets Groups Projects
Commit 7cec5211 authored by Jean-François Remacle's avatar Jean-François Remacle
Browse files

*** empty log message ***

parent 022c9550
No related branches found
No related tags found
No related merge requests found
# $Id: Makefile,v 1.12 2001-02-20 18:32:58 geuzaine Exp $
# $Id: Makefile,v 1.13 2001-03-04 22:58:17 remacle Exp $
#
# Makefile for "libFltk.a"
#
......@@ -12,7 +12,7 @@ RANLIB = ranlib
LIB = ../lib/libFltk.a
INCLUDE = -I../Common -I../DataStr -I../Graphics -I../Geo\
-I../Mesh -I../Parser -I../Fltk
-I../Mesh -I../Parser -I../Fltk -I../Plugin
C_FLAGS = -g -Wall
OS_FLAGS = -D_LITTLE_ENDIAN
......
......@@ -3,11 +3,12 @@
/*
Plugin Entry : GMSH_RegisterPlugin
*/
extern "C"{
GMSH_Plugin *GMSH_RegisterPlugin ()
{
return new GMSH_CutPlanePlugin (1.0,0.0,0.0,0.0);
}
}
GMSH_CutPlanePlugin::GMSH_CutPlanePlugin(double A, double B, double C, double D)
:a(A),b(B),c(C),d(D)
......
# $Id: Makefile,v 1.1 2001-03-04 20:57:49 remacle Exp $
# $Id: Makefile,v 1.2 2001-03-04 22:57:36 remacle Exp $
#
# Makefile for "libAdapt.a"
#
......@@ -6,7 +6,7 @@
.IGNORE:
CC = c++
AR = c++ -shared -o
AR = c++ -Wl,--subsystem,windows -shared -o
RM = rm
RANLIB = ranlib
......
......@@ -5,6 +5,8 @@
#include "Message.h"
using namespace std;
const char *GMSH_PluginEntry = "GMSH_RegisterPlugin";
#if defined(WIN32) && !defined(__CYGWIN__)
#define SLASH "\\"
#else
......@@ -49,7 +51,6 @@ GMSH_PluginManager* GMSH_PluginManager::Instance()
if(!instance)
{
instance = new GMSH_PluginManager;
instance->RegisterDefaultPlugins();
}
return instance;
}
......@@ -57,7 +58,8 @@ GMSH_PluginManager* GMSH_PluginManager::Instance()
void GMSH_PluginManager::RegisterDefaultPlugins()
{
// For testing
AddPlugin ("/cygdrive/c/develop/gmsh/Plugin/lib/","libCutPlane");
AddPlugin ("/cygdrive/c/develop/gmsh/Plugin/lib","libCutPlane");
return;
char *homeplugins = getenv ("GMSHPLUGINSHOME");
if(!homeplugins)return;
......@@ -72,10 +74,13 @@ void GMSH_PluginManager::AddPlugin( char *dirName, char *pluginName)
#else
char dynamic_lib[1024];
char plugin_name[256];
char plugin_author[256];
char plugin_copyright[256];
char plugin_help[256];
class GMSH_Plugin* (*RegisterPlugin)(void);
sprintf(dynamic_lib,"%s%s%s.so",dirName,SLASH,pluginName);
Msg(INFO,"Opening Plugin %s",dynamic_lib);
void *hlib = dlopen (dynamic_lib,RTLD_NOW);
void *hlib = dlopen (dynamic_lib,RTLD_LAZY);
char *err = dlerror();
if(hlib == NULL)
{
......@@ -93,12 +98,17 @@ void GMSH_PluginManager::AddPlugin( char *dirName, char *pluginName)
GMSH_Plugin *p = RegisterPlugin();
p->hlib = hlib;
p->getName(plugin_name);
p->getInfos(plugin_author,plugin_copyright,plugin_help);
if(allPlugins->find(plugin_name) != allPlugins->end())
{
Msg(WARNING,"Plugin %s Multiply defined",pluginName);
return;
}
allPlugins->m[plugin_name] = p;
Msg(INFO,"Plugin name : %s",plugin_name);
Msg(INFO,"Plugin author : %s",plugin_author);
Msg(INFO,"Plugin copyright : %s",plugin_copyright);
Msg(INFO,"Plugin help : %s",plugin_help);
#endif
}
......
......@@ -8,7 +8,6 @@
just throw this, the plugin manager will be able to
catch the exception.
*/
const char *GMSH_PluginEntry = "GMSH_RegisterPlugin";
class PluginContainer;
class Post_View;
......@@ -51,16 +50,16 @@ public:
class GMSH_PluginManager
{
/**
Registering all default plugins that are in $(GMSHPLUGINSHOME)
In fact, we will load all .so files in dir $(GMSHPLUGINSHOME)
*/
void RegisterDefaultPlugins();
GMSH_PluginManager();
~GMSH_PluginManager();
static GMSH_PluginManager *instance;
PluginContainer* allPlugins;
public :
/**
Registering all default plugins that are in $(GMSHPLUGINSHOME)
In fact, we will load all .so files in dir $(GMSHPLUGINSHOME)
*/
void RegisterDefaultPlugins();
static GMSH_PluginManager *Instance();
/** Dynamically add a plugin pluginName.so in dirName*/
void AddPlugin(char *dirName, char *pluginName);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment