module preferences plugged 14/16914/3
Cedric Delamarre [Tue, 28 Jul 2015 15:04:37 +0000 (17:04 +0200)]
Change-Id: Ib591895037b72513d1f7e7448e4c19834653d681

29 files changed:
scilab/modules/Makefile.am
scilab/modules/Makefile.in
scilab/modules/ast/includes/types/function.hxx
scilab/modules/ast/src/cpp/types/function.cpp
scilab/modules/core/Makefile.am
scilab/modules/core/Makefile.in
scilab/modules/core/src/c/InitializePreferences.c
scilab/modules/core/src/cpp/InitScilab.cpp
scilab/modules/functions_manager/functions_manager.vcxproj
scilab/modules/functions_manager/includes/dynamic_modules.hxx
scilab/modules/functions_manager/includes/module_declaration.hxx
scilab/modules/functions_manager/src/cpp/dynamic_modules.cpp
scilab/modules/functions_manager/src/cpp/funcmanager.cpp
scilab/modules/graphics/includes/graphics_gw.hxx
scilab/modules/graphics/sci_gateway/cpp/graphics_gw.cpp
scilab/modules/gui/includes/gui_gw.hxx
scilab/modules/gui/sci_gateway/cpp/gui_gw.cpp
scilab/modules/preferences/Makefile.am
scilab/modules/preferences/Makefile.in
scilab/modules/preferences/includes/gw_preferences.h [deleted file]
scilab/modules/preferences/includes/preferences_gw.hxx [new file with mode: 0644]
scilab/modules/preferences/sci_gateway/cpp/preferences_gw.cpp [new file with mode: 0644]
scilab/modules/preferences/sci_gateway/cpp/sci_addModulePreferences.cpp
scilab/modules/preferences/sci_gateway/cpp/sci_preferences.cpp
scilab/modules/preferences/sci_gateway/cpp/sci_removeModulePreferences.cpp
scilab/modules/preferences/src/c/preferences.vcxproj
scilab/modules/preferences/src/c/preferences.vcxproj.filters
scilab/modules/preferences/src/nopreferences/nopreferences.cpp [moved from scilab/modules/preferences/src/nopreferences/nopreferences.c with 67% similarity]
scilab/modules/preferences/src/nopreferences/nopreferences.h [deleted file]

index 3d55a6e..fba1bcb 100644 (file)
@@ -154,7 +154,8 @@ NO_GUI_LIBS = $(top_builddir)/modules/gui/libscigui-disable.la \
        $(top_builddir)/modules/scinotes/libsciscinotes-disable.la \
        $(top_builddir)/modules/ui_data/libsciui_data-disable.la \
        $(top_builddir)/modules/history_browser/libscihistory_browser-disable.la \
-       $(top_builddir)/modules/commons/libscicommons-disable.la
+       $(top_builddir)/modules/commons/libscicommons-disable.la \
+       $(top_builddir)/modules/preferences/libscipreferences-cli.la
 
 
 ENGINE_LIBS =  $(top_builddir)/modules/fileio/libscifileio.la \
@@ -191,8 +192,7 @@ ENGINE_LIBS =       $(top_builddir)/modules/fileio/libscifileio.la \
        $(top_builddir)/modules/functions_manager/libscifunctions_manager.la \
        $(top_builddir)/modules/types/libscitypes.la \
        $(top_builddir)/modules/xml/libscixml.la \
-       $(top_builddir)/modules/external_objects/libsciexternal_objects.la \
-       $(top_builddir)/modules/preferences/libscipreferences-cli.la
+       $(top_builddir)/modules/external_objects/libsciexternal_objects.la
 
 # These libraries are loaded dynamically from Scilab.
 ENGINE_LIBS_DYNAMIC_LOAD = \
index 5329068..d0aff21 100644 (file)
@@ -644,7 +644,8 @@ NO_GUI_LIBS = $(top_builddir)/modules/gui/libscigui-disable.la \
        $(top_builddir)/modules/scinotes/libsciscinotes-disable.la \
        $(top_builddir)/modules/ui_data/libsciui_data-disable.la \
        $(top_builddir)/modules/history_browser/libscihistory_browser-disable.la \
-       $(top_builddir)/modules/commons/libscicommons-disable.la
+       $(top_builddir)/modules/commons/libscicommons-disable.la \
+       $(top_builddir)/modules/preferences/libscipreferences-cli.la
 
 ENGINE_LIBS = $(top_builddir)/modules/fileio/libscifileio.la \
        $(top_builddir)/modules/mexlib/libmex.la \
@@ -681,7 +682,6 @@ ENGINE_LIBS = $(top_builddir)/modules/fileio/libscifileio.la \
        $(top_builddir)/modules/types/libscitypes.la \
        $(top_builddir)/modules/xml/libscixml.la \
        $(top_builddir)/modules/external_objects/libsciexternal_objects.la \
-       $(top_builddir)/modules/preferences/libscipreferences-cli.la \
        $(am__append_6)
 
 # These libraries are loaded dynamically from Scilab.
index a9f56ea..c4ac7e4 100644 (file)
@@ -44,7 +44,7 @@ public :
         EntryPointCPPOpt    = 3,
     };
 
-    typedef void (*LOAD_DEPS)(std::wstring);
+    typedef int (*LOAD_DEPS)(std::wstring);
     typedef int (*INIT_MODULE)(void);
     typedef ReturnValue (*GW_FUNC)(typed_list &in, int _iRetCount, typed_list &out);
     typedef ReturnValue (*GW_FUNC_OPT)(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out);
index a4a6df5..a0c2385 100644 (file)
@@ -100,10 +100,17 @@ Function::~Function()
 
 Function::ReturnValue Function::call(typed_list &in, optional_list &/*opt*/, int _iRetCount, typed_list &out, ast::ConstVisitor* /*execFunc*/)
 {
+    int ret = 1;
     if (m_pLoadDeps != NULL)
     {
-        m_pLoadDeps(m_wstName);
+        ret = m_pLoadDeps(m_wstName);
     }
+
+    if (ret == 0)
+    {
+        return Error;
+    }
+
     return this->m_pFunc(in, _iRetCount, out);
 }
 
@@ -147,10 +154,17 @@ InternalType* OptFunction::clone()
 
 Function::ReturnValue OptFunction::call(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out, ast::ConstVisitor* /*execFunc*/)
 {
+    int ret = 1;
     if (m_pLoadDeps != NULL)
     {
-        m_pLoadDeps(m_wstName);
+        ret = m_pLoadDeps(m_wstName);
+    }
+
+    if (ret == 0)
+    {
+        return Error;
     }
+
     return this->m_pFunc(in, opt, _iRetCount, out);
 }
 
