add parameter to loadDeps function 03/14803/2
Antoine ELIAS [Thu, 3 Jul 2014 15:53:05 +0000 (17:53 +0200)]
Change-Id: I5b9c93287bbe97fb8d56e39a413b6b456db8eb68

scilab/modules/functions_manager/functions_manager.vcxproj
scilab/modules/functions_manager/includes/dynamic_modules.hxx
scilab/modules/functions_manager/src/cpp/dynamic_modules.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/types/includes/function.hxx
scilab/modules/types/src/cpp/function.cpp

index f5def15..4bfd737 100644 (file)
@@ -76,7 +76,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>includes;../types/includes;../core/includes;../system_env/includes;../../libs/libxml2;../symbol/includes;../operations/includes;../ast/includes;../fileio/includes;../parse/includes;../localization/includes;../../libs/intl;../output_stream/includes;../string/includes;../api_scilab/includes;../threads/includes;../jvm/includes;../../libs/Eigen/includes;../console/includes;../dynamic_link/includes;../ast/includes/exps;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>includes;../types/includes;../core/includes;../system_env/includes;../../libs/libxml2;../symbol/includes;../operations/includes;../ast/includes;../fileio/includes;../parse/includes;../localization/includes;../../libs/intl;../output_stream/includes;../string/includes;../api_scilab/includes;../threads/includes;../jvm/includes;../../libs/Eigen/includes;../console/includes;../dynamic_link/includes;../ast/includes/exps;../xcos/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;FUNC_MAN_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>includes;../types/includes;../core/includes;../system_env/includes;../../libs/libxml2;../symbol/includes;../operations/includes;../ast/includes;../fileio/includes;../parse/includes;../localization/includes;../../libs/intl;../output_stream/includes;../string/includes;../api_scilab/includes;../threads/includes;../jvm/includes;../../libs/Eigen/includes;../console/includes;../dynamic_link/includes;../ast/includes/exps;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>includes;../types/includes;../core/includes;../system_env/includes;../../libs/libxml2;../symbol/includes;../operations/includes;../ast/includes;../fileio/includes;../parse/includes;../localization/includes;../../libs/intl;../output_stream/includes;../string/includes;../api_scilab/includes;../threads/includes;../jvm/includes;../../libs/Eigen/includes;../console/includes;../dynamic_link/includes;../ast/includes/exps;../xcos/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;FUNC_MAN_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>includes;../types/includes;../core/includes;../system_env/includes;../../libs/libxml2;../symbol/includes;../operations/includes;../ast/includes;../fileio/includes;../parse/includes;../localization/includes;../../libs/intl;../output_stream/includes;../string/includes;../api_scilab/includes;../threads/includes;../jvm/includes;../../libs/Eigen/includes;../console/includes;../dynamic_link/includes;../ast/includes/exps;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>includes;../types/includes;../core/includes;../system_env/includes;../../libs/libxml2;../symbol/includes;../operations/includes;../ast/includes;../fileio/includes;../parse/includes;../localization/includes;../../libs/intl;../output_stream/includes;../string/includes;../api_scilab/includes;../threads/includes;../jvm/includes;../../libs/Eigen/includes;../console/includes;../dynamic_link/includes;../ast/includes/exps;../xcos/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;FUNC_MAN_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <FunctionLevelLinking>true</FunctionLevelLinking>
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>includes;../types/includes;../core/includes;../system_env/includes;../../libs/libxml2;../symbol/includes;../operations/includes;../ast/includes;../fileio/includes;../parse/includes;../localization/includes;../../libs/intl;../output_stream/includes;../string/includes;../api_scilab/includes;../threads/includes;../jvm/includes;../../libs/Eigen/includes;../console/includes;../dynamic_link/includes;../ast/includes/exps;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>includes;../types/includes;../core/includes;../system_env/includes;../../libs/libxml2;../symbol/includes;../operations/includes;../ast/includes;../fileio/includes;../parse/includes;../localization/includes;../../libs/intl;../output_stream/includes;../string/includes;../api_scilab/includes;../threads/includes;../jvm/includes;../../libs/Eigen/includes;../console/includes;../dynamic_link/includes;../ast/includes/exps;../xcos/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;FUNC_MAN_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <FunctionLevelLinking>true</FunctionLevelLinking>
index d9b6823..24ac380 100644 (file)
@@ -47,7 +47,7 @@ public :
 class ScinotesModule : public GenericModule
 {
     static bool loadedDep;
-    static void LoadDeps(void);
+    static void LoadDeps(std::wstring _functionName);
 public :
     static int Load();
 };
@@ -73,7 +73,7 @@ public :
 class HelptoolsModule : public GenericModule
 {
     static bool loadedDep;
-    static void LoadDeps(void);
+    static void LoadDeps(std::wstring _functionName);
 public :
     static int Load();
 };
