X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Fmodule.cpp;h=d70622f2ceab78bdda419803b20b016df665a5d9;hb=5ddcf36f04cfbd10fabda4e3c5633cb27cdd4c0a;hp=8016a9bb20775d25f89c015b6d54e02d23f9307f;hpb=e8a065f2385c219c511b57dac52786120bfa097d;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/module.cpp b/synfig-core/trunk/src/synfig/module.cpp index 8016a9b..d70622f 100644 --- a/synfig-core/trunk/src/synfig/module.cpp +++ b/synfig-core/trunk/src/synfig/module.cpp @@ -33,8 +33,12 @@ #include "module.h" #include "general.h" -#include #include + +#ifndef USE_CF_BUNDLES +#include +#endif + #endif /* === M A C R O S ========================================================= */ @@ -52,10 +56,11 @@ Module::Book *synfig::Module::book_; bool Module::subsys_init(const String &prefix) { +#ifndef USE_CF_BUNDLES #ifndef SYNFIG_LTDL_NO_STATIC //LTDL_SET_PRELOADED_SYMBOLS(); #endif - + if(lt_dlinit()) { error(_("Errors on lt_dlinit()")); @@ -74,7 +79,7 @@ Module::subsys_init(const String &prefix) #endif lt_dladdsearchdir("/usr/local/lib/synfig/modules"); lt_dladdsearchdir("."); - +#endif book_=new Book; return true; } @@ -83,8 +88,10 @@ bool Module::subsys_stop() { delete book_; - + +#ifndef USE_CF_BUNDLES lt_dlexit(); +#endif return true; } @@ -109,21 +116,22 @@ synfig::Module::Register(Module::Handle mod) bool synfig::Module::Register(const String &module_name, ProgressCallback *callback) { +#ifndef USE_CF_BUNDLES lt_dlhandle module; if(callback)callback->task(strprintf(_("Attempting to register \"%s\""),module_name.c_str())); module=lt_dlopenext((string("lib")+module_name).c_str()); if(!module)module=lt_dlopenext(module_name.c_str()); - + if(!module) { - if(callback)callback->error(strprintf(_("Unable to find module \"%s\" (%s)"),module_name.c_str(),lt_dlerror())); + if(callback)callback->warning(strprintf(_("Unable to find module \"%s\" (%s)"),module_name.c_str(),lt_dlerror())); return false; } if(callback)callback->task(strprintf(_("Found module \"%s\""),module_name.c_str())); - + Module::constructor_type constructor=NULL; Handle mod; @@ -148,7 +156,7 @@ synfig::Module::Register(const String &module_name, ProgressCallback *callback) // if(callback)callback->task(string("looking for -> lib")+module_name+"_LTX_new_instance()"); constructor=(Module::constructor_type )lt_dlsym(module,(string("_")+module_name+"_LTX_new_instance").c_str()); } - + if(constructor) { // if(callback)callback->task(strprintf("Executing callback for \"%s\"",module_name.c_str())); @@ -174,6 +182,7 @@ synfig::Module::Register(const String &module_name, ProgressCallback *callback) } if(callback)callback->task(strprintf(_("Success for \"%s\""),module_name.c_str())); - + +#endif return false; }