@@ -177,9 +191,15 @@ InternalType* WrapFunction::clone()
 
 Function::ReturnValue WrapFunction::call(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out, ast::ConstVisitor* execFunc)
 {
+    int ret = 1;
     if (m_pLoadDeps != NULL)
     {
-        m_pLoadDeps(m_wstName);
+        ret = m_pLoadDeps(m_wstName);
+    }
+
+    if (ret == 0)
+    {
+        return Error;
     }
 
     ReturnValue retVal = Callable::OK;
@@ -329,9 +349,15 @@ InternalType* WrapMexFunction::clone()
 
 Function::ReturnValue WrapMexFunction::call(typed_list &in, optional_list &/*opt*/, int _iRetCount, typed_list &out, ast::ConstVisitor* /*execFunc*/)
 {
+    int ret = 1;
     if (m_pLoadDeps != NULL)
     {
-        m_pLoadDeps(m_wstName);
+        ret = m_pLoadDeps(m_wstName);
+    }
+
+    if (ret == 0)
+    {
+        return Error;
     }
 
     ReturnValue retVal = Callable::OK;
index a528fdb..2810c0c 100644 (file)
@@ -39,7 +39,8 @@ CORE_C_SOURCES = \
     src/c/getmaxMALLOC.c \
     src/c/sci_mem_alloc.c \
     src/c/hashtable/hashtable.c \
-    src/c/hashtable/hashtable_utility.c
+    src/c/hashtable/hashtable_utility.c \
+    src/c/InitializePreferences.c
 
 CORE_CPP_SOURCES = \
     src/cpp/demangle.cpp \
index 3f1bfaf..5021470 100644 (file)
@@ -206,7 +206,8 @@ am__objects_1 = src/c/libscicore_algo_la-csignal.lo \
        src/c/libscicore_algo_la-getmaxMALLOC.lo \
        src/c/libscicore_algo_la-sci_mem_alloc.lo \
        src/c/hashtable/libscicore_algo_la-hashtable.lo \
-       src/c/hashtable/libscicore_algo_la-hashtable_utility.lo
+       src/c/hashtable/libscicore_algo_la-hashtable_utility.lo \
+       src/c/libscicore_algo_la-InitializePreferences.lo
 am__objects_2 = src/cpp/libscicore_algo_la-demangle.lo \
        src/cpp/libscicore_algo_la-backtrace_print.lo \
        src/cpp/libscicore_algo_la-storeCommand.lo \
@@ -695,7 +696,8 @@ CORE_C_SOURCES = \
     src/c/getmaxMALLOC.c \
     src/c/sci_mem_alloc.c \
     src/c/hashtable/hashtable.c \
-    src/c/hashtable/hashtable_utility.c
+    src/c/hashtable/hashtable_utility.c \
+    src/c/InitializePreferences.c
 
 CORE_CPP_SOURCES = \
     src/cpp/demangle.cpp \
@@ -1093,6 +1095,8 @@ src/c/hashtable/libscicore_algo_la-hashtable.lo:  \
 src/c/hashtable/libscicore_algo_la-hashtable_utility.lo:  \
        src/c/hashtable/$(am__dirstamp) \
        src/c/hashtable/$(DEPDIR)/$(am__dirstamp)
+src/c/libscicore_algo_la-InitializePreferences.lo:  \
+       src/c/$(am__dirstamp) src/c/$(DEPDIR)/$(am__dirstamp)
 src/cpp/$(am__dirstamp):
        @$(MKDIR_P) src/cpp
        @: > src/cpp/$(am__dirstamp)
@@ -1345,6 +1349,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_who.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscicore_la-sci_with_module.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscicore_algo_la-GetXmlFileEncoding.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscicore_algo_la-InitializePreferences.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscicore_algo_la-backtrace.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscicore_algo_la-commandwords.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscicore_algo_la-csignal.Plo@am__quote@
@@ -1629,6 +1634,13 @@ src/c/hashtable/libscicore_algo_la-hashtable_utility.lo: src/c/hashtable/hashtab
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/hashtable/libscicore_algo_la-hashtable_utility.lo `test -f 'src/c/hashtable/hashtable_utility.c' || echo '$(srcdir)/'`src/c/hashtable/hashtable_utility.c
 
+src/c/libscicore_algo_la-InitializePreferences.lo: src/c/InitializePreferences.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libscicore_algo_la-InitializePreferences.lo -MD -MP -MF src/c/$(DEPDIR)/libscicore_algo_la-InitializePreferences.Tpo -c -o src/c/libscicore_algo_la-InitializePreferences.lo `test -f 'src/c/InitializePreferences.c' || echo '$(srcdir)/'`src/c/InitializePreferences.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libscicore_algo_la-InitializePreferences.Tpo src/c/$(DEPDIR)/libscicore_algo_la-InitializePreferences.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='src/c/InitializePreferences.c' object='src/c/libscicore_algo_la-InitializePreferences.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/libscicore_algo_la-InitializePreferences.lo `test -f 'src/c/InitializePreferences.c' || echo '$(srcdir)/'`src/c/InitializePreferences.c
+
 sci_gateway/c/libscicore_la-sci_type.lo: sci_gateway/c/sci_type.c
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libscicore_la-sci_type.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libscicore_la-sci_type.Tpo -c -o sci_gateway/c/libscicore_la-sci_type.lo `test -f 'sci_gateway/c/sci_type.c' || echo '$(srcdir)/'`sci_gateway/c/sci_type.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libscicore_la-sci_type.Tpo sci_gateway/c/$(DEPDIR)/libscicore_la-sci_type.Plo
index 34e6d32..a926843 100644 (file)
@@ -78,7 +78,8 @@ void InitializePreferences(int useCWD)
             // it is not true so ...
             lines = (int)atof(prefs->linesToDisplay);
             cols = (int)atof(prefs->columnsToDisplay);
-            setlines(lines, cols);
+            setConsoleLines(lines);
+            setConsoleWidth(cols);
         }
     }
 
index f80c9ae..a954f6e 100644 (file)
@@ -62,7 +62,7 @@ extern "C"
 #include "BrowseVarManager.h"
 #include "scicurdir.h"
 #include "FileBrowserChDir.h"
-
+#include "InitializePreferences.h"
 
 #ifdef _MSC_VER
 #include "InitializeWindows_tools.h"
@@ -271,6 +271,7 @@ int StartScilabEngine(ScilabEngineInfo* _pSEI)
     ConfigVariable::setStartProcessing(false);
 
     ConfigVariable::setPromptMode(0);
+    int iScript = 0;
     try
     {
         if (_pSEI->pstExec)
@@ -298,6 +299,7 @@ int StartScilabEngine(ScilabEngineInfo* _pSEI)
                 parser.setTree(NULL);
             }
             iMainRet = ConfigVariable::getExitStatus();
