Fix 1671884: The origin of PasteCanvas layers wasn't being taken into account when...
[synfig.git] / synfig-core / trunk / src / synfig / module.cpp
index 2bef9aa..8e3046d 100644 (file)
@@ -5,16 +5,17 @@
 **     $Id: module.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
 **
 **     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
 **
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
+**     This package is free software; you can redistribute it and/or
+**     modify it under the terms of the GNU General Public License as
+**     published by the Free Software Foundation; either version 2 of
+**     the License, or (at your option) any later version.
 **
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
+**     This package is distributed in the hope that it will be useful,
+**     but WITHOUT ANY WARRANTY; without even the implied warranty of
+**     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+**     General Public License for more details.
 **     \endlegal
 */
 /* ========================================================================= */
 
 #include "module.h"
 #include "general.h"
-#include <ltdl.h>
 #include <ETL/stringf>
+
+#ifndef USE_CF_BUNDLES
+#include <ltdl.h>
+#endif
+
 #endif
 
 /* === M A C R O S ========================================================= */
@@ -51,6 +56,7 @@ 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
@@ -73,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,7 +89,9 @@ Module::subsys_stop()
 {
        delete book_;
        
+#ifndef USE_CF_BUNDLES
        lt_dlexit();
+#endif
        return true;
 }
 
@@ -108,6 +116,7 @@ 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()));
@@ -117,7 +126,7 @@ synfig::Module::Register(const String &module_name, ProgressCallback *callback)
        
        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;
        }
 
@@ -174,5 +183,6 @@ synfig::Module::Register(const String &module_name, ProgressCallback *callback)
 
        if(callback)callback->task(strprintf(_("Success for \"%s\""),module_name.c_str()));
        
+#endif
        return false;
 }