From 7cec5211e67e6ee5bad29952404edf0c0fa86c8f Mon Sep 17 00:00:00 2001 From: Jean-Francois Remacle <jean-francois.remacle@uclouvain.be> Date: Sun, 4 Mar 2001 22:58:17 +0000 Subject: [PATCH] *** empty log message *** --- Fltk/Makefile | 4 ++-- Plugin/Cutplane/CutPlane.cpp | 3 ++- Plugin/Cutplane/Makefile | 4 ++-- Plugin/Plugin.cpp | 16 +++++++++++++--- Plugin/Plugin.h | 11 +++++------ 5 files changed, 24 insertions(+), 14 deletions(-) diff --git a/Fltk/Makefile b/Fltk/Makefile index 8c3a0f335e..76e281ac20 100644 --- a/Fltk/Makefile +++ b/Fltk/Makefile @@ -1,4 +1,4 @@ -# $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 diff --git a/Plugin/Cutplane/CutPlane.cpp b/Plugin/Cutplane/CutPlane.cpp index 618456f0e1..15d6802083 100644 --- a/Plugin/Cutplane/CutPlane.cpp +++ b/Plugin/Cutplane/CutPlane.cpp @@ -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) diff --git a/Plugin/Cutplane/Makefile b/Plugin/Cutplane/Makefile index 0353e3e665..b0b4438a1e 100644 --- a/Plugin/Cutplane/Makefile +++ b/Plugin/Cutplane/Makefile @@ -1,4 +1,4 @@ -# $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 diff --git a/Plugin/Plugin.cpp b/Plugin/Plugin.cpp index deeb835651..1dc7774ebe 100644 --- a/Plugin/Plugin.cpp +++ b/Plugin/Plugin.cpp @@ -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 } diff --git a/Plugin/Plugin.h b/Plugin/Plugin.h index dfdf148e41..3b9225d019 100644 --- a/Plugin/Plugin.h +++ b/Plugin/Plugin.h @@ -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); -- GitLab