+            iScript = 1;
         }
         else if (_pSEI->pstFile)
         {
@@ -310,6 +312,7 @@ int StartScilabEngine(ScilabEngineInfo* _pSEI)
             iMainRet = ConfigVariable::getExitStatus();
             _pSEI->pstExec = NULL;
             _pSEI->pstFile = NULL;
+            iScript = 1;
         }
     }
     catch (const ast::ScilabException& se)
@@ -318,6 +321,9 @@ int StartScilabEngine(ScilabEngineInfo* _pSEI)
     }
 
     ConfigVariable::setPromptMode(2);
+
+    InitializePreferences(iScript);
+
     return iMainRet;
 }
 
@@ -793,54 +799,54 @@ static void stateShow(Parser::ControlStatus status)
 {
     switch (status)
     {
-        //case Parser::WithinFor:
-        //    SetTemporaryPrompt("-for       ->");
-        //    break;
-        //case Parser::WithinWhile:
-        //    SetTemporaryPrompt("-while     ->");
-        //    break;
-        //case Parser::WithinIf:
-        //    SetTemporaryPrompt("-if        ->");
-        //    break;
-        //case Parser::WithinElse:
-        //    SetTemporaryPrompt("-else      ->");
-        //    break;
-        //case Parser::WithinElseIf:
-        //    SetTemporaryPrompt("-elseif    ->");
-        //    break;
-        //case Parser::WithinTry:
-        //    SetTemporaryPrompt("-try       ->");
-        //    break;
-        //case Parser::WithinCatch:
-        //    SetTemporaryPrompt("-catch     ->");
-        //    break;
-        //case Parser::WithinFunction:
-        //    SetTemporaryPrompt("-function  ->");
-        //    break;
-        //case Parser::WithinSelect:
-        //    SetTemporaryPrompt("-select    ->");
-        //    break;
-        //case Parser::WithinCase:
-        //    SetTemporaryPrompt("-case      ->");
-        //    break;
-        //case Parser::WithinSwitch:
-        //    SetTemporaryPrompt("-switch    ->");
-        //    break;
-        //case Parser::WithinOtherwise:
-        //    SetTemporaryPrompt("-otherwise ->");
-        //    break;
-        //case Parser::WithinMatrix:
-        //    SetTemporaryPrompt("- [        ->");
-        //    break;
-        //case Parser::WithinCell:
-        //    SetTemporaryPrompt("- {        ->");
-        //    break;
-        //case Parser::WithinBlockComment:
-        //    SetTemporaryPrompt("- /*       ->");
-        //    break;
-        //case Parser::WithinDots:
-        //    SetTemporaryPrompt("- ...      ->");
-        //    break;
+            //case Parser::WithinFor:
+            //    SetTemporaryPrompt("-for       ->");
+            //    break;
+            //case Parser::WithinWhile:
+            //    SetTemporaryPrompt("-while     ->");
+            //    break;
+            //case Parser::WithinIf:
+            //    SetTemporaryPrompt("-if        ->");
+            //    break;
+            //case Parser::WithinElse:
+            //    SetTemporaryPrompt("-else      ->");
+            //    break;
+            //case Parser::WithinElseIf:
+            //    SetTemporaryPrompt("-elseif    ->");
+            //    break;
+            //case Parser::WithinTry:
+            //    SetTemporaryPrompt("-try       ->");
+            //    break;
+            //case Parser::WithinCatch:
+            //    SetTemporaryPrompt("-catch     ->");
+            //    break;
+            //case Parser::WithinFunction:
+            //    SetTemporaryPrompt("-function  ->");
+            //    break;
+            //case Parser::WithinSelect:
+            //    SetTemporaryPrompt("-select    ->");
+            //    break;
+            //case Parser::WithinCase:
+            //    SetTemporaryPrompt("-case      ->");
+            //    break;
+            //case Parser::WithinSwitch:
+            //    SetTemporaryPrompt("-switch    ->");
+            //    break;
+            //case Parser::WithinOtherwise:
+            //    SetTemporaryPrompt("-otherwise ->");
+            //    break;
+            //case Parser::WithinMatrix:
+            //    SetTemporaryPrompt("- [        ->");
+            //    break;
+            //case Parser::WithinCell:
+            //    SetTemporaryPrompt("- {        ->");
+            //    break;
+            //case Parser::WithinBlockComment:
+            //    SetTemporaryPrompt("- /*       ->");
+            //    break;
+            //case Parser::WithinDots:
+            //    SetTemporaryPrompt("- ...      ->");
+            //    break;
         default :
             SetTemporaryPrompt("  > ");
             break;
index 151db62..efdb93b 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
     <ProjectReference Include="..\polynomials\src\c\polynomials.vcxproj">
       <Project>{620d8fa7-3704-438e-bb1e-391c84401a2e}</Project>
     </ProjectReference>
+    <ProjectReference Include="..\preferences\src\c\preferences.vcxproj">
+      <Project>{7b893e9f-d032-44de-9b71-197a29c4989b}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\scinotes\src\c\scinotes.vcxproj">
       <Project>{bae68b54-2c1a-44d0-a0e9-05156a784e79}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
index 0aa96d9..bffaa9f 100644 (file)
@@ -47,7 +47,7 @@ public :
 class ScinotesModule : public GenericModule
 {
     static bool loadedDep;
-    static void LoadDeps(std::wstring _functionName);
+    static int LoadDeps(std::wstring _functionName);
 public :
     static int Load();
 };
@@ -73,7 +73,7 @@ public :
 class HelptoolsModule : public GenericModule
 {
     static bool loadedDep;
-    static void LoadDeps(std::wstring _functionName);
+    static int LoadDeps(std::wstring _functionName);
 public :
     static int Load();
 };
@@ -177,7 +177,7 @@ public :
 class XcosModule : public GenericModule
 {
     static bool loadedDep;
-    static void LoadDeps(std::wstring _functionName);
+    static int LoadDeps(std::wstring _functionName);
 public :
     static int Load();
 };
index 7a2d520..147c290 100644 (file)
@@ -53,4 +53,5 @@
 #include "../../special_functions/includes/special_functions_gw.hxx"
 #include "../../fftw/includes/fftw_gw.hxx"
 #include "../../ui_data/includes/ui_data_gw.hxx"
+#include "../../preferences/includes/preferences_gw.hxx"
 #endif /* !__MODULE_DECLARATION_HXX__ */
index 4139673..5449e49 100644 (file)
@@ -105,13 +105,15 @@ vectGateway loadGatewaysName(wstring _wstModuleName)
 //Scinotes module
 
 bool ScinotesModule::loadedDep = false;
-void ScinotesModule::LoadDeps(std::wstring _functionName)
+int ScinotesModule::LoadDeps(std::wstring _functionName)
 {
     if (loadedDep == false)
     {
         loadOnUseClassPath("SciNotes");
         loadedDep = true;
     }
+
+    return 1;
 }
 
 int ScinotesModule::Load()
@@ -197,13 +199,15 @@ int SignalProcessingModule::Load()
     return 1;
 }
 
-void HelptoolsModule::LoadDeps(std::wstring _functionName)
+int HelptoolsModule::LoadDeps(std::wstring _functionName)
 {
     if (loadedDep == false)
     {
         loadOnUseClassPath("documentationGeneration");
         loadedDep = true;
     }
+
+    return 1;
 }
 
 bool HelptoolsModule::loadedDep = false;
@@ -545,13 +549,15 @@ int ScicosModule::Load()
 }
 
 bool XcosModule::loadedDep = false;