@@ -177,7 +177,7 @@ public :
 class XcosModule : public GenericModule
 {
     static bool loadedDep;
-    static void LoadDeps(void);
+    static void LoadDeps(std::wstring _functionName);
 public :
     static int Load();
 };
index a687ab8..9b35ee7 100644 (file)
@@ -104,7 +104,7 @@ vectGateway loadGatewaysName(wstring _wstModuleName)
 //Scinotes module
 
 bool ScinotesModule::loadedDep = false;
-void ScinotesModule::LoadDeps(void)
+void ScinotesModule::LoadDeps(std::wstring _functionName)
 {
     if (loadedDep == false)
     {
@@ -196,7 +196,7 @@ int SignalProcessingModule::Load()
     return 1;
 }
 
-void HelptoolsModule::LoadDeps(void)
+void HelptoolsModule::LoadDeps(std::wstring _functionName)
 {
     if (loadedDep == false)
     {
@@ -539,9 +539,9 @@ int ScicosModule::Load()
 }
 
 bool XcosModule::loadedDep = false;
-void XcosModule::LoadDeps(void)
+void XcosModule::LoadDeps(std::wstring _functionName)
 {
-    if (loadedDep == false)
+    if (loadedDep == false && _functionName != L"closeXcos")
     {
         loadOnUseClassPath("Xcos");
         loadedDep = true;
index ee52b37..45fa370 100644 (file)
@@ -24,7 +24,7 @@ private :
 
 
 public :
-    GRAPHICS_GW_IMPEXP static void LoadDeps(void);
+    GRAPHICS_GW_IMPEXP static void LoadDeps(std::wstring _functionName);
     GRAPHICS_GW_IMPEXP static int Load();
     GRAPHICS_GW_IMPEXP static int Unload()
     {
index ca5b026..bfd6ebe 100644 (file)
@@ -27,7 +27,7 @@ using namespace types;
 
 bool GraphicsModule::loadedDep = false;
 
-void GraphicsModule::LoadDeps(void)
+void GraphicsModule::LoadDeps(std::wstring _functionName)
 {
     if (loadedDep == false)
     {
index 710c05e..a0fe367 100644 (file)
@@ -22,7 +22,7 @@ private :
     GuiModule() {};
     ~GuiModule() {};
 public :
-    GUI_GW_IMPEXP static void LoadDeps(void);
+    GUI_GW_IMPEXP static void LoadDeps(std::wstring _functionName);
     GUI_GW_IMPEXP static int Load();
     GUI_GW_IMPEXP static int Unload()
     {
index eafdb67..928e1ad 100644 (file)
@@ -25,7 +25,7 @@ using namespace types;
 
 bool GuiModule::loadedDep = false;
 
-void GuiModule::LoadDeps(void)
+void GuiModule::LoadDeps(std::wstring _functionName)
 {
     if (loadedDep == false)
     {
@@ -33,6 +33,7 @@ void GuiModule::LoadDeps(void)
         loadedDep = true;
     }
 }
+
 int GuiModule::Load()
 {
     symbol::Context::getInstance()->addFunction(Function::createFunction(L"x_dialog", &sci_x_dialog, &GuiModule::LoadDeps, MODULE_NAME));
index 0933478..67d6539 100644 (file)
@@ -45,7 +45,7 @@ public :
         EntryPointCPPOpt    = 3,
     };
 
-    typedef void (*LOAD_DEPS)(void);
+    typedef void (*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 05e7d3a..26f1684 100644 (file)
@@ -96,7 +96,7 @@ Function::ReturnValue Function::call(typed_list &in, optional_list &opt, int _iR
 {
     if (m_pLoadDeps != NULL)
     {
-        m_pLoadDeps();
+        m_pLoadDeps(m_wstName);
     }
     return this->m_pFunc(in, _iRetCount, out);
 }
@@ -145,7 +145,7 @@ Function::ReturnValue OptFunction::call(typed_list &in, optional_list &opt, int
 {
     if (m_pLoadDeps != NULL)
     {
-        m_pLoadDeps();
+        m_pLoadDeps(m_wstName);
     }
     return this->m_pFunc(in, opt, _iRetCount, out);
 }
@@ -175,7 +175,7 @@ Function::ReturnValue WrapFunction::call(typed_list &in, optional_list &opt, int
 {
     if (m_pLoadDeps != NULL)
     {
-        m_pLoadDeps();
+        m_pLoadDeps(m_wstName);
     }
 
     ReturnValue retVal = Callable::OK;
@@ -325,7 +325,7 @@ Function::ReturnValue WrapMexFunction::call(typed_list &in, optional_list &opt,
 {
     if (m_pLoadDeps != NULL)
     {
-        m_pLoadDeps();
+        m_pLoadDeps(m_wstName);
     }
 
     ReturnValue retVal = Callable::OK;