-void XcosModule::LoadDeps(std::wstring _functionName)
+int XcosModule::LoadDeps(std::wstring _functionName)
 {
     if (loadedDep == false && _functionName != L"closeXcos")
     {
         loadOnUseClassPath("Xcos");
         loadedDep = true;
     }
+
+    return 1;
 };
 
 int XcosModule::Load()
index 91c33a7..51d60f9 100644 (file)
@@ -350,6 +350,7 @@ bool FuncManager::CreateModuleList(void)
     m_ModuleMap[L"mpi"] = pair<GW_MOD, GW_MOD>(&MPIModule::Load, &MPIModule::Unload);
     m_ModuleMap[L"external_objects"] = pair<GW_MOD, GW_MOD>(&ExternalObjectsModule::Load, &ExternalObjectsModule::Unload);
     m_ModuleMap[L"external_objects_java"] = pair<GW_MOD, GW_MOD>(&ExternalObjectsJavaModule::Load, &ExternalObjectsJavaModule::Unload);
+    m_ModuleMap[L"preferences"] = pair<GW_MOD, GW_MOD>(&PreferencesModule::Load, &PreferencesModule::Unload);
 
     if (ConfigVariable::getScilabMode() != SCILAB_NWNI)
     {
index 87f156f..5115c9d 100644 (file)
@@ -24,7 +24,7 @@ private :
 
 
 public :
-    GRAPHICS_GW_IMPEXP static void LoadDeps(std::wstring _functionName);
+    GRAPHICS_GW_IMPEXP static int LoadDeps(std::wstring _functionName);
     GRAPHICS_GW_IMPEXP static int Load();
     GRAPHICS_GW_IMPEXP static int Unload()
     {
index af33c66..90625ca 100644 (file)
@@ -27,13 +27,15 @@ using namespace types;
 
 bool GraphicsModule::loadedDep = false;
 
-void GraphicsModule::LoadDeps(std::wstring _functionName)
+int GraphicsModule::LoadDeps(std::wstring _functionName)
 {
     if (loadedDep == false)
     {
         loadOnUseClassPath("graphics");
         loadedDep = true;
     }
+
+    return 1;
 }
 
 
index 2460873..139c225 100644 (file)
@@ -22,7 +22,7 @@ private :
     GuiModule() {};
     ~GuiModule() {};
 public :
-    GUI_GW_IMPEXP static void LoadDeps(std::wstring _functionName);
+    GUI_GW_IMPEXP static int LoadDeps(std::wstring _functionName);
     GUI_GW_IMPEXP static int Load();
     GUI_GW_IMPEXP static int Unload()
     {
index 26f7368..cfd59a0 100644 (file)
@@ -25,7 +25,7 @@ using namespace types;
 
 bool GuiModule::loadedDep = false;
 
-void GuiModule::LoadDeps(std::wstring _functionName)
+int GuiModule::LoadDeps(std::wstring _functionName)
 {
     if (loadedDep == false &&
             (_functionName == L"uicontrol" ||
@@ -37,6 +37,8 @@ void GuiModule::LoadDeps(std::wstring _functionName)
         loadOnUseClassPath("graphics");
         loadedDep = true;
     }
+
+    return 1;
 }
 
 int GuiModule::Load()
index 11b2d07..1b95158 100644 (file)
@@ -50,10 +50,11 @@ PREFERENCES_JNI_SOURCES = src/jni/ScilabPreferences.cpp
 
 PREFERENCES_C_SOURCES = src/c/getScilabPreference.c
 
-GATEWAY_CXX_SOURCES = \
+GATEWAY_CPP_SOURCES = \
     sci_gateway/cpp/sci_addModulePreferences.cpp \
     sci_gateway/cpp/sci_removeModulePreferences.cpp \
-    sci_gateway/cpp/sci_preferences.cpp
+    sci_gateway/cpp/sci_preferences.cpp \
+    sci_gateway/cpp/preferences_gw.cpp
 
 libscipreferences_la_CPPFLAGS = \
     $(JAVA_JNI_INCLUDE) \
@@ -69,14 +70,13 @@ libscipreferences_la_CPPFLAGS = \
     -I$(top_srcdir)/modules/ast/includes/system_env/ \
     -I$(top_srcdir)/modules/ast/includes/types/ \
     -I$(top_srcdir)/modules/commons/src/jni/ \
-    -I$(top_srcdir)/modules/jvm/includes/ \
+       -I$(top_srcdir)/modules/localization/includes/ \
+       -I$(top_srcdir)/modules/output_stream/includes/ \
+    -I$(top_srcdir)/modules/string/includes/ \
+    -I$(top_srcdir)/modules/dynamic_link/includes/ \
     -I$(top_srcdir)/modules/fileio/includes/ \
-    -I$(top_srcdir)/modules/output_stream/includes/ \
-    -I$(top_srcdir)/modules/localization/includes/ \
     -I$(top_srcdir)/modules/api_scilab/includes/ \
-    -I$(top_srcdir)/modules/core/includes/ \
-    -I$(top_srcdir)/modules/functions/includes/ \
-    -I$(top_srcdir)/modules/string/includes/ \
+    -I$(top_srcdir)/modules/jvm/includes/ \
     $(AM_CPPFLAGS)
 
 # Without the preferences module
@@ -92,10 +92,14 @@ libscipreferences_cli_la_CPPFLAGS = \
     -I$(top_srcdir)/modules/ast/includes/analysis/ \
     -I$(top_srcdir)/modules/localization/includes/ \
     -I$(top_srcdir)/modules/output_stream/includes \
+       -I$(top_srcdir)/modules/string/includes/ \
+    -I$(top_srcdir)/modules/dynamic_link/includes/ \
     $(AM_CPPFLAGS)
 
-PREFERENCES_CLI_C_SOURCES = src/nopreferences/nopreferences.c
-libscipreferences_cli_la_SOURCES = $(PREFERENCES_CLI_C_SOURCES)
+PREFERENCES_CLI_CPP_SOURCES = src/nopreferences/nopreferences.cpp \
+                                                         sci_gateway/cpp/preferences_gw.cpp
+
+libscipreferences_cli_la_SOURCES = $(PREFERENCES_CLI_CPP_SOURCES)
 
 libscipreferences_la_LDFLAGS = $(AM_LDFLAGS)
 
@@ -108,7 +112,7 @@ endif
 
 
 libscipreferences_algo_la_SOURCES = $(PREFERENCES_C_SOURCES)
-libscipreferences_la_SOURCES = $(GATEWAY_C_SOURCES) $(GATEWAY_CXX_SOURCES)  $(PREFERENCES_JNI_SOURCES)
+libscipreferences_la_SOURCES = $(GATEWAY_C_SOURCES) $(GATEWAY_CPP_SOURCES)  $(PREFERENCES_JNI_SOURCES)
 libscipreferences_algo_la_CFLAGS = $(libscipreferences_la_CFLAGS)
 libscipreferences_algo_la_CPPFLAGS = $(libscipreferences_la_CPPFLAGS)
 
index 6f95d81..c25b931 100644 (file)
@@ -191,7 +191,8 @@ libscipreferences_algo_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
 @GUI_TRUE@am_libscipreferences_algo_la_rpath =
 libscipreferences_cli_la_DEPENDENCIES = libscipreferences-algo.la
 am__objects_2 =  \
-       src/nopreferences/libscipreferences_cli_la-nopreferences.lo
+       src/nopreferences/libscipreferences_cli_la-nopreferences.lo \
+       sci_gateway/cpp/libscipreferences_cli_la-preferences_gw.lo
 am_libscipreferences_cli_la_OBJECTS = $(am__objects_2)
 libscipreferences_cli_la_OBJECTS =  \
        $(am_libscipreferences_cli_la_OBJECTS)
@@ -201,7 +202,8 @@ libscipreferences_la_DEPENDENCIES = libscipreferences-algo.la \
        $(am__DEPENDENCIES_1)
 am__objects_3 = sci_gateway/cpp/libscipreferences_la-sci_addModulePreferences.lo \
        sci_gateway/cpp/libscipreferences_la-sci_removeModulePreferences.lo \
-       sci_gateway/cpp/libscipreferences_la-sci_preferences.lo
+       sci_gateway/cpp/libscipreferences_la-sci_preferences.lo \
+       sci_gateway/cpp/libscipreferences_la-preferences_gw.lo
 am__objects_4 = src/jni/libscipreferences_la-ScilabPreferences.lo
 am_libscipreferences_la_OBJECTS = $(am__objects_3) $(am__objects_4)
 libscipreferences_la_OBJECTS = $(am_libscipreferences_la_OBJECTS)
@@ -622,10 +624,11 @@ libscipreferences_la_src_xslt_xwizard_DATA = \
 
 PREFERENCES_JNI_SOURCES = src/jni/ScilabPreferences.cpp
 PREFERENCES_C_SOURCES = src/c/getScilabPreference.c
-GATEWAY_CXX_SOURCES = \
+GATEWAY_CPP_SOURCES = \
     sci_gateway/cpp/sci_addModulePreferences.cpp \
     sci_gateway/cpp/sci_removeModulePreferences.cpp \
-    sci_gateway/cpp/sci_preferences.cpp
+    sci_gateway/cpp/sci_preferences.cpp \
+    sci_gateway/cpp/preferences_gw.cpp
 
 libscipreferences_la_CPPFLAGS = \
     $(JAVA_JNI_INCLUDE) \
@@ -641,14 +644,13 @@ libscipreferences_la_CPPFLAGS = \
     -I$(top_srcdir)/modules/ast/includes/system_env/ \
     -I$(top_srcdir)/modules/ast/includes/types/ \
     -I$(top_srcdir)/modules/commons/src/jni/ \
-    -I$(top_srcdir)/modules/jvm/includes/ \
+       -I$(top_srcdir)/modules/localization/includes/ \
+       -I$(top_srcdir)/modules/output_stream/includes/ \
+    -I$(top_srcdir)/modules/string/includes/ \
+    -I$(top_srcdir)/modules/dynamic_link/includes/ \
     -I$(top_srcdir)/modules/fileio/includes/ \
-    -I$(top_srcdir)/modules/output_stream/includes/ \
-    -I$(top_srcdir)/modules/localization/includes/ \
     -I$(top_srcdir)/modules/api_scilab/includes/ \
-    -I$(top_srcdir)/modules/core/includes/ \
-    -I$(top_srcdir)/modules/functions/includes/ \
-    -I$(top_srcdir)/modules/string/includes/ \
+    -I$(top_srcdir)/modules/jvm/includes/ \
     $(AM_CPPFLAGS)
 
 
@@ -665,15 +667,19 @@ libscipreferences_cli_la_CPPFLAGS = \
     -I$(top_srcdir)/modules/ast/includes/analysis/ \
     -I$(top_srcdir)/modules/localization/includes/ \
     -I$(top_srcdir)/modules/output_stream/includes \
+       -I$(top_srcdir)/modules/string/includes/ \
+    -I$(top_srcdir)/modules/dynamic_link/includes/ \
     $(AM_CPPFLAGS)
 
-PREFERENCES_CLI_C_SOURCES = src/nopreferences/nopreferences.c
-libscipreferences_cli_la_SOURCES = $(PREFERENCES_CLI_C_SOURCES)
+PREFERENCES_CLI_CPP_SOURCES = src/nopreferences/nopreferences.cpp \
+                                                         sci_gateway/cpp/preferences_gw.cpp
+
+libscipreferences_cli_la_SOURCES = $(PREFERENCES_CLI_CPP_SOURCES)
 libscipreferences_la_LDFLAGS = $(AM_LDFLAGS)
 pkglib_LTLIBRARIES = libscipreferences-cli.la $(am__append_1)
 @GUI_TRUE@noinst_LTLIBRARIES = libscipreferences-algo.la
 libscipreferences_algo_la_SOURCES = $(PREFERENCES_C_SOURCES)
-libscipreferences_la_SOURCES = $(GATEWAY_C_SOURCES) $(GATEWAY_CXX_SOURCES)  $(PREFERENCES_JNI_SOURCES)
+libscipreferences_la_SOURCES = $(GATEWAY_C_SOURCES) $(GATEWAY_CPP_SOURCES)  $(PREFERENCES_JNI_SOURCES)
 libscipreferences_algo_la_CFLAGS = $(libscipreferences_la_CFLAGS)
 libscipreferences_algo_la_CPPFLAGS = $(libscipreferences_la_CPPFLAGS)
 
@@ -865,15 +871,18 @@ src/nopreferences/$(DEPDIR)/$(am__dirstamp):
 src/nopreferences/libscipreferences_cli_la-nopreferences.lo:  \
        src/nopreferences/$(am__dirstamp) \
        src/nopreferences/$(DEPDIR)/$(am__dirstamp)
-
-libscipreferences-cli.la: $(libscipreferences_cli_la_OBJECTS) $(libscipreferences_cli_la_DEPENDENCIES) $(EXTRA_libscipreferences_cli_la_DEPENDENCIES) 
-       $(AM_V_CCLD)$(LINK) -rpath $(pkglibdir) $(libscipreferences_cli_la_OBJECTS) $(libscipreferences_cli_la_LIBADD) $(LIBS)
 sci_gateway/cpp/$(am__dirstamp):
        @$(MKDIR_P) sci_gateway/cpp
        @: > sci_gateway/cpp/$(am__dirstamp)
 sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp):
        @$(MKDIR_P) sci_gateway/cpp/$(DEPDIR)
        @: > sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/cpp/libscipreferences_cli_la-preferences_gw.lo:  \
+       sci_gateway/cpp/$(am__dirstamp) \
+       sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
+
+libscipreferences-cli.la: $(libscipreferences_cli_la_OBJECTS) $(libscipreferences_cli_la_DEPENDENCIES) $(EXTRA_libscipreferences_cli_la_DEPENDENCIES) 
+       $(AM_V_CXXLD)$(CXXLINK) -rpath $(pkglibdir) $(libscipreferences_cli_la_OBJECTS) $(libscipreferences_cli_la_LIBADD) $(LIBS)
 sci_gateway/cpp/libscipreferences_la-sci_addModulePreferences.lo:  \
        sci_gateway/cpp/$(am__dirstamp) \
        sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
@@ -883,6 +892,9 @@ sci_gateway/cpp/libscipreferences_la-sci_removeModulePreferences.lo:  \
 sci_gateway/cpp/libscipreferences_la-sci_preferences.lo:  \
        sci_gateway/cpp/$(am__dirstamp) \
        sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/cpp/libscipreferences_la-preferences_gw.lo:  \
+       sci_gateway/cpp/$(am__dirstamp) \
+       sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
 src/jni/$(am__dirstamp):
        @$(MKDIR_P) src/jni
        @: > src/jni/$(am__dirstamp)
@@ -909,6 +921,8 @@ mostlyclean-compile:
 distclean-compile:
        -rm -f *.tab.c
 
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscipreferences_cli_la-preferences_gw.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscipreferences_la-preferences_gw.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscipreferences_la-sci_addModulePreferences.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscipreferences_la-sci_preferences.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscipreferences_la-sci_removeModulePreferences.Plo@am__quote@
@@ -947,13 +961,6 @@ src/c/libscipreferences_algo_la-getScilabPreference.lo: src/c/getScilabPreferenc
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscipreferences_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscipreferences_algo_la_CFLAGS) $(CFLAGS) -c -o src/c/libscipreferences_algo_la-getScilabPreference.lo `test -f 'src/c/getScilabPreference.c' || echo '$(srcdir)/'`src/c/getScilabPreference.c
 
-src/nopreferences/libscipreferences_cli_la-nopreferences.lo: src/nopreferences/nopreferences.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscipreferences_cli_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/nopreferences/libscipreferences_cli_la-nopreferences.lo -MD -MP -MF src/nopreferences/$(DEPDIR)/libscipreferences_cli_la-nopreferences.Tpo -c -o src/nopreferences/libscipreferences_cli_la-nopreferences.lo `test -f 'src/nopreferences/nopreferences.c' || echo '$(srcdir)/'`src/nopreferences/nopreferences.c
-@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/nopreferences/$(DEPDIR)/libscipreferences_cli_la-nopreferences.Tpo src/nopreferences/$(DEPDIR)/libscipreferences_cli_la-nopreferences.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='src/nopreferences/nopreferences.c' object='src/nopreferences/libscipreferences_cli_la-nopreferences.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscipreferences_cli_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/nopreferences/libscipreferences_cli_la-nopreferences.lo `test -f 'src/nopreferences/nopreferences.c' || echo '$(srcdir)/'`src/nopreferences/nopreferences.c
-
 .cpp.o:
 @am__fastdepCXX_TRUE@  $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
 @am__fastdepCXX_TRUE@  $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
@@ -978,6 +985,20 @@ src/nopreferences/libscipreferences_cli_la-nopreferences.lo: src/nopreferences/n
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
 
+src/nopreferences/libscipreferences_cli_la-nopreferences.lo: src/nopreferences/nopreferences.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscipreferences_cli_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/nopreferences/libscipreferences_cli_la-nopreferences.lo -MD -MP -MF src/nopreferences/$(DEPDIR)/libscipreferences_cli_la-nopreferences.Tpo -c -o src/nopreferences/libscipreferences_cli_la-nopreferences.lo `test -f 'src/nopreferences/nopreferences.cpp' || echo '$(srcdir)/'`src/nopreferences/nopreferences.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) src/nopreferences/$(DEPDIR)/libscipreferences_cli_la-nopreferences.Tpo src/nopreferences/$(DEPDIR)/libscipreferences_cli_la-nopreferences.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='src/nopreferences/nopreferences.cpp' object='src/nopreferences/libscipreferences_cli_la-nopreferences.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscipreferences_cli_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/nopreferences/libscipreferences_cli_la-nopreferences.lo `test -f 'src/nopreferences/nopreferences.cpp' || echo '$(srcdir)/'`src/nopreferences/nopreferences.cpp
+
+sci_gateway/cpp/libscipreferences_cli_la-preferences_gw.lo: sci_gateway/cpp/preferences_gw.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscipreferences_cli_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libscipreferences_cli_la-preferences_gw.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libscipreferences_cli_la-preferences_gw.Tpo -c -o sci_gateway/cpp/libscipreferences_cli_la-preferences_gw.lo `test -f 'sci_gateway/cpp/preferences_gw.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/preferences_gw.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libscipreferences_cli_la-preferences_gw.Tpo sci_gateway/cpp/$(DEPDIR)/libscipreferences_cli_la-preferences_gw.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='sci_gateway/cpp/preferences_gw.cpp' object='sci_gateway/cpp/libscipreferences_cli_la-preferences_gw.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscipreferences_cli_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libscipreferences_cli_la-preferences_gw.lo `test -f 'sci_gateway/cpp/preferences_gw.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/preferences_gw.cpp
+
 sci_gateway/cpp/libscipreferences_la-sci_addModulePreferences.lo: sci_gateway/cpp/sci_addModulePreferences.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscipreferences_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libscipreferences_la-sci_addModulePreferences.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libscipreferences_la-sci_addModulePreferences.Tpo -c -o sci_gateway/cpp/libscipreferences_la-sci_addModulePreferences.lo `test -f 'sci_gateway/cpp/sci_addModulePreferences.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_addModulePreferences.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libscipreferences_la-sci_addModulePreferences.Tpo sci_gateway/cpp/$(DEPDIR)/libscipreferences_la-sci_addModulePreferences.Plo
@@ -999,6 +1020,13 @@ sci_gateway/cpp/libscipreferences_la-sci_preferences.lo: sci_gateway/cpp/sci_pre
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscipreferences_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libscipreferences_la-sci_preferences.lo `test -f 'sci_gateway/cpp/sci_preferences.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_preferences.cpp
 
+sci_gateway/cpp/libscipreferences_la-preferences_gw.lo: sci_gateway/cpp/preferences_gw.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscipreferences_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libscipreferences_la-preferences_gw.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libscipreferences_la-preferences_gw.Tpo -c -o sci_gateway/cpp/libscipreferences_la-preferences_gw.lo `test -f 'sci_gateway/cpp/preferences_gw.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/preferences_gw.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libscipreferences_la-preferences_gw.Tpo sci_gateway/cpp/$(DEPDIR)/libscipreferences_la-preferences_gw.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='sci_gateway/cpp/preferences_gw.cpp' object='sci_gateway/cpp/libscipreferences_la-preferences_gw.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscipreferences_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libscipreferences_la-preferences_gw.lo `test -f 'sci_gateway/cpp/preferences_gw.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/preferences_gw.cpp
+
 src/jni/libscipreferences_la-ScilabPreferences.lo: src/jni/ScilabPreferences.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscipreferences_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/jni/libscipreferences_la-ScilabPreferences.lo -MD -MP -MF src/jni/$(DEPDIR)/libscipreferences_la-ScilabPreferences.Tpo -c -o src/jni/libscipreferences_la-ScilabPreferences.lo `test -f 'src/jni/ScilabPreferences.cpp' || echo '$(srcdir)/'`src/jni/ScilabPreferences.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) src/jni/$(DEPDIR)/libscipreferences_la-ScilabPreferences.Tpo src/jni/$(DEPDIR)/libscipreferences_la-ScilabPreferences.Plo
diff --git a/scilab/modules/preferences/includes/gw_preferences.h b/scilab/modules/preferences/includes/gw_preferences.h
deleted file mode 100644 (file)
index 31ebdf1..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
-* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-* Copyright (C) 2011 - DIGITEO - Calixte DENIZET
-*
-* This file must be used under the terms of the CeCILL.
-* This source file is licensed as described in the file COPYING, which
-* you should have received as part of this distribution.  The terms
-* are also available at
-* http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
-*
-*/
-
-#ifndef __GW_PREFERENCES__
-#define __GW_PREFERENCES__
-/*--------------------------------------------------------------------------*/
-#include "dynlib_preferences_scilab.h"
-/*--------------------------------------------------------------------------*/
-PREFERENCES_SCILAB_IMPEXP int gw_preferences(void);
-int sci_addModulePreferences(char * fname, unsigned long l);
-int sci_removeModulePreferences(char * fname, unsigned long l);
-int sci_preferences(char * fname, unsigned long l);
-/*--------------------------------------------------------------------------*/
-#endif /* __GW_PREFERENCES__ */
-/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/preferences/includes/preferences_gw.hxx b/scilab/modules/preferences/includes/preferences_gw.hxx
new file mode 100644 (file)
index 0000000..7671c69
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+*  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+*  Copyright (C) 2015 - Scilab Enterprises - Cedric Delamarre
+*
+*  This file must be used under the terms of the CeCILL.
+*  This source file is licensed as described in the file COPYING, which
+*  you should have received as part of this distribution.  The terms
+*  are also available at
+*  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+*
+*/
+
+#ifndef __PREFERENCES_GW_HXX__
+#define __PREFERENCES_GW_HXX__
+
+#include <string>
+#include "c_gateway_prototype.h"
+#include "dynlib_preferences_scilab.h"
+
+class PreferencesModule
+{
+private :
+    PreferencesModule() {};
+    ~PreferencesModule() {};
+public :
+    PREFERENCES_SCILAB_IMPEXP  static int LoadDeps(std::wstring _functionName);
+    PREFERENCES_SCILAB_IMPEXP static int Load();
+    PREFERENCES_SCILAB_IMPEXP static int Unload()
+    {
+        return 1;
+    }
+};
+
+C_GATEWAY_PROTOTYPE(sci_addModulePreferences);
+C_GATEWAY_PROTOTYPE(sci_removeModulePreferences);
+C_GATEWAY_PROTOTYPE(sci_preferences);
+
+#endif /* __PREFERENCES_GW_HXX__ */
diff --git a/scilab/modules/preferences/sci_gateway/cpp/preferences_gw.cpp b/scilab/modules/preferences/sci_gateway/cpp/preferences_gw.cpp
new file mode 100644 (file)
index 0000000..bf3b1ca
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ *  Copyright (C) 2015 - Scilab Enterprises - Cedric Delamarre
+ *
+ *  This file must be used under the terms of the CeCILL.
+ *  This source file is licensed as described in the file COPYING, which
+ *  you should have received as part of this distribution.  The terms
+ *  are also available at
+ *  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+
+#include "preferences_gw.hxx"
+#include "function.hxx"
+#include "context.hxx"
+#include "configvariable.hxx"
+#include "Scierror.h"
+
+#define MODULE_NAME L"preferences"
+
+using namespace types;
+
+int PreferencesModule::LoadDeps(std::wstring _functionName)
+{
+    if (ConfigVariable::getScilabMode() == SCILAB_NWNI)
+    {
+        Scierror(999, _("Scilab '%s' module disabled in -nogui or -nwni mode.\n"), "preferences");
+        return 0;
+    }
+
+    return 1;
+}
+
+int PreferencesModule::Load()
+{
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"addModulePreferences", &sci_addModulePreferences, &PreferencesModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"removeModulePreferences", &sci_removeModulePreferences, &PreferencesModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"preferences", &sci_preferences, &PreferencesModule::LoadDeps, MODULE_NAME));
+    return 1;
+}
index 35cc440..1a1e32d 100644 (file)
 
 #include "ScilabPreferences.hxx"
 #include "GiwsException.hxx"
+#include "preferences_gw.hxx"
 
 extern "C"
 {
-#include "gw_preferences.h"
 #include "Scierror.h"
 #include "api_scilab.h"
 #include "localization.h"
index b6fac3d..3c5c03e 100644 (file)
 
 #include "ScilabPreferences.hxx"
 #include "GiwsException.hxx"
+#include "preferences_gw.hxx"
 
 extern "C"
 {
-#include "gw_preferences.h"
 #include "Scierror.h"
 #include "api_scilab.h"
 #include "localization.h"
index ce69324..7d99fa0 100644 (file)
 
 #include "ScilabPreferences.hxx"
 #include "GiwsException.hxx"
+#include "preferences_gw.hxx"
 
 extern "C"
 {
-#include "gw_preferences.h"
 #include "Scierror.h"
 #include "api_scilab.h"
 #include "localization.h"
index fcc3486..d6aefeb 100644 (file)
@@ -81,7 +81,7 @@
     <ClCompile>
       <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>../../includes;.;../jni;../cpp;$(SCILAB_JDK32)/include;$(SCILAB_JDK32)/include/win32;../../../../libs/intl;../../../../libs/libxml2;../../../api_scilab/includes;../../../core/includes;../../../localization/includes;../../../jvm/includes;../../../fileio/includes;../../../output_stream/includes;../../../commons/src/jni;../../../string/includes;../../../windows_tools/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;.;../jni;../cpp;$(SCILAB_JDK32)/include;$(SCILAB_JDK32)/include/win32;../../../../libs/intl;../../../../libs/libxml2;../../../api_scilab/includes;../../../core/includes;../../../localization/includes;../../../jvm/includes;../../../fileio/includes;../../../output_stream/includes;../../../commons/src/jni;../../../string/includes;../../../windows_tools/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;../../../dynamic_link/includes;../../../threads/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;PREFERENCES_SCILAB_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>Default</BasicRuntimeChecks>
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>../../includes;.;../jni;../cpp;$(SCILAB_JDK64)/include;$(SCILAB_JDK64)/include/win32;../../../../libs/intl;../../../../libs/libxml2;../../../api_scilab/includes;../../../core/includes;../../../localization/includes;../../../jvm/includes;../../../fileio/includes;../../../output_stream/includes;../../../commons/src/jni;../../../string/includes;../../../windows_tools/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;.;../jni;../cpp;$(SCILAB_JDK64)/include;$(SCILAB_JDK64)/include/win32;../../../../libs/intl;../../../../libs/libxml2;../../../api_scilab/includes;../../../core/includes;../../../localization/includes;../../../jvm/includes;../../../fileio/includes;../../../output_stream/includes;../../../commons/src/jni;../../../string/includes;../../../windows_tools/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;../../../dynamic_link/includes;../../../threads/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;PREFERENCES_SCILAB_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>Default</BasicRuntimeChecks>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>../../includes;.;../jni;../cpp;$(SCILAB_JDK32)/include;$(SCILAB_JDK32)/include/win32;../../../../libs/intl;../../../../libs/libxml2;../../../api_scilab/includes;../../../core/includes;../../../localization/includes;../../../jvm/includes;../../../fileio/includes;../../../output_stream/includes;../../../commons/src/jni;../../../string/includes;../../../windows_tools/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;.;../jni;../cpp;$(SCILAB_JDK32)/include;$(SCILAB_JDK32)/include/win32;../../../../libs/intl;../../../../libs/libxml2;../../../api_scilab/includes;../../../core/includes;../../../localization/includes;../../../jvm/includes;../../../fileio/includes;../../../output_stream/includes;../../../commons/src/jni;../../../string/includes;../../../windows_tools/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;../../../dynamic_link/includes;../../../threads/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;PREFERENCES_SCILAB_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>../../includes;.;../jni;../cpp;$(SCILAB_JDK64)/include;$(SCILAB_JDK64)/include/win32;../../../../libs/intl;../../../../libs/libxml2;../../../api_scilab/includes;../../../core/includes;../../../localization/includes;../../../jvm/includes;../../../fileio/includes;../../../output_stream/includes;../../../commons/src/jni;../../../string/includes;../../../windows_tools/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;.;../jni;../cpp;$(SCILAB_JDK64)/include;$(SCILAB_JDK64)/include/win32;../../../../libs/intl;../../../../libs/libxml2;../../../api_scilab/includes;../../../core/includes;../../../localization/includes;../../../jvm/includes;../../../fileio/includes;../../../output_stream/includes;../../../commons/src/jni;../../../string/includes;../../../windows_tools/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;../../../dynamic_link/includes;../../../threads/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;PREFERENCES_SCILAB_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
     </ProjectReference>
   </ItemGroup>
   <ItemGroup>
+    <ClCompile Include="..\..\sci_gateway\cpp\preferences_gw.cpp" />
     <ClCompile Include="..\..\sci_gateway\cpp\sci_addModulePreferences.cpp" />
     <ClCompile Include="..\..\sci_gateway\cpp\sci_preferences.cpp" />
     <ClCompile Include="..\..\sci_gateway\cpp\sci_removeModulePreferences.cpp" />
   <ItemGroup>
     <ClInclude Include="..\..\includes\dynlib_preferences_scilab.h" />
     <ClInclude Include="..\..\includes\getScilabPreference.h" />
-    <ClInclude Include="..\..\includes\gw_preferences.h" />
+    <ClInclude Include="..\..\includes\preferences_gw.hxx" />
     <ClInclude Include="..\jni\ScilabPreferences.hxx" />
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
index 39f8745..2f6acbe 100644 (file)
@@ -54,6 +54,9 @@
     <ClCompile Include="..\..\sci_gateway\cpp\sci_preferences.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\sci_gateway\cpp\preferences_gw.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\jni\ScilabPreferences.hxx">
     <ClInclude Include="..\..\includes\dynlib_preferences_scilab.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\includes\gw_preferences.h">
+    <ClInclude Include="..\..\includes\getScilabPreference.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\includes\getScilabPreference.h">
+    <ClInclude Include="..\..\includes\preferences_gw.hxx">
       <Filter>Header Files</Filter>
     </ClInclude>
   </ItemGroup>
  *
  */
 /*--------------------------------------------------------------------------*/
-#include "nopreferences.h"
+#include "preferences_gw.hxx"
+extern "C"
+{
 #include "Scierror.h"
 #include "localization.h"
+}
 /*--------------------------------------------------------------------------*/
 int gw_preferences(void)
 {
@@ -20,3 +23,16 @@ int gw_preferences(void)
     return 0;
 }
 /*--------------------------------------------------------------------------*/
+int sci_addModulePreferences(char * fname, void *pvApiCtx)
+{
+    return gw_preferences();
+}
+int sci_preferences(char * fname, void *pvApiCtx)
+{
+    return gw_preferences();
+}
+int sci_removeModulePreferences(char * fname, void *pvApiCtx)
+{
+    return gw_preferences();
+}
+/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/preferences/src/nopreferences/nopreferences.h b/scilab/modules/preferences/src/nopreferences/nopreferences.h
deleted file mode 100644 (file)
index 25d386f..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2011 - DIGITEO - Calixte DENIZET
- *
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution.  The terms
- * are also available at
- * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
- *
- */
-/*--------------------------------------------------------------------------*/
-int gw_preferences(void);
-/*--------------------------------------------------------------------------*/