replug ui_data 34/16234/4
Antoine ELIAS [Tue, 24 Mar 2015 16:11:21 +0000 (17:11 +0100)]
Change-Id: I5275e0fb52ea9b4cb9dde2a66a4670c47fa372ba

44 files changed:
scilab/etc/scilab.start
scilab/modules/api_scilab/src/cpp/api_common.cpp
scilab/modules/api_scilab/src/cpp/api_list.cpp
scilab/modules/ast/includes/symbol/context.hxx
scilab/modules/ast/includes/symbol/libraries.hxx
scilab/modules/ast/includes/symbol/variables.hxx
scilab/modules/ast/src/cpp/symbol/context.cpp
scilab/modules/console/Makefile.am
scilab/modules/console/Makefile.in
scilab/modules/console/includes/GetCommandLine.h [deleted file]
scilab/modules/console/src/c/GetCommandLine.c [deleted file]
scilab/modules/console/src/c/console.vcxproj
scilab/modules/console/src/c/console.vcxproj.filters
scilab/modules/console/src/noconsole/noconsole.vcxproj
scilab/modules/console/src/noconsole/noconsole.vcxproj.filters
scilab/modules/core/Makefile.am
scilab/modules/core/Makefile.in
scilab/modules/core/src/c/core.vcxproj
scilab/modules/core/src/cpp/InitScilab.cpp
scilab/modules/functions_manager/functions_manager.vcxproj
scilab/modules/functions_manager/includes/module_declaration.hxx
scilab/modules/functions_manager/src/cpp/funcmanager.cpp
scilab/modules/ui_data/Makefile.am
scilab/modules/ui_data/Makefile.in
scilab/modules/ui_data/includes/BrowseVarManager.h
scilab/modules/ui_data/includes/gw_ui_data.h [deleted file]
scilab/modules/ui_data/includes/ui_data_gw.hxx [new file with mode: 0644]
scilab/modules/ui_data/sci_gateway/c/gw_ui_data.c [deleted file]
scilab/modules/ui_data/sci_gateway/cpp/sci_browsevar.cpp
scilab/modules/ui_data/sci_gateway/cpp/sci_closeEditvar.cpp
scilab/modules/ui_data/sci_gateway/cpp/sci_editvar.cpp
scilab/modules/ui_data/sci_gateway/cpp/sci_filebrowser.cpp
scilab/modules/ui_data/sci_gateway/cpp/sci_updatebrowsevar.cpp
scilab/modules/ui_data/sci_gateway/cpp/ui_data_gw.cpp [new file with mode: 0644]
scilab/modules/ui_data/sci_gateway/ui_data_gateway.xml [deleted file]
scilab/modules/ui_data/src/c/ui_data.vcxproj
scilab/modules/ui_data/src/c/ui_data.vcxproj.filters
scilab/modules/ui_data/src/cpp/BrowseVarManager.cpp
scilab/modules/ui_data/src/noui_data/noui_data.c
scilab/modules/ui_data/src/noui_data/noui_data.vcxproj
scilab/modules/ui_data/src/noui_data/noui_data.vcxproj.filters
scilab/modules/ui_data/src/noui_data/noui_data_gw.cpp [new file with mode: 0644]
scilab/modules/ui_data/tests/nonreg_tests/bug_8628.dia.ref
scilab/modules/ui_data/tests/nonreg_tests/bug_8628.tst

index 6cdf47d..d916575 100644 (file)
@@ -118,8 +118,7 @@ if sciargs()<>"-nouserstartup" then
       end
   end
 
-  clear i;
-  clear startupfiles;
+  clear i startupfiles workingfiles workingDirectory;
 end
 
 // Menus/toolbar can now be enabled ====================================
index cd99278..ae75349 100644 (file)
@@ -555,10 +555,13 @@ SciErr getVarType(void *_pvCtx, int *_piAddress, int *_piType)
         case GenericType::ScilabImplicitList :
             *_piType = sci_implicit_poly;
             break;
-        case GenericType::ScilabFunction :
+        case GenericType::ScilabFunction:
             *_piType = sci_intrinsic_function;
             break;
-        default :
+        case GenericType::ScilabLibrary:
+            *_piType = sci_lib;
+            break;
+        default:
             *_piType = 0;
     }
 
index fec0bea..9972360 100644 (file)
@@ -149,13 +149,6 @@ SciErr checkListItemPosition(void* _pvCtx, int* _piParent, int _iItemPos, int _a
     SciErr sciErr = sciErrInit();
     int iItem = 0;
 
-    // check a valid pointer
-    if (_pvCtx == NULL)
-    {
-        addErrorMessage(&sciErr, API_ERROR_INVALID_POINTER, _("%s: Invalid argument address"), _functionName);
-        return sciErr;
-    }
-
     // get a number of items
     sciErr = getListItemNumber(_pvCtx, _piParent, &iItem);
     if (sciErr.iErr)
index 1873ba7..317b704 100644 (file)
@@ -74,14 +74,15 @@ public :
     /*return function list in the module _stModuleName*/
     std::list<Symbol>* getFunctionList(std::wstring _stModuleName);
 
-    std::list<std::wstring>* getVarsName();
-    std::list<std::wstring>* getMacrosName();
-    std::list<std::wstring>* getFunctionsName();
-    std::list<std::wstring>* getVarsNameForWho(bool sorted);
-    std::list<std::wstring>* getGlobalNameForWho(bool sorted);
-    std::list<std::wstring>* getWhereIs(const std::wstring& _str);
-    std::list<std::wstring>* getLibrariesList();
-
+    std::list<std::wstring>*    getVarsName();
+    std::list<std::wstring>*    getMacrosName();
+    std::list<std::wstring>*    getFunctionsName();
+    std::list<std::wstring>*    getVarsNameForWho(bool sorted);
+    std::list<std::wstring>*    getGlobalNameForWho(bool sorted);
+    std::list<std::wstring>*    getWhereIs(const std::wstring& _str);
+    std::list<std::wstring>*    getLibrariesList();
+    std::list<Variable*>*       getVarsToVariableBrowser();
+    std::list<Library*>*        getLibsToVariableBrowser();
     /* global functions */
 
     /*return global variable visibility status*/
index 94bcea9..8bab2f6 100644 (file)
@@ -96,6 +96,11 @@ struct Library
         stack.pop();
     }
 
+    inline Symbol getSymbol() const
+    {
+        return name;
+    }
+
 private :
     StackLib stack;
     Symbol name;
@@ -216,6 +221,20 @@ struct Libraries
         return plOut;
     }
 
+    std::list<Library*>* getVarsToVariableBrowser()
+    {
+        std::list<Library*>* lst = new std::list<Library*>();
+        for (auto lib : libs)
+        {
+            if (lib.second->empty() == false)
+            {
+                lst->push_back(lib.second);
+            }
+        }
+
+        return lst;
+    }
+
     void clearAll()
     {
         for (auto lib : libs)
index 9df077b..2d5dc9c 100644 (file)
@@ -417,6 +417,27 @@ struct Variables
         return symb;
     }
 
+    std::list<Variable*>* getVarsToVariableBrowser()
+    {
+        std::list<Variable*>* lst = new std::list<Variable*>();
+        for (auto var : vars)
+        {
+            if (var.second->empty() == false)
+            {
+                types::InternalType* pIT = var.second->top()->m_pIT;
+                if (pIT &&
+                        pIT->isMacro() == false &&
+                        pIT->isMacroFile() == false &&
+                        pIT->isFunction() == false)
+                {
+                    lst->push_back(var.second);
+                }
+            }
+        }
+
+        return lst;
+    }
+
     bool putInPreviousScope(Variable* _var, types::InternalType* _pIT, int _iLevel)
     {
         if (_var->empty())
index 29e7325..49f44ae 100644 (file)
@@ -479,4 +479,34 @@ bool Context::isValidVariableName(const char* name)
 
     return isValid;
 }
+
+std::list<Library*>* Context::getLibsToVariableBrowser()
+{
+    std::list<Library*>* libs = libraries.getVarsToVariableBrowser();
+
+    std::list<Library*> toremove;
+    //list lib that have a variable with the same name
+    for (auto lib : *libs)
+    {
+        Variable* var = getOrCreate(lib->getSymbol());
+        if (var->empty() == false)
+        {
+            toremove.push_back(lib);
+        }
+    }
+
+    //remove
+    for (auto lib : toremove)
+    {
+        libs->remove(lib);
+    }
+
+    return libs;
+}
+
+std::list<Variable*>* Context::getVarsToVariableBrowser()
+{
+    return variables.getVarsToVariableBrowser();
+}
+
 }
index 655a637..7b9c1d6 100644 (file)
@@ -79,7 +79,6 @@ libsciconsole_minimal_la_SOURCES = \
     src/c/tohome.c \
     src/c/more.c \
     src/c/scilines.c \
-    src/c/GetCommandLine.c \
     src/c/others/gotoxy_nw.c \
     src/c/others/clrscr_nw.c \
     src/c/prompt.c \
@@ -216,7 +215,6 @@ includes/ConsolePrintf.h \
 includes/ConsoleRead.h \
 includes/dynlib_console_gw.h \
 includes/dynlib_console.h \
-includes/GetCommandLine.h \
 includes/getKey.h \
 includes/getNbrLine.h \
 includes/gotoFunctions.h \
index b7eaa9e..d06e37d 100644 (file)
@@ -197,7 +197,6 @@ am_libsciconsole_minimal_la_OBJECTS =  \
        src/c/libsciconsole_minimal_la-tohome.lo \
        src/c/libsciconsole_minimal_la-more.lo \
        src/c/libsciconsole_minimal_la-scilines.lo \
-       src/c/libsciconsole_minimal_la-GetCommandLine.lo \
        src/c/others/libsciconsole_minimal_la-gotoxy_nw.lo \
        src/c/others/libsciconsole_minimal_la-clrscr_nw.lo \
        src/c/libsciconsole_minimal_la-prompt.lo \
@@ -672,7 +671,6 @@ libsciconsole_minimal_la_SOURCES = \
     src/c/tohome.c \
     src/c/more.c \
     src/c/scilines.c \
-    src/c/GetCommandLine.c \
     src/c/others/gotoxy_nw.c \
     src/c/others/clrscr_nw.c \
     src/c/prompt.c \
@@ -786,7 +784,6 @@ includes/ConsolePrintf.h \
 includes/ConsoleRead.h \
 includes/dynlib_console_gw.h \
 includes/dynlib_console.h \
-includes/GetCommandLine.h \
 includes/getKey.h \
 includes/getNbrLine.h \
 includes/gotoFunctions.h \
@@ -998,8 +995,6 @@ src/c/libsciconsole_minimal_la-more.lo: src/c/$(am__dirstamp) \
        src/c/$(DEPDIR)/$(am__dirstamp)
 src/c/libsciconsole_minimal_la-scilines.lo: src/c/$(am__dirstamp) \
        src/c/$(DEPDIR)/$(am__dirstamp)
-src/c/libsciconsole_minimal_la-GetCommandLine.lo:  \
-       src/c/$(am__dirstamp) src/c/$(DEPDIR)/$(am__dirstamp)
 src/c/others/$(am__dirstamp):
        @$(MKDIR_P) src/c/others
        @: > src/c/others/$(am__dirstamp)
@@ -1138,7 +1133,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciconsole_minimal_la-sci_tohome.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libsciconsole_la-GuiManagement.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libsciconsole_la-dropFiles.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libsciconsole_minimal_la-GetCommandLine.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libsciconsole_minimal_la-clc.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libsciconsole_minimal_la-more.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libsciconsole_minimal_la-prompt.Plo@am__quote@
@@ -1239,13 +1233,6 @@ src/c/libsciconsole_minimal_la-scilines.lo: src/c/scilines.c
 @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) $(libsciconsole_minimal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/libsciconsole_minimal_la-scilines.lo `test -f 'src/c/scilines.c' || echo '$(srcdir)/'`src/c/scilines.c
 
-src/c/libsciconsole_minimal_la-GetCommandLine.lo: src/c/GetCommandLine.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciconsole_minimal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libsciconsole_minimal_la-GetCommandLine.lo -MD -MP -MF src/c/$(DEPDIR)/libsciconsole_minimal_la-GetCommandLine.Tpo -c -o src/c/libsciconsole_minimal_la-GetCommandLine.lo `test -f 'src/c/GetCommandLine.c' || echo '$(srcdir)/'`src/c/GetCommandLine.c
-@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libsciconsole_minimal_la-GetCommandLine.Tpo src/c/$(DEPDIR)/libsciconsole_minimal_la-GetCommandLine.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='src/c/GetCommandLine.c' object='src/c/libsciconsole_minimal_la-GetCommandLine.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) $(libsciconsole_minimal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/libsciconsole_minimal_la-GetCommandLine.lo `test -f 'src/c/GetCommandLine.c' || echo '$(srcdir)/'`src/c/GetCommandLine.c
-
 src/c/others/libsciconsole_minimal_la-gotoxy_nw.lo: src/c/others/gotoxy_nw.c
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciconsole_minimal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/others/libsciconsole_minimal_la-gotoxy_nw.lo -MD -MP -MF src/c/others/$(DEPDIR)/libsciconsole_minimal_la-gotoxy_nw.Tpo -c -o src/c/others/libsciconsole_minimal_la-gotoxy_nw.lo `test -f 'src/c/others/gotoxy_nw.c' || echo '$(srcdir)/'`src/c/others/gotoxy_nw.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/c/others/$(DEPDIR)/libsciconsole_minimal_la-gotoxy_nw.Tpo src/c/others/$(DEPDIR)/libsciconsole_minimal_la-gotoxy_nw.Plo
diff --git a/scilab/modules/console/includes/GetCommandLine.h b/scilab/modules/console/includes/GetCommandLine.h
deleted file mode 100644 (file)
index 4c819eb..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-* Copyright (C) 2009 - DIGITEO
-*
-* 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 __GETCOMMANDLINE_H__
-#define __GETCOMMANDLINE_H__
-/*--------------------------------------------------------------------------*/
-
-#include "dynlib_console.h"
-
-/**
-* getConsoleInputLine function
-* @return characters
-*/
-CONSOLE_IMPEXP char *getConsoleInputLine(void);
-
-/*--------------------------------------------------------------------------*/
-#endif /* __GETCOMMANDLINE_H__ */
-
diff --git a/scilab/modules/console/src/c/GetCommandLine.c b/scilab/modules/console/src/c/GetCommandLine.c
deleted file mode 100644 (file)
index 0c1e50f..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- *  Copyright (C) 2008-2008 - INRIA - Bruno JOFRET
- *
- *  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
- *
- */
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#ifdef _MSC_VER
-#include <io.h>
-#define isatty  _isatty
-#define fileno  _fileno
-#else
-#include <unistd.h>             /* isatty */
-#endif
-#include "Thread_Wrapper.h"     /* Thread should be first for Windows */
-#include "BOOL.h"
-#include "ConsoleRead.h"
-#include "SetConsolePrompt.h"
-#include "configvariable_interface.h"
-#include "sci_malloc.h"
-#include "prompt.h"
-#include "HistoryManager.h"
-#if !defined(_MSC_VER)
-#include "getKey.h"
-#endif
-#include "initConsoleMode.h"
-#include "GetCommandLine.h"
-#include "TermReadAndProcess.h"
-#include "os_string.h"
-#include "BrowseVarManager.h"
-#include "scicurdir.h"
-#include "FileBrowserChDir.h"
-#include "InitializeJVM.h"
-
-/*--------------------------------------------------------------------------*/
-static char Sci_Prompt[PROMPT_SIZE_MAX];
-static char *tmpPrompt = NULL;
-static char *__CommandLine = NULL;
-/*--------------------------------------------------------------------------*/
-/***********************************************************************
- * line editor
- **********************************************************************/
-static void getCommandLine(void)
-{
-    tmpPrompt = GetTemporaryPrompt();
-    GetCurrentPrompt(Sci_Prompt);
-
-    if (__CommandLine)
-    {
-        FREE(__CommandLine);
-        __CommandLine = NULL;
-    }
-
-    if (getScilabMode() == SCILAB_STD)
-    {
-        /* Send new prompt to Java Console, do not display it */
-        if (tmpPrompt != NULL)
-        {
-            SetConsolePrompt(tmpPrompt);
-        }
-        else
-        {
-            SetConsolePrompt(Sci_Prompt);
-        }
-        setSearchedTokenInScilabHistory(NULL);
-        /* Call Java Console to get a string */
-        __CommandLine = os_strdup(ConsoleRead());
-    }
-    else
-    {
-#ifndef _MSC_VER
-        if (!isatty(fileno(stdin)))
-#else
-        if (!isatty(fileno(stdin)) && (fileno(stdin) != -2))
-#endif
-        {
-            __CommandLine = strdup("");
-        }
-        else
-        {
-            /* Call Term Management for NW and NWNI to get a string */
-            __CommandLine = getCmdLine();
-        }
-    }
-}
-
-/***********************************************************************/
-/*
-** used by mscanf to get a line from the Scilab console
-*/
-char *getConsoleInputLine(void)
-{
-    getCommandLine();
-    return os_strdup(__CommandLine);
-}
index dfbaf15..35781b0 100644 (file)
     <ClCompile Include="dropFiles.c" />
     <ClCompile Include="..\jni\DropFiles_wrap.c" />
     <ClCompile Include="..\cpp\GetCharWithoutOutput.cpp" />
-    <ClCompile Include="GetCommandLine.c" />
     <ClCompile Include="GuiManagement.c" />
     <ClCompile Include="..\jni\GuiManagement_wrap.c" />
     <ClCompile Include="InitializeConsole.c" />
     <ClInclude Include="..\..\includes\ConsolePrintf.h" />
     <ClInclude Include="..\..\includes\ConsoleRead.h" />
     <ClInclude Include="..\..\includes\dynlib_console.h" />
-    <ClInclude Include="..\..\includes\GetCommandLine.h" />
     <ClInclude Include="..\..\includes\gw_console.h" />
     <ClInclude Include="..\..\includes\InitializeConsole.h" />
     <ClInclude Include="..\..\includes\more.h" />
index 05abab8..260fb78 100644 (file)
@@ -77,9 +77,6 @@
     <ClCompile Include="clc.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="GetCommandLine.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="more.c">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClInclude Include="..\..\includes\dynlib_console.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\includes\GetCommandLine.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\includes\gw_console.h">
       <Filter>Header Files</Filter>
     </ClInclude>
index 19490ec..cf203dc 100644 (file)
     <ClCompile Include="..\cpp\scilabRead.cpp" />
     <ClCompile Include="..\c\clc.c" />
     <ClCompile Include="..\c\DllmainConsole.c" />
-    <ClCompile Include="..\c\GetCommandLine.c" />
     <ClCompile Include="..\c\more.c" />
     <ClCompile Include="..\c\prompt.c" />
     <ClCompile Include="..\c\promptecho.c" />
index 68f5929..46a6e14 100644 (file)
@@ -48,9 +48,6 @@
     <ClCompile Include="..\c\tohome.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\c\GetCommandLine.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="..\c\windows\TermReadAndProcess.c">
       <Filter>Source Files</Filter>
     </ClCompile>
index f908d1d..875f505 100644 (file)
@@ -166,6 +166,7 @@ libscicore_la_CPPFLAGS = \
     -I$(top_srcdir)/modules/graphics/includes/ \
     -I$(top_srcdir)/modules/hdf5/includes/ \
     -I$(top_srcdir)/modules/fftw/includes/ \
+    -I$(top_srcdir)/modules/ui_data/includes/ \
     $(EIGEN_CPPFLAGS) \
     $(XML_FLAGS) \
     $(AM_CPPFLAGS)
index cfd49c6..5e9b9e9 100644 (file)
@@ -836,7 +836,8 @@ libscicore_la_CPPFLAGS = -I$(srcdir)/includes/ -I$(srcdir)/src/c/ \
        -I$(top_srcdir)/modules/gui/includes/ \
        -I$(top_srcdir)/modules/graphics/includes/ \
        -I$(top_srcdir)/modules/hdf5/includes/ \
-       -I$(top_srcdir)/modules/fftw/includes/ $(EIGEN_CPPFLAGS) \
+       -I$(top_srcdir)/modules/fftw/includes/ \
+       -I$(top_srcdir)/modules/ui_data/includes/ $(EIGEN_CPPFLAGS) \
        $(XML_FLAGS) $(AM_CPPFLAGS) $(am__append_1)
 @MAINTAINER_MODE_TRUE@pkglib_LTLIBRARIES = libscicore.la
 @MAINTAINER_MODE_FALSE@noinst_LTLIBRARIES = libscicore-algo.la libscicore.la
index db83a32..3e371d8 100644 (file)
@@ -80,7 +80,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/GetWindowsVersion;../../../../libs/intl;../../../../libs/libxml2;../../../../libs/libxml2/libxml;../../../../libs/Eigen/includes;../../../mexlib/includes;../../../gui/src/c/wsci;../../../api_scilab/includes;../../../string/includes;../../../functions/includes;../../../dynamic_link/includes;../../../action_binding/includes;../../../output_stream/includes;../../../fileio/includes;../../../elementary_functions/includes;../../../tclsci/includes;../../../localization/includes;../../../tclsci/includes/tcltk;../../../windows_tools/includes;../../../windows_tools/src/c;../../../windows_tools/src/c/scilab_windows;../../../intersci/includes;../../../call_scilab/includes;../../../call_scilab/src/c;../../../graphics/includes;../../../io/includes;../../../console/includes;../../../preferences/includes;../../../history_manager/includes;../../../threads/includes;../../../external_objects/includes;../../../functions_manager/includes;../../../jvm/includes;../../../gui/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;../../../ast/includes/parse;../../../hdf5/includes;../../../fftw/includes</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/GetWindowsVersion;../../../../libs/intl;../../../../libs/libxml2;../../../../libs/libxml2/libxml;../../../../libs/Eigen/includes;../../../mexlib/includes;../../../gui/src/c/wsci;../../../api_scilab/includes;../../../string/includes;../../../functions/includes;../../../dynamic_link/includes;../../../action_binding/includes;../../../output_stream/includes;../../../fileio/includes;../../../elementary_functions/includes;../../../tclsci/includes;../../../localization/includes;../../../tclsci/includes/tcltk;../../../windows_tools/includes;../../../windows_tools/src/c;../../../windows_tools/src/c/scilab_windows;../../../intersci/includes;../../../call_scilab/includes;../../../call_scilab/src/c;../../../graphics/includes;../../../io/includes;../../../console/includes;../../../preferences/includes;../../../history_manager/includes;../../../threads/includes;../../../external_objects/includes;../../../functions_manager/includes;../../../jvm/includes;../../../gui/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;../../../ast/includes/parse;../../../hdf5/includes;../../../fftw/includes;../../../ui_data/includes</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;_DEBUG;_WINDOWS;_USRDLL;CORE_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
@@ -120,7 +120,7 @@ cd ..
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/GetWindowsVersion;../../../../libs/intl;../../../../libs/libxml2;../../../../libs/libxml2/libxml;../../../../libs/Eigen/includes;../../../mexlib/includes;../../../gui/src/c/wsci;../../../api_scilab/includes;../../../string/includes;../../../functions/includes;../../../dynamic_link/includes;../../../action_binding/includes;../../../output_stream/includes;../../../fileio/includes;../../../elementary_functions/includes;../../../tclsci/includes;../../../localization/includes;../../../tclsci/includes/tcltk;../../../windows_tools/includes;../../../windows_tools/src/c;../../../windows_tools/src/c/scilab_windows;../../../intersci/includes;../../../call_scilab/includes;../../../call_scilab/src/c;../../../graphics/includes;../../../io/includes;../../../console/includes;../../../preferences/includes;../../../history_manager/includes;../../../threads/includes;../../../external_objects/includes;../../../functions_manager/includes;../../../jvm/includes;../../../gui/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;../../../ast/includes/parse;../../../hdf5/includes;../../../fftw/includes</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/GetWindowsVersion;../../../../libs/intl;../../../../libs/libxml2;../../../../libs/libxml2/libxml;../../../../libs/Eigen/includes;../../../mexlib/includes;../../../gui/src/c/wsci;../../../api_scilab/includes;../../../string/includes;../../../functions/includes;../../../dynamic_link/includes;../../../action_binding/includes;../../../output_stream/includes;../../../fileio/includes;../../../elementary_functions/includes;../../../tclsci/includes;../../../localization/includes;../../../tclsci/includes/tcltk;../../../windows_tools/includes;../../../windows_tools/src/c;../../../windows_tools/src/c/scilab_windows;../../../intersci/includes;../../../call_scilab/includes;../../../call_scilab/src/c;../../../graphics/includes;../../../io/includes;../../../console/includes;../../../preferences/includes;../../../history_manager/includes;../../../threads/includes;../../../external_objects/includes;../../../functions_manager/includes;../../../jvm/includes;../../../gui/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;../../../ast/includes/parse;../../../hdf5/includes;../../../fftw/includes;../../../ui_data/includes</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;_DEBUG;_WINDOWS;_USRDLL;CORE_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
@@ -158,7 +158,7 @@ cd ..
     <ClCompile>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/GetWindowsVersion;../../../../libs/intl;../../../../libs/libxml2;../../../../libs/libxml2/libxml;../../../../libs/Eigen/includes;../../../mexlib/includes;../../../gui/src/c/wsci;../../../api_scilab/includes;../../../string/includes;../../../functions/includes;../../../dynamic_link/includes;../../../action_binding/includes;../../../output_stream/includes;../../../fileio/includes;../../../elementary_functions/includes;../../../tclsci/includes;../../../localization/includes;../../../tclsci/includes/tcltk;../../../windows_tools/includes;../../../windows_tools/src/c;../../../windows_tools/src/c/scilab_windows;../../../intersci/includes;../../../call_scilab/includes;../../../call_scilab/src/c;../../../graphics/includes;../../../io/includes;../../../console/includes;../../../preferences/includes;../../../history_manager/includes;../../../threads/includes;../../../external_objects/includes;../../../functions_manager/includes;../../../jvm/includes;../../../gui/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;../../../ast/includes/parse;../../../hdf5/includes;../../../fftw/includes</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/GetWindowsVersion;../../../../libs/intl;../../../../libs/libxml2;../../../../libs/libxml2/libxml;../../../../libs/Eigen/includes;../../../mexlib/includes;../../../gui/src/c/wsci;../../../api_scilab/includes;../../../string/includes;../../../functions/includes;../../../dynamic_link/includes;../../../action_binding/includes;../../../output_stream/includes;../../../fileio/includes;../../../elementary_functions/includes;../../../tclsci/includes;../../../localization/includes;../../../tclsci/includes/tcltk;../../../windows_tools/includes;../../../windows_tools/src/c;../../../windows_tools/src/c/scilab_windows;../../../intersci/includes;../../../call_scilab/includes;../../../call_scilab/src/c;../../../graphics/includes;../../../io/includes;../../../console/includes;../../../preferences/includes;../../../history_manager/includes;../../../threads/includes;../../../external_objects/includes;../../../functions_manager/includes;../../../jvm/includes;../../../gui/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;../../../ast/includes/parse;../../../hdf5/includes;../../../fftw/includes;../../../ui_data/includes</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;NDEBUG;_WINDOWS;_USRDLL;CORE_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -203,7 +203,7 @@ cd ..
     <ClCompile>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/GetWindowsVersion;../../../../libs/intl;../../../../libs/libxml2;../../../../libs/libxml2/libxml;../../../../libs/Eigen/includes;../../../mexlib/includes;../../../gui/src/c/wsci;../../../api_scilab/includes;../../../string/includes;../../../functions/includes;../../../dynamic_link/includes;../../../action_binding/includes;../../../output_stream/includes;../../../fileio/includes;../../../elementary_functions/includes;../../../tclsci/includes;../../../localization/includes;../../../tclsci/includes/tcltk;../../../windows_tools/includes;../../../windows_tools/src/c;../../../windows_tools/src/c/scilab_windows;../../../intersci/includes;../../../call_scilab/includes;../../../call_scilab/src/c;../../../graphics/includes;../../../io/includes;../../../console/includes;../../../preferences/includes;../../../history_manager/includes;../../../threads/includes;../../../external_objects/includes;../../../functions_manager/includes;../../../jvm/includes;../../../gui/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;../../../ast/includes/parse;../../../hdf5/includes;../../../fftw/includes</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/GetWindowsVersion;../../../../libs/intl;../../../../libs/libxml2;../../../../libs/libxml2/libxml;../../../../libs/Eigen/includes;../../../mexlib/includes;../../../gui/src/c/wsci;../../../api_scilab/includes;../../../string/includes;../../../functions/includes;../../../dynamic_link/includes;../../../action_binding/includes;../../../output_stream/includes;../../../fileio/includes;../../../elementary_functions/includes;../../../tclsci/includes;../../../localization/includes;../../../tclsci/includes/tcltk;../../../windows_tools/includes;../../../windows_tools/src/c;../../../windows_tools/src/c/scilab_windows;../../../intersci/includes;../../../call_scilab/includes;../../../call_scilab/src/c;../../../graphics/includes;../../../io/includes;../../../console/includes;../../../preferences/includes;../../../history_manager/includes;../../../threads/includes;../../../external_objects/includes;../../../functions_manager/includes;../../../jvm/includes;../../../gui/includes;../../../ast/includes/types;../../../ast/includes/ast;../../../ast/includes/analysis;../../../ast/includes/exps;../../../ast/includes/operations;../../../ast/includes/symbol;../../../ast/includes/system_env;../../../ast/includes/parse;../../../hdf5/includes;../../../fftw/includes;../../../ui_data/includes</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;NDEBUG;_WINDOWS;_USRDLL;CORE_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -483,6 +483,9 @@ cd ..
     <ProjectReference Include="..\..\..\threads\threads.vcxproj">
       <Project>{50a1ffc8-adc2-4d9e-a2d0-5dcd63188ae9}</Project>
     </ProjectReference>
+    <ProjectReference Include="..\..\..\ui_data\src\c\ui_data.vcxproj">
+      <Project>{142d643b-a9ec-49db-9d48-a925a20f63b1}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\..\..\windows_tools\src\c\scilab_windows\scilab_windows.vcxproj">
       <Project>{8028f371-6a94-4a26-8804-6e7f05f1d1aa}</Project>
     </ProjectReference>
index 0de7b7f..9e4afa5 100644 (file)
@@ -57,6 +57,9 @@ extern "C"
 #include "saveCWDInPreferences.h"
 #include "h5_fileManagement.h"
 #include "with_fftw.h"
+#include "BrowseVarManager.h"
+#include "scicurdir.h"
+#include "FileBrowserChDir.h"
 
 
 #ifdef _MSC_VER
@@ -513,6 +516,22 @@ void* scilabReadAndExecCommand(void* param)
 
         processCommand(_pSEI);
         FREE(command);
+
+        if (getScilabMode() != SCILAB_NWNI)
+        {
+
+            char *cwd = NULL;
+
+            int err = 0;
+
+            UpdateBrowseVar();
+            cwd = scigetcwd(&err);
+            if (cwd)
+            {
+                FileBrowserChDir(cwd);
+                FREE(cwd);
+            }
+        }
     }
 
     return NULL;
@@ -653,7 +672,7 @@ static int interactiveMain(ScilabEngineInfo* _pSEI)
 #ifndef _MSC_VER
     if (getScilabMode() != SCILAB_NWNI)
     {
-        fprintf(stderr, "Scilab was compiled without its GUI and advanced features. Run scilab-cli or us the -nwni option.\n");
+        fprintf(stderr, "Scilab was compiled without its GUI and advanced features. Run scilab-cli or use the -nwni option.\n");
         initConsoleMode(ATTR_RESET);
         exit(1);
     }
@@ -662,6 +681,22 @@ static int interactiveMain(ScilabEngineInfo* _pSEI)
 
     InitializeHistoryManager();
 
+    if (getScilabMode() != SCILAB_NWNI)
+    {
+
+        char *cwd = NULL;
+
+        int err = 0;
+
+        UpdateBrowseVar();
+        cwd = scigetcwd(&err);
+        if (cwd)
+        {
+            FileBrowserChDir(cwd);
+            FREE(cwd);
+        }
+    }
+
     __threadId threadIdConsole;
     __threadKey threadKeyConsole;
     __threadId threadIdCommand;
index 4e825e4..f1cb4cf 100644 (file)
     <ProjectReference Include="..\types\sci_gateway\cpp\types_gw.vcxproj">
       <Project>{c2e5f4f6-5ee7-4b36-bfac-4ac36bb41420}</Project>
     </ProjectReference>
+    <ProjectReference Include="..\ui_data\src\c\ui_data.vcxproj">
+      <Project>{142d643b-a9ec-49db-9d48-a925a20f63b1}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\windows_tools\src\c\windows_tools.vcxproj">
       <Project>{9594ac02-20ee-4fbf-95b4-bfa5865ed7ca}</Project>
     </ProjectReference>
index 6db10dd..7a2d520 100644 (file)
@@ -52,4 +52,5 @@
 #include "../../completion/includes/completion_gw.hxx"
 #include "../../special_functions/includes/special_functions_gw.hxx"
 #include "../../fftw/includes/fftw_gw.hxx"
+#include "../../ui_data/includes/ui_data_gw.hxx"
 #endif /* !__MODULE_DECLARATION_HXX__ */
index 841f3a3..9bbdfdb 100644 (file)
@@ -354,6 +354,7 @@ bool FuncManager::CreateModuleList(void)
     if (ConfigVariable::getScilabMode() != SCILAB_NWNI)
     {
         m_ModuleMap[L"jvm"] = pair<GW_MOD, GW_MOD>(&JvmModule::Load, &JvmModule::Unload);
+        m_ModuleMap[L"ui_data"] = pair<GW_MOD, GW_MOD>(&UiDataModule::Load, &UiDataModule::Unload);
     }
 #ifdef _MSC_VER
     m_ModuleMap[L"windows_tools"] = pair<GW_MOD, GW_MOD>(&WindowsToolsModule::Load, &WindowsToolsModule::Unload);
index 161f4e9..42fb6f2 100644 (file)
@@ -58,15 +58,13 @@ BUILT_SOURCES+=swig
 endif
 
 
-GATEWAY_C_SOURCES = sci_gateway/c/gw_ui_data.c
-
-
 GATEWAY_CXX_SOURCES = \
     sci_gateway/cpp/sci_editvar.cpp \
     sci_gateway/cpp/sci_browsevar.cpp \
     sci_gateway/cpp/sci_filebrowser.cpp \
     sci_gateway/cpp/sci_updatebrowsevar.cpp \
-    sci_gateway/cpp/sci_closeEditvar.cpp
+    sci_gateway/cpp/sci_closeEditvar.cpp \
+    sci_gateway/cpp/ui_data_gw.cpp
 
 
 libsciui_data_la_CPPFLAGS = \
@@ -90,6 +88,10 @@ libsciui_data_la_CPPFLAGS = \
     -I$(top_srcdir)/modules/api_scilab/includes/ \
     -I$(top_srcdir)/modules/fileio/includes/ \
     -I$(top_srcdir)/modules/string/includes/ \
+    -I$(top_srcdir)/modules/dynamic_link/includes/ \
+    -I$(top_srcdir)/modules/threads/includes/ \
+    -I$(top_srcdir)/modules/console/includes/ \
+    $(EIGEN_CPPFLAGS) \
     $(AM_CPPFLAGS)
 
 # Without the ui_data module
@@ -102,12 +104,14 @@ libsciui_data_disable_la_CPPFLAGS = \
     -I$(top_srcdir)/modules/ast/includes/symbol/ \
     -I$(top_srcdir)/modules/ast/includes/system_env/ \
     -I$(top_srcdir)/modules/ast/includes/types/ \
+    -I$(top_srcdir)/modules/ast/includes/analysis/ \
     -I$(top_srcdir)/modules/localization/includes/ \
     -I$(top_srcdir)/modules/output_stream/includes \
     $(AM_CPPFLAGS)
 
 UI_DATA_DISABLE_C_SOURCES = src/noui_data/noui_data.c
-libsciui_data_disable_la_SOURCES = $(UI_DATA_DISABLE_C_SOURCES)
+UI_DATA_DISABLE_CXX_SOURCES = src/noui_data/noui_data_gw.cpp
+libsciui_data_disable_la_SOURCES = $(UI_DATA_DISABLE_C_SOURCES) $(UI_DATA_DISABLE_CXX_SOURCES)
 
 pkglib_LTLIBRARIES = libsciui_data-disable.la
 
@@ -119,11 +123,11 @@ endif
 libsciui_data_la_LDFLAGS = $(AM_LDFLAGS)
 
 libsciui_data_algo_la_SOURCES = $(UI_DATA_C_SOURCES) $(UI_DATA_JNI_SOURCES) $(UI_DATA_CXX_SOURCES)
-libsciui_data_la_SOURCES = $(GATEWAY_C_SOURCES) $(GATEWAY_CXX_SOURCES)
+libsciui_data_la_SOURCES = $(GATEWAY_CXX_SOURCES)
 libsciui_data_algo_la_CPPFLAGS = $(libsciui_data_la_CPPFLAGS)
 
 # For the code check (splint)
-CHECK_SRC= $(UI_DATA_C_SOURCES) $(GATEWAY_C_SOURCES)
+CHECK_SRC= $(UI_DATA_C_SOURCES)
 INCLUDE_FLAGS = $(libsciui_data_la_CPPFLAGS)
 
 libsciui_data_la_LIBADD = libsciui_data-algo.la $(X_LIBS) $(X_EXTRA_LIBS)
@@ -131,7 +135,6 @@ libsciui_data_la_LIBADD = libsciui_data-algo.la $(X_LIBS) $(X_EXTRA_LIBS)
 
 #### ui_data : gateway declaration ####
 libsciui_data_la_sci_gatewaydir = $(mydatadir)/sci_gateway
-libsciui_data_la_sci_gateway_DATA = sci_gateway/ui_data_gateway.xml
 
 #### ui_data : icons files ####
 #
index 0b3e0cf..7dc60ed 100644 (file)
@@ -169,7 +169,6 @@ am__uninstall_files_from_dir = { \
 am__installdirs = "$(DESTDIR)$(pkglibdir)" \
        "$(DESTDIR)$(libsciui_data_la_etcdir)" \
        "$(DESTDIR)$(libsciui_data_la_rootdir)" \
-       "$(DESTDIR)$(libsciui_data_la_sci_gatewaydir)" \
        "$(DESTDIR)$(libsciui_data_la_iconsdir)"
 LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkglib_LTLIBRARIES)
 libsciui_data_algo_la_LIBADD =
@@ -191,19 +190,22 @@ am__v_lt_1 =
 @GUI_TRUE@am_libsciui_data_algo_la_rpath =
 libsciui_data_disable_la_LIBADD =
 am__objects_4 = src/noui_data/libsciui_data_disable_la-noui_data.lo
-am_libsciui_data_disable_la_OBJECTS = $(am__objects_4)
+am__objects_5 =  \
+       src/noui_data/libsciui_data_disable_la-noui_data_gw.lo
+am_libsciui_data_disable_la_OBJECTS = $(am__objects_4) \
+       $(am__objects_5)
 libsciui_data_disable_la_OBJECTS =  \
        $(am_libsciui_data_disable_la_OBJECTS)
 am__DEPENDENCIES_1 =
 libsciui_data_la_DEPENDENCIES = libsciui_data-algo.la \
        $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
-am__objects_5 = sci_gateway/c/libsciui_data_la-gw_ui_data.lo
 am__objects_6 = sci_gateway/cpp/libsciui_data_la-sci_editvar.lo \
        sci_gateway/cpp/libsciui_data_la-sci_browsevar.lo \
        sci_gateway/cpp/libsciui_data_la-sci_filebrowser.lo \
        sci_gateway/cpp/libsciui_data_la-sci_updatebrowsevar.lo \
-       sci_gateway/cpp/libsciui_data_la-sci_closeEditvar.lo
-am_libsciui_data_la_OBJECTS = $(am__objects_5) $(am__objects_6)
+       sci_gateway/cpp/libsciui_data_la-sci_closeEditvar.lo \
+       sci_gateway/cpp/libsciui_data_la-ui_data_gw.lo
+am_libsciui_data_la_OBJECTS = $(am__objects_6)
 libsciui_data_la_OBJECTS = $(am_libsciui_data_la_OBJECTS)
 libsciui_data_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \
        $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \
@@ -274,7 +276,6 @@ am__can_run_installinfo = \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
 DATA = $(libsciui_data_la_etc_DATA) $(libsciui_data_la_root_DATA) \
-       $(libsciui_data_la_sci_gateway_DATA) \
        $(nobase_libsciui_data_la_icons_DATA)
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
 # Read a list of newline-separated strings from the standard input,
@@ -620,13 +621,13 @@ SWIG_WRAPPERS = \
     src/jni/ui_data.i
 
 BUILT_SOURCES = $(am__append_1) $(am__append_2)
-GATEWAY_C_SOURCES = sci_gateway/c/gw_ui_data.c
 GATEWAY_CXX_SOURCES = \
     sci_gateway/cpp/sci_editvar.cpp \
     sci_gateway/cpp/sci_browsevar.cpp \
     sci_gateway/cpp/sci_filebrowser.cpp \
     sci_gateway/cpp/sci_updatebrowsevar.cpp \
-    sci_gateway/cpp/sci_closeEditvar.cpp
+    sci_gateway/cpp/sci_closeEditvar.cpp \
+    sci_gateway/cpp/ui_data_gw.cpp
 
 libsciui_data_la_CPPFLAGS = \
     $(JAVA_JNI_INCLUDE) \
@@ -649,6 +650,10 @@ libsciui_data_la_CPPFLAGS = \
     -I$(top_srcdir)/modules/api_scilab/includes/ \
     -I$(top_srcdir)/modules/fileio/includes/ \
     -I$(top_srcdir)/modules/string/includes/ \
+    -I$(top_srcdir)/modules/dynamic_link/includes/ \
+    -I$(top_srcdir)/modules/threads/includes/ \
+    -I$(top_srcdir)/modules/console/includes/ \
+    $(EIGEN_CPPFLAGS) \
     $(AM_CPPFLAGS)
 
 
@@ -662,27 +667,28 @@ libsciui_data_disable_la_CPPFLAGS = \
     -I$(top_srcdir)/modules/ast/includes/symbol/ \
     -I$(top_srcdir)/modules/ast/includes/system_env/ \
     -I$(top_srcdir)/modules/ast/includes/types/ \
+    -I$(top_srcdir)/modules/ast/includes/analysis/ \
     -I$(top_srcdir)/modules/localization/includes/ \
     -I$(top_srcdir)/modules/output_stream/includes \
     $(AM_CPPFLAGS)
 
 UI_DATA_DISABLE_C_SOURCES = src/noui_data/noui_data.c
-libsciui_data_disable_la_SOURCES = $(UI_DATA_DISABLE_C_SOURCES)
+UI_DATA_DISABLE_CXX_SOURCES = src/noui_data/noui_data_gw.cpp
+libsciui_data_disable_la_SOURCES = $(UI_DATA_DISABLE_C_SOURCES) $(UI_DATA_DISABLE_CXX_SOURCES)
 pkglib_LTLIBRARIES = libsciui_data-disable.la $(am__append_3)
 @GUI_TRUE@noinst_LTLIBRARIES = libsciui_data-algo.la
 libsciui_data_la_LDFLAGS = $(AM_LDFLAGS)
 libsciui_data_algo_la_SOURCES = $(UI_DATA_C_SOURCES) $(UI_DATA_JNI_SOURCES) $(UI_DATA_CXX_SOURCES)
-libsciui_data_la_SOURCES = $(GATEWAY_C_SOURCES) $(GATEWAY_CXX_SOURCES)
+libsciui_data_la_SOURCES = $(GATEWAY_CXX_SOURCES)
 libsciui_data_algo_la_CPPFLAGS = $(libsciui_data_la_CPPFLAGS)
 
 # For the code check (splint)
-CHECK_SRC = $(UI_DATA_C_SOURCES) $(GATEWAY_C_SOURCES)
+CHECK_SRC = $(UI_DATA_C_SOURCES)
 INCLUDE_FLAGS = $(libsciui_data_la_CPPFLAGS)
 libsciui_data_la_LIBADD = libsciui_data-algo.la $(X_LIBS) $(X_EXTRA_LIBS)
 
 #### ui_data : gateway declaration ####
 libsciui_data_la_sci_gatewaydir = $(mydatadir)/sci_gateway
-libsciui_data_la_sci_gateway_DATA = sci_gateway/ui_data_gateway.xml
 
 #### ui_data : icons files ####
 #
@@ -910,18 +916,12 @@ src/noui_data/$(DEPDIR)/$(am__dirstamp):
 src/noui_data/libsciui_data_disable_la-noui_data.lo:  \
        src/noui_data/$(am__dirstamp) \
        src/noui_data/$(DEPDIR)/$(am__dirstamp)
+src/noui_data/libsciui_data_disable_la-noui_data_gw.lo:  \
+       src/noui_data/$(am__dirstamp) \
+       src/noui_data/$(DEPDIR)/$(am__dirstamp)
 
 libsciui_data-disable.la: $(libsciui_data_disable_la_OBJECTS) $(libsciui_data_disable_la_DEPENDENCIES) $(EXTRA_libsciui_data_disable_la_DEPENDENCIES) 
-       $(AM_V_CCLD)$(LINK) -rpath $(pkglibdir) $(libsciui_data_disable_la_OBJECTS) $(libsciui_data_disable_la_LIBADD) $(LIBS)
-sci_gateway/c/$(am__dirstamp):
-       @$(MKDIR_P) sci_gateway/c
-       @: > sci_gateway/c/$(am__dirstamp)
-sci_gateway/c/$(DEPDIR)/$(am__dirstamp):
-       @$(MKDIR_P) sci_gateway/c/$(DEPDIR)
-       @: > sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
-sci_gateway/c/libsciui_data_la-gw_ui_data.lo:  \
-       sci_gateway/c/$(am__dirstamp) \
-       sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
+       $(AM_V_CXXLD)$(CXXLINK) -rpath $(pkglibdir) $(libsciui_data_disable_la_OBJECTS) $(libsciui_data_disable_la_LIBADD) $(LIBS)
 sci_gateway/cpp/$(am__dirstamp):
        @$(MKDIR_P) sci_gateway/cpp
        @: > sci_gateway/cpp/$(am__dirstamp)
@@ -943,14 +943,15 @@ sci_gateway/cpp/libsciui_data_la-sci_updatebrowsevar.lo:  \
 sci_gateway/cpp/libsciui_data_la-sci_closeEditvar.lo:  \
        sci_gateway/cpp/$(am__dirstamp) \
        sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/cpp/libsciui_data_la-ui_data_gw.lo:  \
+       sci_gateway/cpp/$(am__dirstamp) \
+       sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
 
 libsciui_data.la: $(libsciui_data_la_OBJECTS) $(libsciui_data_la_DEPENDENCIES) $(EXTRA_libsciui_data_la_DEPENDENCIES) 
        $(AM_V_CXXLD)$(libsciui_data_la_LINK) $(am_libsciui_data_la_rpath) $(libsciui_data_la_OBJECTS) $(libsciui_data_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)
-       -rm -f sci_gateway/c/*.$(OBJEXT)
-       -rm -f sci_gateway/c/*.lo
        -rm -f sci_gateway/cpp/*.$(OBJEXT)
        -rm -f sci_gateway/cpp/*.lo
        -rm -f src/c/*.$(OBJEXT)
@@ -965,12 +966,12 @@ mostlyclean-compile:
 distclean-compile:
        -rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libsciui_data_la-gw_ui_data.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciui_data_la-sci_browsevar.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciui_data_la-sci_closeEditvar.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciui_data_la-sci_editvar.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciui_data_la-sci_filebrowser.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciui_data_la-sci_updatebrowsevar.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciui_data_la-ui_data_gw.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libsciui_data_algo_la-PutScilabVariable.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libsciui_data_algo_la-BrowseVarManager.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libsciui_data_algo_la-FileBrowserChDir.Plo@am__quote@
@@ -979,6 +980,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@src/jni/$(DEPDIR)/libsciui_data_algo_la-FileBrowser.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/jni/$(DEPDIR)/libsciui_data_algo_la-ui_data_wrap.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/noui_data/$(DEPDIR)/libsciui_data_disable_la-noui_data.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/noui_data/$(DEPDIR)/libsciui_data_disable_la-noui_data_gw.Plo@am__quote@
 
 .c.o:
 @am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@@ -1025,13 +1027,6 @@ src/noui_data/libsciui_data_disable_la-noui_data.lo: src/noui_data/noui_data.c
 @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) $(libsciui_data_disable_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/noui_data/libsciui_data_disable_la-noui_data.lo `test -f 'src/noui_data/noui_data.c' || echo '$(srcdir)/'`src/noui_data/noui_data.c
 
-sci_gateway/c/libsciui_data_la-gw_ui_data.lo: sci_gateway/c/gw_ui_data.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciui_data_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libsciui_data_la-gw_ui_data.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libsciui_data_la-gw_ui_data.Tpo -c -o sci_gateway/c/libsciui_data_la-gw_ui_data.lo `test -f 'sci_gateway/c/gw_ui_data.c' || echo '$(srcdir)/'`sci_gateway/c/gw_ui_data.c
-@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libsciui_data_la-gw_ui_data.Tpo sci_gateway/c/$(DEPDIR)/libsciui_data_la-gw_ui_data.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='sci_gateway/c/gw_ui_data.c' object='sci_gateway/c/libsciui_data_la-gw_ui_data.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) $(libsciui_data_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libsciui_data_la-gw_ui_data.lo `test -f 'sci_gateway/c/gw_ui_data.c' || echo '$(srcdir)/'`sci_gateway/c/gw_ui_data.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 $@ $< &&\
@@ -1091,6 +1086,13 @@ src/cpp/libsciui_data_algo_la-FileBrowserChDir.lo: src/cpp/FileBrowserChDir.cpp
 @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) $(libsciui_data_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/cpp/libsciui_data_algo_la-FileBrowserChDir.lo `test -f 'src/cpp/FileBrowserChDir.cpp' || echo '$(srcdir)/'`src/cpp/FileBrowserChDir.cpp
 
+src/noui_data/libsciui_data_disable_la-noui_data_gw.lo: src/noui_data/noui_data_gw.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciui_data_disable_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/noui_data/libsciui_data_disable_la-noui_data_gw.lo -MD -MP -MF src/noui_data/$(DEPDIR)/libsciui_data_disable_la-noui_data_gw.Tpo -c -o src/noui_data/libsciui_data_disable_la-noui_data_gw.lo `test -f 'src/noui_data/noui_data_gw.cpp' || echo '$(srcdir)/'`src/noui_data/noui_data_gw.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) src/noui_data/$(DEPDIR)/libsciui_data_disable_la-noui_data_gw.Tpo src/noui_data/$(DEPDIR)/libsciui_data_disable_la-noui_data_gw.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='src/noui_data/noui_data_gw.cpp' object='src/noui_data/libsciui_data_disable_la-noui_data_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) $(libsciui_data_disable_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/noui_data/libsciui_data_disable_la-noui_data_gw.lo `test -f 'src/noui_data/noui_data_gw.cpp' || echo '$(srcdir)/'`src/noui_data/noui_data_gw.cpp
+
 sci_gateway/cpp/libsciui_data_la-sci_editvar.lo: sci_gateway/cpp/sci_editvar.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciui_data_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libsciui_data_la-sci_editvar.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libsciui_data_la-sci_editvar.Tpo -c -o sci_gateway/cpp/libsciui_data_la-sci_editvar.lo `test -f 'sci_gateway/cpp/sci_editvar.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_editvar.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libsciui_data_la-sci_editvar.Tpo sci_gateway/cpp/$(DEPDIR)/libsciui_data_la-sci_editvar.Plo
@@ -1126,12 +1128,18 @@ sci_gateway/cpp/libsciui_data_la-sci_closeEditvar.lo: sci_gateway/cpp/sci_closeE
 @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) $(libsciui_data_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libsciui_data_la-sci_closeEditvar.lo `test -f 'sci_gateway/cpp/sci_closeEditvar.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_closeEditvar.cpp
 
+sci_gateway/cpp/libsciui_data_la-ui_data_gw.lo: sci_gateway/cpp/ui_data_gw.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciui_data_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libsciui_data_la-ui_data_gw.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libsciui_data_la-ui_data_gw.Tpo -c -o sci_gateway/cpp/libsciui_data_la-ui_data_gw.lo `test -f 'sci_gateway/cpp/ui_data_gw.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/ui_data_gw.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libsciui_data_la-ui_data_gw.Tpo sci_gateway/cpp/$(DEPDIR)/libsciui_data_la-ui_data_gw.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='sci_gateway/cpp/ui_data_gw.cpp' object='sci_gateway/cpp/libsciui_data_la-ui_data_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) $(libsciui_data_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libsciui_data_la-ui_data_gw.lo `test -f 'sci_gateway/cpp/ui_data_gw.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/ui_data_gw.cpp
+
 mostlyclean-libtool:
        -rm -f *.lo
 
 clean-libtool:
        -rm -rf .libs _libs
-       -rm -rf sci_gateway/c/.libs sci_gateway/c/_libs
        -rm -rf sci_gateway/cpp/.libs sci_gateway/cpp/_libs
        -rm -rf src/c/.libs src/c/_libs
        -rm -rf src/cpp/.libs src/cpp/_libs
@@ -1179,27 +1187,6 @@ uninstall-libsciui_data_la_rootDATA:
        @list='$(libsciui_data_la_root_DATA)'; test -n "$(libsciui_data_la_rootdir)" || list=; \
        files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
        dir='$(DESTDIR)$(libsciui_data_la_rootdir)'; $(am__uninstall_files_from_dir)
-install-libsciui_data_la_sci_gatewayDATA: $(libsciui_data_la_sci_gateway_DATA)
-       @$(NORMAL_INSTALL)
-       @list='$(libsciui_data_la_sci_gateway_DATA)'; test -n "$(libsciui_data_la_sci_gatewaydir)" || list=; \
-       if test -n "$$list"; then \
-         echo " $(MKDIR_P) '$(DESTDIR)$(libsciui_data_la_sci_gatewaydir)'"; \
-         $(MKDIR_P) "$(DESTDIR)$(libsciui_data_la_sci_gatewaydir)" || exit 1; \
-       fi; \
-       for p in $$list; do \
-         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-         echo "$$d$$p"; \
-       done | $(am__base_list) | \
-       while read files; do \
-         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(libsciui_data_la_sci_gatewaydir)'"; \
-         $(INSTALL_DATA) $$files "$(DESTDIR)$(libsciui_data_la_sci_gatewaydir)" || exit $$?; \
-       done
-
-uninstall-libsciui_data_la_sci_gatewayDATA:
-       @$(NORMAL_UNINSTALL)
-       @list='$(libsciui_data_la_sci_gateway_DATA)'; test -n "$(libsciui_data_la_sci_gatewaydir)" || list=; \
-       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-       dir='$(DESTDIR)$(libsciui_data_la_sci_gatewaydir)'; $(am__uninstall_files_from_dir)
 install-nobase_libsciui_data_la_iconsDATA: $(nobase_libsciui_data_la_icons_DATA)
        @$(NORMAL_INSTALL)
        @list='$(nobase_libsciui_data_la_icons_DATA)'; test -n "$(libsciui_data_la_iconsdir)" || list=; \
@@ -1313,7 +1300,7 @@ check: $(BUILT_SOURCES)
        $(MAKE) $(AM_MAKEFLAGS) check-am
 all-am: Makefile $(LTLIBRARIES) $(DATA) all-local
 installdirs:
-       for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(libsciui_data_la_etcdir)" "$(DESTDIR)$(libsciui_data_la_rootdir)" "$(DESTDIR)$(libsciui_data_la_sci_gatewaydir)" "$(DESTDIR)$(libsciui_data_la_iconsdir)"; do \
+       for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(libsciui_data_la_etcdir)" "$(DESTDIR)$(libsciui_data_la_rootdir)" "$(DESTDIR)$(libsciui_data_la_iconsdir)"; do \
          test -z "$$dir" || $(MKDIR_P) "$$dir"; \
        done
 install: $(BUILT_SOURCES)
@@ -1343,8 +1330,6 @@ clean-generic:
 distclean-generic:
        -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
        -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-       -rm -f sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
-       -rm -f sci_gateway/c/$(am__dirstamp)
        -rm -f sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
        -rm -f sci_gateway/cpp/$(am__dirstamp)
        -rm -f src/c/$(DEPDIR)/$(am__dirstamp)
@@ -1366,7 +1351,7 @@ clean-am: clean-generic clean-libtool clean-local \
        clean-noinstLTLIBRARIES clean-pkglibLTLIBRARIES mostlyclean-am
 
 distclean: distclean-am
-       -rm -rf sci_gateway/c/$(DEPDIR) sci_gateway/cpp/$(DEPDIR) src/c/$(DEPDIR) src/cpp/$(DEPDIR) src/jni/$(DEPDIR) src/noui_data/$(DEPDIR)
+       -rm -rf sci_gateway/cpp/$(DEPDIR) src/c/$(DEPDIR) src/cpp/$(DEPDIR) src/jni/$(DEPDIR) src/noui_data/$(DEPDIR)
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
        distclean-local distclean-tags
@@ -1385,7 +1370,6 @@ info-am:
 
 install-data-am: install-data-local install-libsciui_data_la_etcDATA \
        install-libsciui_data_la_rootDATA \
-       install-libsciui_data_la_sci_gatewayDATA \
        install-nobase_libsciui_data_la_iconsDATA
 
 install-dvi: install-dvi-am
@@ -1415,7 +1399,7 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-       -rm -rf sci_gateway/c/$(DEPDIR) sci_gateway/cpp/$(DEPDIR) src/c/$(DEPDIR) src/cpp/$(DEPDIR) src/jni/$(DEPDIR) src/noui_data/$(DEPDIR)
+       -rm -rf sci_gateway/cpp/$(DEPDIR) src/c/$(DEPDIR) src/cpp/$(DEPDIR) src/jni/$(DEPDIR) src/noui_data/$(DEPDIR)
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
@@ -1434,7 +1418,6 @@ ps-am:
 
 uninstall-am: uninstall-libsciui_data_la_etcDATA \
        uninstall-libsciui_data_la_rootDATA \
-       uninstall-libsciui_data_la_sci_gatewayDATA \
        uninstall-nobase_libsciui_data_la_iconsDATA \
        uninstall-pkglibLTLIBRARIES
 
@@ -1450,8 +1433,7 @@ uninstall-am: uninstall-libsciui_data_la_etcDATA \
        install-dvi-am install-exec install-exec-am install-html \
        install-html-am install-html-local install-info \
        install-info-am install-libsciui_data_la_etcDATA \
-       install-libsciui_data_la_rootDATA \
-       install-libsciui_data_la_sci_gatewayDATA install-man \
+       install-libsciui_data_la_rootDATA install-man \
        install-nobase_libsciui_data_la_iconsDATA install-pdf \
        install-pdf-am install-pkglibLTLIBRARIES install-ps \
        install-ps-am install-strip installcheck installcheck-am \
@@ -1460,7 +1442,6 @@ uninstall-am: uninstall-libsciui_data_la_etcDATA \
        mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
        uninstall-am uninstall-libsciui_data_la_etcDATA \
        uninstall-libsciui_data_la_rootDATA \
-       uninstall-libsciui_data_la_sci_gatewayDATA \
        uninstall-nobase_libsciui_data_la_iconsDATA \
        uninstall-pkglibLTLIBRARIES
 
index 034c10e..b0f554c 100644 (file)
 
 #ifndef __BROWSE_VAR_MANAGER_H__
 #define __BROWSE_VAR_MANAGER_H__
-/*--------------------------------------------------------------------------*/#
-#include "dynlib_ui_data.h"
 
+#include "dynlib_ui_data.h"
+/*--------------------------------------------------------------------------*/
 UI_DATA_IMPEXP void OpenBrowseVar();
 UI_DATA_IMPEXP void UpdateBrowseVar();
 UI_DATA_IMPEXP void SetBrowseVarData();
-
 /*--------------------------------------------------------------------------*/
 #endif /* __BROWSE_VAR_MANAGER_H__ */
diff --git a/scilab/modules/ui_data/includes/gw_ui_data.h b/scilab/modules/ui_data/includes/gw_ui_data.h
deleted file mode 100644 (file)
index c4e8b6d..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
-* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-* Copyright (C) 2010 - DIGITEO - Allan CORNET
-*
-* 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_UI_DATA__
-#define __GW_UI_DATA__
-/*--------------------------------------------------------------------------*/
-#include "dynlib_ui_data.h"
-/*--------------------------------------------------------------------------*/
-UI_DATA_IMPEXP int gw_ui_data(void);
-UI_DATA_IMPEXP int sci_editvar(char* fname, void* pvApiCtx);
-UI_DATA_IMPEXP int sci_browsevar(char* fname, void* pvApiCtx);
-UI_DATA_IMPEXP int sci_filebrowser(char* fname, void* pvApiCtx);
-UI_DATA_IMPEXP int sci_updatebrowsevar(char* fname, void* pvApiCtx);
-UI_DATA_IMPEXP int sci_closeEditvar(char* fname, void* pvApiCtx);
-/*--------------------------------------------------------------------------*/
-#endif /* __GW_UI_DATA__ */
-/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/ui_data/includes/ui_data_gw.hxx b/scilab/modules/ui_data/includes/ui_data_gw.hxx
new file mode 100644 (file)
index 0000000..be7e7a4
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+*  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+*  Copyright (C) 2015 - Scilab Enterprises - Antoine ELIAS
+*
+*  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 __UI_DATA_GW_HXX__
+#define __UI_DATA_GW_HXX__
+
+#include "cpp_gateway_prototype.hxx"
+#include "c_gateway_prototype.h"
+#include "dynlib_ui_data.h"
+
+class UiDataModule
+{
+private:
+    UiDataModule() {};
+    ~UiDataModule() {};
+public:
+    UI_DATA_IMPEXP static int Load();
+    UI_DATA_IMPEXP static int Unload()
+    {
+        return 1;
+    }
+};
+
+CPP_GATEWAY_PROTOTYPE(sci_browsevar);
+C_GATEWAY_PROTOTYPE(sci_editvar);
+CPP_GATEWAY_PROTOTYPE(sci_filebrowser);
+CPP_GATEWAY_PROTOTYPE(sci_updatebrowsevar);
+CPP_GATEWAY_PROTOTYPE(sci_closeEditvar);
+
+#endif /* __UI_DATA_GW_HXX__ */
diff --git a/scilab/modules/ui_data/sci_gateway/c/gw_ui_data.c b/scilab/modules/ui_data/sci_gateway/c/gw_ui_data.c
deleted file mode 100644 (file)
index 6b9272c..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- *  Copyright (C) 2010 - DIGITEO - Allan CORNET
- *
- *  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
- *
- */
-/*--------------------------------------------------------------------------*/
-#include <string.h>
-#include "gw_ui_data.h"
-#include "callFunctionFromGateway.h"
-#include "BOOL.h"
-/*--------------------------------------------------------------------------*/
-int gw_ui_data(void)
-{
-    return 0;
-}
-/*--------------------------------------------------------------------------*/
index 087d1d2..5a7e674 100644 (file)
@@ -1,7 +1,6 @@
 /*
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2010 - DIGITEO - Allan CORNET
- * Copyright (C) 2010 - DIGITEO - Bruno JOFRET
+ * Copyright (C) 2015 - Scilab Enterprises - Antoine ELIAS
  *
  * This file must be used under the terms of the CeCILL.
  * This source file is licensed as described in the file COPYING, which
  *
  */
 
+#include "ui_data_gw.hxx"
+#include "ui_data.h"
+#include "function.hxx"
+
 extern "C"
 {
-#include "gw_ui_data.h"
-#include "api_scilab.h"
+#include "Scierror.h"
 #include "BrowseVarManager.h"
 }
+
+static const std::string fname("browsevar");
 /*--------------------------------------------------------------------------*/
-int sci_browsevar(char *fname, void* pvApiCtx)
+types::Function::ReturnValue sci_browsevar(types::typed_list &in, int _iRetCount, types::typed_list &out)
 {
-    CheckRhs(0, 0);
-    CheckLhs(0, 1);
+    if (in.size() != 0)
+    {
+        Scierror(999, _("%s: Wrong number of input arguments: %d expected.\n"), fname.data(), 0);
+        return types::Function::Error;
+    }
 
-    OpenBrowseVar();
+    if (_iRetCount != 1)
+    {
+        Scierror(999, _("%s: Wrong number of output arguments: %d expected.\n"), fname.data(), 1);
+        return types::Function::Error;
+    }
 
-    LhsVar(1) = 0;
-    PutLhsVar();
+    OpenBrowseVar();
 
-    return 0;
+    return types::Function::OK;
 }
index ccbbe27..e38252f 100644 (file)
@@ -1,37 +1,47 @@
 /*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2012 - Scilab Enterprises - 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
- *
- */
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2012 - Scilab Enterprises - Calixte DENIZET
+* Copyright (C) 2015 - Scilab Enterprises - Antoine ELIAS
+*
+* 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
+*
+*/
 
+#include "ui_data_gw.hxx"
+#include "ui_data.h"
+#include "function.hxx"
 #include "EditVar.hxx"
 #include "GiwsException.hxx"
 
 extern "C"
 {
-#include "gw_ui_data.h"
 #include "getScilabJavaVM.h"
-#include "api_scilab.h"
+#include "Scierror.h"
 }
 
 using namespace org_scilab_modules_ui_data;
 
+static const std::string fname("closeEditvar");
 /*--------------------------------------------------------------------------*/
-int sci_closeEditvar(char *fname, void *pvApiCtx)
+types::Function::ReturnValue sci_closeEditvar(types::typed_list &in, int _iRetCount, types::typed_list &out)
 {
-    CheckOutputArgument(pvApiCtx, 1, 1);
-    CheckInputArgument(pvApiCtx, 0, 0);
+    if (in.size() != 0)
+    {
+        Scierror(999, _("%s: Wrong number of input arguments: %d expected.\n"), fname.data(), 0);
+        return types::Function::Error;
+    }
 
-    EditVar::closeVariableEditor(getScilabJavaVM());
+    if (_iRetCount != 1)
+    {
+        Scierror(999, _("%s: Wrong number of output arguments: %d expected.\n"), fname.data(), 1);
+        return types::Function::Error;
+    }
 
-    AssignOutputVariable(pvApiCtx, 1) = 0;
-    ReturnArguments(pvApiCtx);
+    EditVar::closeVariableEditor(getScilabJavaVM());
 
-    return 0;
+    return types::Function::OK;
 }
index d3165ca..2355c9d 100644 (file)
@@ -20,7 +20,6 @@
 
 extern "C"
 {
-#include "gw_ui_data.h"
 #include "api_scilab.h"
 #include "localization.h"
 #include "Scierror.h"
@@ -142,7 +141,6 @@ int sci_editvar(char * fname, void* pvApiCtx)
     double ** ppdblImgMatrix = NULL;
 
     char ** pstData = NULL;
-    int * piLen = NULL;
     char *** ppstData = NULL;
 
     int * piAddressVarOne = NULL;
@@ -188,39 +186,9 @@ int sci_editvar(char * fname, void* pvApiCtx)
         return 0;
     }
 
-    /* get dimensions */
-    sciErr = getMatrixOfString(pvApiCtx, piAddressVarOne, &m1, &n1, NULL, NULL);
-    if (sciErr.iErr)
-    {
-        printError(&sciErr, 0);
-        Scierror(999, _("%s: Can not read input argument #%d.\n"), fname, 1);
-        return 0;
-    }
-
-    /* TODO maybe allow vectors in case someone wants to edit several variables in the same time? */
-    if (m1 != 1 || n1 != 1)
-    {
-        Scierror(999, _("%s: Wrong size for input argument #%d: A string expected.\n"), fname, 1);
-        return 0;
-    }
-
-    /* get lengths */
-    sciErr = getMatrixOfString(pvApiCtx, piAddressVarOne, &m1, &n1, &lenStVarOne, NULL);
-    if (sciErr.iErr)
+    /* get variable name */
+    if (getAllocatedSingleString(pvApiCtx, piAddressVarOne, &pStVarOne))
     {
-        printError(&sciErr, 0);
-        Scierror(999, _("%s: Can not read input argument #%d.\n"), fname, 1);
-        return 0;
-    }
-
-    pStVarOne = (char*)MALLOC(sizeof(char*) * (lenStVarOne + 1));
-
-    /* get variable name to edit */
-    sciErr = getMatrixOfString(pvApiCtx, piAddressVarOne, &m1, &n1, &lenStVarOne, &pStVarOne);
-    if (sciErr.iErr)
-    {
-        FREE(pStVarOne);
-        printError(&sciErr, 0);
         Scierror(999, _("%s: Can not read input argument #%d.\n"), fname, 1);
         return 0;
     }
@@ -241,31 +209,31 @@ int sci_editvar(char * fname, void* pvApiCtx)
         return 0;
     }
 
-    /* Workaround to check for permanent variable.
-     * TODO: in Scilab 6.0, use an API specific function for write protection. */
+    /* Workaround to check for permanent variable.*/
+
     if (strcmp(pStVarOne, "$")                     == 0 ||
-            strcmp(pStVarOne, "%e")            == 0 ||
+            strcmp(pStVarOne, "%e")                == 0 ||
             strcmp(pStVarOne, "%eps")          == 0 ||
-            strcmp(pStVarOne, "%fftw")         == 0 ||
-            strcmp(pStVarOne, "%f")            == 0 ||
-            strcmp(pStVarOne, "%F")            == 0 ||
+            strcmp(pStVarOne, "%fftw")         == 0 ||
+            strcmp(pStVarOne, "%f")                == 0 ||
+            strcmp(pStVarOne, "%F")                == 0 ||
             strcmp(pStVarOne, "%gui")          == 0 ||
-            strcmp(pStVarOne, "%i")            == 0 ||
+            strcmp(pStVarOne, "%i")                == 0 ||
             strcmp(pStVarOne, "%io")           == 0 ||
             strcmp(pStVarOne, "%inf")          == 0 ||
             strcmp(pStVarOne, "%nan")          == 0 ||
             strcmp(pStVarOne, "%pi")           == 0 ||
-            strcmp(pStVarOne, "%s")            == 0 ||
+            strcmp(pStVarOne, "%s")            == 0 ||
             strcmp(pStVarOne, "%tk")           == 0 ||
-            strcmp(pStVarOne, "%t")            == 0 ||
-            strcmp(pStVarOne, "%T")            == 0 ||
-            strcmp(pStVarOne, "%z")            == 0 ||
+            strcmp(pStVarOne, "%t")            == 0 ||
+            strcmp(pStVarOne, "%T")            == 0 ||
+            strcmp(pStVarOne, "%z")            == 0 ||
             strcmp(pStVarOne, "evoid")     == 0 ||
             strcmp(pStVarOne, "home")          == 0 ||
             strcmp(pStVarOne, "PWD")           == 0 ||
             strcmp(pStVarOne, "SCI")           == 0 ||
             strcmp(pStVarOne, "SCIHOME")       == 0 ||
-            strcmp(pStVarOne, "TMPDIR")        == 0 )
+            strcmp(pStVarOne, "TMPDIR")        == 0 )
     {
         Scierror(13, _("Redefining permanent variable.\n"), fname);
         FREE(pStVarOne);
@@ -466,41 +434,10 @@ int sci_editvar(char * fname, void* pvApiCtx)
 
         case sci_strings :
 
-            //first call to retrieve dimensions
-            sciErr = getMatrixOfString(pvApiCtx, piAddr, &iRows, &iCols, NULL, NULL);
-            if (sciErr.iErr)
-            {
-                FREE(pStVarOne);
-                printError(&sciErr, 0);
-                Scierror(999, _("%s: Can not read input argument #%d.\n"), fname, 1);
-                return 0;
-            }
-
-            piLen = (int*)malloc(sizeof(int) * iRows * iCols);
-
-            //second call to retrieve length of each string
-            sciErr = getMatrixOfString(pvApiCtx, piAddr, &iRows, &iCols, piLen, NULL);
-            if (sciErr.iErr)
-            {
-                FREE(pStVarOne);
-                FREE(piLen);
-                printError(&sciErr, 0);
-                Scierror(999, _("%s: Can not read input argument #%d.\n"), fname, 1);
-                return 0;
-            }
-
-            pstData = (char**)calloc(iRows * iCols, sizeof(char*));
-            for (int i = 0 ; i < iRows * iCols ; i++)
-            {
-                pstData[i] = (char*)malloc(sizeof(char) * (piLen[i] + 1));//+ 1 for null termination
-            }
-            //third call to retrieve data
-            sciErr = getMatrixOfString(pvApiCtx, piAddr, &iRows, &iCols, piLen, pstData);
-            if (sciErr.iErr)
+            //retrieve data
+            if (getAllocatedMatrixOfString(pvApiCtx, piAddr, &iRows, &iCols, &pstData))
             {
                 FREE(pStVarOne);
-                FREE(piLen);
-                freeArrayOfString(pstData, iRows * iCols);
                 printError(&sciErr, 0);
                 Scierror(999, _("%s: Can not read input argument #%d.\n"), fname, 1);
                 return 0;
@@ -508,7 +445,7 @@ int sci_editvar(char * fname, void* pvApiCtx)
 
             /*
              * we need this to make the links between the API (which return a char**)
-             * and the JNI which needs a char***
+             * and the JNI which needs a 2-dims char*
              */
             ppstData = wrap<char *, char *>(pstData, iRows, iCols);
 
@@ -529,8 +466,7 @@ int sci_editvar(char * fname, void* pvApiCtx)
                 Scierror(999, _("%s: Java exception arisen:\n%s\n"), fname, e.what());
             }
 
-            FREE(piLen);
-            freeArrayOfString(pstData, iRows * iCols);
+            freeAllocatedMatrixOfString(iRows, iCols, pstData);
 
             clearWrap<char *>(ppstData, iRows);
 
index 9ed51d7..66eaa1e 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2011 - DIGITEO - Calixte DENIZET
+ * Copyright (C) 2015 - Scilab Enterprises - Antoine ELIAS
  *
  * This file must be used under the terms of the CeCILL.
  * This source file is licensed as described in the file COPYING, which
  *
  */
 
+#include "ui_data_gw.hxx"
+#include "ui_data.h"
+#include "function.hxx"
 #include "FileBrowser.hxx"
 
 extern "C"
 {
-#include "gw_ui_data.h"
+#include "Scierror.h"
 #include "getScilabJavaVM.h"
-#include "api_scilab.h"
 #include "scicurdir.h"
 }
-
+/*--------------------------------------------------------------------------*/
 using namespace org_scilab_modules_ui_data;
-
 /*--------------------------------------------------------------------------*/
-int sci_filebrowser(char *fname, void* pvApiCtx)
+static const std::string fname("filebrowser");
+/*--------------------------------------------------------------------------*/
+types::Function::ReturnValue sci_filebrowser(types::typed_list &in, int _iRetCount, types::typed_list &out)
 {
     char * cwd = NULL;
     int err = 0;
 
-    CheckRhs(0, 0);
-    CheckLhs(0, 1);
+    if (in.size() != 0)
+    {
+        Scierror(999, _("%s: Wrong number of input arguments: %d expected.\n"), fname.data(), 0);
+        return types::Function::Error;
+    }
+
+    if (_iRetCount != 1)
+    {
+        Scierror(999, _("%s: Wrong number of output arguments: %d expected.\n"), fname.data(), 1);
+        return types::Function::Error;
+    }
 
     FileBrowser::openFileBrowser(getScilabJavaVM());
 
@@ -39,8 +52,5 @@ int sci_filebrowser(char *fname, void* pvApiCtx)
         FileBrowser::setBaseDir(getScilabJavaVM(), cwd);
     }
 
-    LhsVar(1) = 0;
-    PutLhsVar();
-
-    return 0;
+    return types::Function::OK;
 }
index a85bdd4..84e41d3 100644 (file)
@@ -1,33 +1,42 @@
 /*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2010 - DIGITEO - Allan CORNET
- * Copyright (C) 2010 - DIGITEO - Bruno JOFRET
- *
- * 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
- *
- */
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2015 - Scilab Enterprises - Antoine ELIAS
+*
+* 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
+*
+*/
+
+#include "ui_data_gw.hxx"
+#include "ui_data.h"
+#include "function.hxx"
 
 extern "C"
 {
-#include "gw_ui_data.h"
-#include "api_scilab.h"
+#include "Scierror.h"
 #include "BrowseVarManager.h"
 }
 
+static const std::string fname("updatebrowsevar");
 /*--------------------------------------------------------------------------*/
-int sci_updatebrowsevar(char *fname, void* pvApiCtx)
+types::Function::ReturnValue sci_updatebrowsevar(types::typed_list &in, int _iRetCount, types::typed_list &out)
 {
-    CheckRhs(0, 0);
-    CheckLhs(0, 1);
+    if (in.size() != 0)
+    {
+        Scierror(999, _("%s: Wrong number of input arguments: %d expected.\n"), fname.data(), 0);
+        return types::Function::Error;
+    }
+
+    if (_iRetCount != 1)
+    {
+        Scierror(999, _("%s: Wrong number of output arguments: %d expected.\n"), fname.data(), 1);
+        return types::Function::Error;
+    }
 
     UpdateBrowseVar();
 
-    LhsVar(1) = 0;
-    PutLhsVar();
-    return 0;
+    return types::Function::OK;
 }
-/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/ui_data/sci_gateway/cpp/ui_data_gw.cpp b/scilab/modules/ui_data/sci_gateway/cpp/ui_data_gw.cpp
new file mode 100644 (file)
index 0000000..1169f9b
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+*  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+*  Copyright (C) 2008-2008 - DIGITEO - Antoine ELIAS
+*  Copyright (C) 2011-2011 - DIGITEO - Bruno JOFRET
+*
+*  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 "ui_data_gw.hxx"
+#include "context.hxx"
+#include "overload.hxx"
+#include "execvisitor.hxx"
+#include "Scierror.h"
+#include "localization.h"
+#include "charEncoding.h"
+
+#define MODULE_NAME L"ui_data"
+
+int UiDataModule::Load()
+{
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"browsevar", &sci_browsevar, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"editvar", &sci_editvar, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"filebrowser", &sci_filebrowser, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"updatebrowsevar", &sci_updatebrowsevar, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"closeEditvar", &sci_closeEditvar, MODULE_NAME));
+
+    return 0;
+}
\ No newline at end of file
diff --git a/scilab/modules/ui_data/sci_gateway/ui_data_gateway.xml b/scilab/modules/ui_data/sci_gateway/ui_data_gateway.xml
deleted file mode 100644 (file)
index 138bbdb..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-
-<!DOCTYPE GATEWAY SYSTEM "../../functions/xml/gateway.dtd">
-<GATEWAY name="ui_data">
-    <!-- =================== -->
-    <!--
- Scilab
- Interface description. In this file, we define the list of the function which
- will be available into Scilab and the link to the "native" function.
-
- gatewayId is the position in the hashtable 'Interfaces' defined in the
- file SCI/modules/core/src/c/callinterf.h
-
- primitiveId is the position in the hashtable '<module>Table Tab[]' defined
- in the file modules/<module>/sci_gateway/c/gw_<module>.c
-
- primitiveName is the name of the Scilab function
-
- @author Allan CORNET
- @date DIGITEO 2010
- ===================
- Don't touch if you do not know what you are doing
--->
-    <!-- =================== -->
-    
-    <PRIMITIVE gatewayId="67" primitiveId="1" primitiveName="editvar" />
-    <PRIMITIVE gatewayId="67" primitiveId="2" primitiveName="browsevar" />
-    <PRIMITIVE gatewayId="67" primitiveId="3" primitiveName="filebrowser" />
-    <PRIMITIVE gatewayId="67" primitiveId="4" primitiveName="updatebrowsevar" />
-    <PRIMITIVE gatewayId="67" primitiveId="5" primitiveName="closeEditvar" />
-</GATEWAY>
index f5c5017..8c0fc7d 100644 (file)
@@ -85,7 +85,7 @@
     <ClCompile>
       <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>.;../jni;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../../../libs/intl;../../includes;../../../api_scilab/includes;../../../core/includes;../../../localization/includes;../../../jvm/includes;../../../output_stream/includes;../cpp;../../../functions/includes;../../../fileio/includes;../../../string/includes;../../../ast/includes/operations;../../../commons/src/jni;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>.;../../includes;../jni;../cpp;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../../../libs/intl;../../../../libs/Eigen/includes;../../../api_scilab/includes;../../../core/includes;../../../jvm/includes;../../../output_stream/includes;../../../fileio/includes;../../../commons/src/jni;../../../functions_manager/includes;../../../localization/includes;../../../threads/includes;../../../string/includes;../../../console/includes;../../../dynamic_link/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>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;UI_DATA_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>Default</BasicRuntimeChecks>
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>.;../jni;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../../../libs/intl;../../includes;../../../api_scilab/includes;../../../core/includes;../../../localization/includes;../../../jvm/includes;../../../output_stream/includes;../cpp;../../../functions/includes;../../../fileio/includes;../../../string/includes;../../../ast/includes/operations;../../../commons/src/jni;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>.;../../includes;../jni;../cpp;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../../../libs/intl;../../../../libs/Eigen/includes;../../../api_scilab/includes;../../../core/includes;../../../jvm/includes;../../../output_stream/includes;../../../fileio/includes;../../../commons/src/jni;../../../functions_manager/includes;../../../localization/includes;../../../threads/includes;../../../string/includes;../../../console/includes;../../../dynamic_link/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>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;UI_DATA_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>Default</BasicRuntimeChecks>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>.;../jni;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../../../libs/intl;../../includes;../../../api_scilab/includes;../../../core/includes;../../../localization/includes;../../../jvm/includes;../../../output_stream/includes;../cpp;../../../functions/includes;../../../fileio/includes;../../../string/includes;../../../ast/includes/operations;../../../commons/src/jni;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>.;../../includes;../jni;../cpp;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../../../libs/intl;../../../../libs/Eigen/includes;../../../api_scilab/includes;../../../core/includes;../../../jvm/includes;../../../output_stream/includes;../../../fileio/includes;../../../commons/src/jni;../../../functions_manager/includes;../../../localization/includes;../../../threads/includes;../../../string/includes;../../../console/includes;../../../dynamic_link/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>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;UI_DATA_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>.;../jni;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../../../libs/intl;../../includes;../../../api_scilab/includes;../../../core/includes;../../../localization/includes;../../../jvm/includes;../../../output_stream/includes;../cpp;../../../functions/includes;../../../fileio/includes;../../../string/includes;../../../ast/includes/operations;../../../commons/src/jni;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>.;../../includes;../jni;../cpp;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../../../libs/intl;../../../../libs/Eigen/includes;../../../api_scilab/includes;../../../core/includes;../../../jvm/includes;../../../output_stream/includes;../../../fileio/includes;../../../commons/src/jni;../../../functions_manager/includes;../../../localization/includes;../../../threads/includes;../../../string/includes;../../../console/includes;../../../dynamic_link/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>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;UI_DATA_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
     <ClCompile Include="..\..\sci_gateway\cpp\sci_closeEditvar.cpp" />
     <ClCompile Include="..\..\sci_gateway\cpp\sci_filebrowser.cpp" />
     <ClCompile Include="..\..\sci_gateway\cpp\sci_updatebrowsevar.cpp" />
+    <ClCompile Include="..\..\sci_gateway\cpp\ui_data_gw.cpp" />
     <ClCompile Include="..\cpp\FileBrowserChDir.cpp" />
     <ClCompile Include="..\cpp\BrowseVarManager.cpp" />
     <ClCompile Include="..\jni\BrowseVar.cpp" />
     <ClCompile Include="..\jni\FileBrowser.cpp" />
+    <ClCompile Include="..\jni\ui_data_wrap.c" />
     <ClCompile Include="DllmainUi_data.c" />
     <ClCompile Include="..\jni\EditVar.cpp" />
-    <ClCompile Include="..\..\sci_gateway\c\gw_ui_data.c" />
     <ClCompile Include="..\..\sci_gateway\cpp\sci_browsevar.cpp" />
     <ClCompile Include="..\..\sci_gateway\cpp\sci_editvar.cpp" />
     <ClCompile Include="PutScilabVariable.c" />
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\includes\FileBrowserChDir.h" />
-    <ClInclude Include="..\..\includes\ui_data.h" />
     <ClInclude Include="..\..\includes\BrowseVarManager.h" />
+    <ClInclude Include="..\..\includes\ui_data.h" />
+    <ClInclude Include="..\..\includes\ui_data_gw.hxx" />
     <ClInclude Include="..\jni\BrowseVar.hxx" />
     <ClInclude Include="..\..\includes\dynlib_ui_data.h" />
     <ClInclude Include="..\jni\EditVar.hxx" />
-    <ClInclude Include="..\..\includes\gw_ui_data.h" />
   </ItemGroup>
   <ItemGroup>
     <None Include="..\..\locales\ui_data.pot" />
       <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
+    <ProjectReference Include="..\..\..\ast\ast.vcxproj">
+      <Project>{0d3fa25b-8116-44ec-a45e-260789daa3d9}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\..\..\commons\src\c\commons.vcxproj">
       <Project>{eca09a1e-6d12-4a47-92e1-a671c181df77}</Project>
     </ProjectReference>
index 889d44c..ddeba92 100644 (file)
@@ -35,9 +35,6 @@
     <ClCompile Include="..\jni\EditVar.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\c\gw_ui_data.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\sci_gateway\cpp\sci_browsevar.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="..\cpp\BrowseVarManager.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\sci_gateway\cpp\ui_data_gw.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\jni\ui_data_wrap.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\jni\BrowseVar.hxx">
     <ClInclude Include="..\jni\EditVar.hxx">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\includes\gw_ui_data.h">
+    <ClInclude Include="..\..\includes\FileBrowserChDir.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\includes\FileBrowserChDir.h">
+    <ClInclude Include="..\..\includes\BrowseVarManager.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\includes\ui_data.h">
+    <ClInclude Include="..\..\includes\ui_data_gw.hxx">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\includes\BrowseVarManager.h">
+    <ClInclude Include="..\..\includes\ui_data.h">
       <Filter>Header Files</Filter>
     </ClInclude>
   </ItemGroup>
index d1ebecf..12f5e08 100644 (file)
  */
 
 #include <iostream>
-#include "BrowseVar.hxx"
-
 #include <sstream>
 #include <string>
 #include <iterator>
-using std::string;
-
 #include <set>
 
+#include "BrowseVar.hxx"
+#ifdef _MSC_VER
+#ifdef max
+#undef max
+#endif
+#ifdef min
+#undef min
+#endif
+#endif
+#include "context.hxx"
+
 extern "C"
 {
-#include <string.h>
 #include "BrowseVarManager.h"
 #include "localization.h"
 #include "sci_malloc.h"
 #include "BOOL.h"
-#include "stackinfo.h"
-#include "api_scilab.h"
 #include "getScilabJavaVM.h"
 #include "Scierror.h"
 #include "freeArrayOfString.h"
 #include "os_string.h"
-#include "sci_types.h"
+#include "api_scilab.h"
 }
+
+#define N_A             "N/A"
+#define EMPTY_MATRIX    "[ ]"
+#define LOCAL_STR       "local"
+#define GLOBAL_STR      "global"
+#define INHERITED_STR   "inherited"
+#define STRUCT_STR      "st"
+#define NEG_INF_STR     "-Inf"
+#define INF_STR         "Inf"
+#define NAN_STR         "NaN"
+#define PLUS_STR        " + "
+#define MINUS_STR       " - "
+#define I_STR           "i"
+#define LBRACKET_STR    "["
+#define RBRACKET_STR    "]"
+#define COMMA_STR       ", "
+#define SEMICOLON_STR   "; "
+
 using namespace org_scilab_modules_ui_data;
+using std::string;
 
-static std::set < string > createScilabDefaultVariablesSet();
+static std::set<string> createScilabDefaultVariablesSet();
 static char * getListName(char * variableName);
-static std::string formatMatrix(int nbRows, int nbCols, BOOL isComplex, double *pdblReal, double *pdblImg);
-static char * valueToDisplay(char * variableName, int variableType, int nbRows, int nbCols);
+static std::string formatMatrix(int nbRows, int nbCols, double *pdblReal, double *pdblImg);
+static char * valueToDisplay(types::InternalType* pIT, int variableType, int nbRows, int nbCols);
 void OpenBrowseVar()
 {
     BrowseVar::openVariableBrowser(getScilabJavaVM());
@@ -58,67 +81,87 @@ void UpdateBrowseVar()
 
 void SetBrowseVarData()
 {
-#if 0
     SciErr err;
-    int iGlobalVariablesUsed = 0;
-    int iGlobalVariablesTotal = 0;
     int iLocalVariablesUsed = 0;
-    int iLocalVariablesTotal = 0;
     int i = 0;
 
-    // First get how many global / local variable we have.
-    C2F(getvariablesinfo) (&iLocalVariablesTotal, &iLocalVariablesUsed);
-    C2F(getgvariablesinfo) (&iGlobalVariablesTotal, &iGlobalVariablesUsed);
-
-    char **pstAllVariableNames = (char **)MALLOC((iLocalVariablesUsed + iGlobalVariablesUsed) * sizeof(char *));
-    char **pstAllVariableVisibility = (char **)MALLOC((iLocalVariablesUsed + iGlobalVariablesUsed) * sizeof(char *));
-    char **pstAllVariableListTypes = (char **)MALLOC((iLocalVariablesUsed + iGlobalVariablesUsed) * sizeof(char *));
-    int *piAllVariableBytes = (int *)MALLOC((iLocalVariablesUsed + iGlobalVariablesUsed) * sizeof(int));
-    char **pstAllVariableSizes = (char **)MALLOC((iLocalVariablesUsed + iGlobalVariablesUsed) * sizeof(char *));
-    int *piAllVariableTypes = (int *)MALLOC((iLocalVariablesUsed + iGlobalVariablesUsed) * sizeof(int));
-    int *piAllVariableIntegerTypes = (int *)MALLOC((iLocalVariablesUsed + iGlobalVariablesUsed) * sizeof(int));
-    bool *piAllVariableFromUser = (bool *) MALLOC((iLocalVariablesUsed + iGlobalVariablesUsed) * sizeof(bool));
+    symbol::Context* ctx = symbol::Context::getInstance();
+    std::list<symbol::Variable*>* lstVars = ctx->getVarsToVariableBrowser();
+    std::list<symbol::Library*>* lstLibs = ctx->getLibsToVariableBrowser();
+    iLocalVariablesUsed = static_cast<int>(lstVars->size() + lstLibs->size());
+
+    char **pstAllVariableNames = new char*[iLocalVariablesUsed];
+    char **pstAllVariableVisibility = new char*[iLocalVariablesUsed];
+    char **pstAllVariableListTypes = new char*[iLocalVariablesUsed];
+    int *piAllVariableBytes = new int[iLocalVariablesUsed];
+    char **pstAllVariableSizes = new char*[iLocalVariablesUsed];
+    int *piAllVariableTypes = new int[iLocalVariablesUsed];
+    int *piAllVariableIntegerTypes = new int[iLocalVariablesUsed];
+    bool *piAllVariableFromUser = new bool[iLocalVariablesUsed];
     /* Necessary for the plots in the var browser */
-    int *piAllVariableNbRows = (int *)MALLOC((iLocalVariablesUsed + iGlobalVariablesUsed) * sizeof(int));
-    int *piAllVariableNbCols = (int *)MALLOC((iLocalVariablesUsed + iGlobalVariablesUsed) * sizeof(int));
+    int *piAllVariableNbRows = new int[iLocalVariablesUsed];
+    int *piAllVariableNbCols = new int[iLocalVariablesUsed];
 
     int nbRows, nbCols;
     char *sizeStr = NULL;
 
-    std::set < string > scilabDefaultVariablesSet = createScilabDefaultVariablesSet();
+    std::set<string> scilabDefaultVariablesSet = createScilabDefaultVariablesSet();
+    int iLevel = ctx->getScopeLevel();
 
     // for each local variable get information
-    for (; i < iLocalVariablesUsed; ++i)
+    for (auto var : *lstVars)
     {
-        // name
-        pstAllVariableNames[i] = getLocalNamefromId(i + 1);
+        //get top level value
+        symbol::ScopedVariable* sv = var->top();
+        //get value
+        types::InternalType* pIT = sv->m_pIT;
+
+        // get name
+        pstAllVariableNames[i] = wide_string_to_UTF8(var->getSymbol().getName().data());
+
+        // get visibility
+        if (sv->m_globalVisible == true)
+        {
+            pstAllVariableVisibility[i] = os_strdup(GLOBAL_STR);
+            pIT = var->getGlobalValue();
+        }
+        else if (sv->m_iLevel != iLevel)
+        {
+            pstAllVariableVisibility[i] = os_strdup(INHERITED_STR);
+        }
+        else
+        {
+            pstAllVariableVisibility[i] = os_strdup(LOCAL_STR);
+        }
+
         // type
-        err = getNamedVarType(pvApiCtx, pstAllVariableNames[i], &piAllVariableTypes[i]);
+        err = getVarType(NULL, (int*)pIT, &piAllVariableTypes[i]);
         if (!err.iErr)
         {
-            piAllVariableBytes[i] = getLocalSizefromId(i);
-            err = getNamedVarDimension(pvApiCtx, pstAllVariableNames[i], &nbRows, &nbCols);
+            piAllVariableBytes[i] = 0;
+            err = getVarDimension(NULL, (int*)pIT, &nbRows, &nbCols);
         }
 
-        if (err.iErr || nbRows * nbCols == 0)
+        if (err.iErr)
+        {
+            pstAllVariableSizes[i] = os_strdup(N_A);
+        }
+        else if (nbRows * nbCols == 0)
         {
-#define N_A "N/A"
-            pstAllVariableSizes[i] = (char *)MALLOC((sizeof(N_A) + 1) * sizeof(char));
-            strcpy(pstAllVariableSizes[i], N_A);
+            pstAllVariableSizes[i] = os_strdup(EMPTY_MATRIX);
         }
         else
         {
-            pstAllVariableSizes[i] = valueToDisplay(pstAllVariableNames[i], piAllVariableTypes[i], nbRows, nbCols);
+            pstAllVariableSizes[i] = valueToDisplay(pIT, piAllVariableTypes[i], nbRows, nbCols);
             piAllVariableNbRows[i] = nbRows;
             piAllVariableNbCols[i] = nbCols;
         }
 
-
         if (piAllVariableTypes[i] == sci_ints)
         {
             // Integer case
             int iPrec       = 0;
-            err = getNamedMatrixOfIntegerPrecision(pvApiCtx, pstAllVariableNames[i], &iPrec);
+            err = getMatrixOfIntegerPrecision(NULL, (int*)pIT, &iPrec);
             switch (iPrec)
             {
                 case SCI_INT8:
@@ -145,19 +188,19 @@ void SetBrowseVarData()
             piAllVariableIntegerTypes[i] = -1;
         }
 
-        if (piAllVariableTypes[i] == sci_tlist || piAllVariableTypes[i] == sci_mlist)
+        if (pIT->isTList() || pIT->isMList())
         {
             pstAllVariableListTypes[i] = getListName(pstAllVariableNames[i]);
         }
+        else if (pIT->isStruct())
+        {
+            pstAllVariableListTypes[i] = os_strdup(STRUCT_STR);
+        }
         else
         {
-            pstAllVariableListTypes[i] = strdup("");
+            pstAllVariableListTypes[i] = os_strdup("");
         }
 
-
-        // global / local ??
-        pstAllVariableVisibility[i] = strdup("local");
-
         if (scilabDefaultVariablesSet.find(string(pstAllVariableNames[i])) == scilabDefaultVariablesSet.end() && piAllVariableTypes[i] != sci_lib)
         {
             piAllVariableFromUser[i] = TRUE;
@@ -166,113 +209,78 @@ void SetBrowseVarData()
         {
             piAllVariableFromUser[i] = FALSE;
         }
+
+        ++i;
     }
 
-    // for each global variable get information
-    for (int j = 0; j < iGlobalVariablesUsed; ++j, ++i)
+    for (auto lib : *lstLibs)
     {
-        // name
-        pstAllVariableNames[i] = getGlobalNamefromId(j);
-        // Bytes used - 8 is the number of bytes in a word
-        piAllVariableBytes[i] = getGlobalSizefromId(j) * 8;
-        // type
-        // Calling "API Scilab": not yet implemented for global variable
-        //getNamedVarType(pvApiCtx, pstAllVariableNames[i], &piAllVariableTypes[i]);
-        // Using old stack operations...
-        int pos = C2F(vstk).isiz + 2 + j;
-
-        piAllVariableTypes[i] = C2F(gettype) (&pos);
-
-        // Sizes of the variable
-        getNamedVarDimension(pvApiCtx, pstAllVariableNames[i], &nbRows, &nbCols);
-        pstAllVariableSizes[i] = valueToDisplay(pstAllVariableNames[i], piAllVariableTypes[i], nbRows, nbCols);
-        piAllVariableNbRows[i] = nbRows;
-        piAllVariableNbCols[i] = nbCols;
-
-
-        // global / local ??
-        pstAllVariableVisibility[i] = strdup("global");
-
-
-        if (piAllVariableTypes[i] == sci_tlist || piAllVariableTypes[i] == sci_mlist)
-        {
-            pstAllVariableListTypes[i] = getListName(pstAllVariableNames[i]);
-        }
-        else
-        {
-            pstAllVariableListTypes[i] = strdup("");
-        }
+        //get top level value
+        symbol::ScopedLibrary* sl = lib->top();
 
+        // get name
+        pstAllVariableNames[i] = wide_string_to_UTF8(lib->getSymbol().getName().data());
 
-        if (scilabDefaultVariablesSet.find(string(pstAllVariableNames[i])) == scilabDefaultVariablesSet.end()
-                && piAllVariableTypes[i] != sci_c_function && piAllVariableTypes[i] != sci_lib)
+        // get visibility
+        if (sl->m_iLevel != iLevel)
         {
-            piAllVariableFromUser[i] = TRUE;
+            pstAllVariableVisibility[i] = os_strdup(INHERITED_STR);
         }
         else
         {
-            piAllVariableFromUser[i] = FALSE;
+            pstAllVariableVisibility[i] = os_strdup(LOCAL_STR);
         }
+        //type
+        piAllVariableTypes[i] = sci_lib;
+
+        piAllVariableBytes[i] = 0;
+        pstAllVariableSizes[i] = os_strdup(N_A);
+        piAllVariableIntegerTypes[i] = -1;
+        pstAllVariableListTypes[i] = os_strdup("");
+        piAllVariableFromUser[i] = FALSE;
+        piAllVariableNbRows[i] = 1;
+        piAllVariableNbCols[i] = 1;
+
+        ++i;
     }
-
     // Launch Java Variable Browser through JNI
     BrowseVar::setVariableBrowserData(getScilabJavaVM(),
-                                      pstAllVariableNames, iLocalVariablesUsed + iGlobalVariablesUsed,
-                                      piAllVariableBytes, iLocalVariablesUsed + iGlobalVariablesUsed,
-                                      piAllVariableTypes, iLocalVariablesUsed + iGlobalVariablesUsed,
-                                      piAllVariableIntegerTypes, iLocalVariablesUsed + iGlobalVariablesUsed,
-                                      pstAllVariableListTypes, iLocalVariablesUsed + iGlobalVariablesUsed,
-                                      pstAllVariableSizes, iLocalVariablesUsed + iGlobalVariablesUsed,
-                                      piAllVariableNbRows, iLocalVariablesUsed + iGlobalVariablesUsed,
-                                      piAllVariableNbCols, iLocalVariablesUsed + iGlobalVariablesUsed,
-                                      pstAllVariableVisibility, iLocalVariablesUsed + iGlobalVariablesUsed,
-                                      piAllVariableFromUser, iLocalVariablesUsed + iGlobalVariablesUsed);
-
-    freeArrayOfString(pstAllVariableNames, iLocalVariablesUsed + iGlobalVariablesUsed);
-    freeArrayOfString(pstAllVariableVisibility, iLocalVariablesUsed + iGlobalVariablesUsed);
-    freeArrayOfString(pstAllVariableSizes, iLocalVariablesUsed + iGlobalVariablesUsed);
-    freeArrayOfString(pstAllVariableListTypes, iLocalVariablesUsed + iGlobalVariablesUsed);
-
-    if (piAllVariableFromUser)
+                                      pstAllVariableNames, iLocalVariablesUsed,
+                                      piAllVariableBytes, iLocalVariablesUsed,
+                                      piAllVariableTypes, iLocalVariablesUsed,
+                                      piAllVariableIntegerTypes, iLocalVariablesUsed,
+                                      pstAllVariableListTypes, iLocalVariablesUsed,
+                                      pstAllVariableSizes, iLocalVariablesUsed,
+                                      piAllVariableNbRows, iLocalVariablesUsed,
+                                      piAllVariableNbCols, iLocalVariablesUsed,
+                                      pstAllVariableVisibility, iLocalVariablesUsed,
+                                      piAllVariableFromUser, iLocalVariablesUsed);
+
+    for (int i = 0; i < iLocalVariablesUsed; ++i)
     {
-        FREE(piAllVariableFromUser);
-        piAllVariableFromUser = NULL;
+        FREE(pstAllVariableNames[i]);
+        FREE(pstAllVariableVisibility[i]);
+        FREE(pstAllVariableSizes[i]);
+        FREE(pstAllVariableListTypes[i]);
     }
 
-    if (piAllVariableBytes)
-    {
-        FREE(piAllVariableBytes);
-        piAllVariableBytes = NULL;
-    }
-
-    if (piAllVariableTypes)
-    {
-        FREE(piAllVariableTypes);
-        piAllVariableTypes = NULL;
-    }
-
-    if (piAllVariableIntegerTypes)
-    {
-        FREE(piAllVariableIntegerTypes);
-        piAllVariableIntegerTypes = NULL;
-    }
+    delete[] pstAllVariableNames;
+    delete[] pstAllVariableVisibility;
+    delete[] pstAllVariableSizes;
+    delete[] pstAllVariableListTypes;
 
-    if (piAllVariableNbRows)
-    {
-        FREE(piAllVariableNbRows);
-        piAllVariableNbRows = NULL;
-    }
+    delete[] piAllVariableFromUser;
+    delete[] piAllVariableBytes;
+    delete[] piAllVariableTypes;
+    delete[] piAllVariableIntegerTypes;
+    delete[] piAllVariableNbRows;
+    delete[] piAllVariableNbCols;
 
-    if (piAllVariableNbCols)
-    {
-        FREE(piAllVariableNbCols);
-        piAllVariableNbCols = NULL;
-    }
-#endif
+    delete lstVars;
 }
 
 /*--------------------------------------------------------------------------*/
-static std::set < string > createScilabDefaultVariablesSet()
+static std::set<string> createScilabDefaultVariablesSet()
 {
     string arr[] = { "home",
                      "PWD",
@@ -315,7 +323,7 @@ static std::set < string > createScilabDefaultVariablesSet()
     int i = 0;
 
 #define NBELEMENT 37
-    std::set < string > ScilabDefaultVariables;
+    std::set<string> ScilabDefaultVariables;
 
     for (i = 0; i < NBELEMENT; i++)
     {
@@ -356,29 +364,24 @@ static char * getListName(char * variableName)
     return tmpChar;
 }
 
-static char * valueToDisplay(char * variableName, int variableType, int nbRows, int nbCols)
+static char * valueToDisplay(types::InternalType* pIT, int variableType, int nbRows, int nbCols)
 {
-    SciErr err;
     // 4 is the dimension max to which display the content
     if (nbRows * nbCols <= 4 && variableType == sci_matrix)
     {
+        types::Double* pD = pIT->getAs<types::Double>();
         // Small double value, display it
-        double* pdblReal = (double *)malloc(((nbRows) * (nbCols)) * sizeof(double));
-        double* pdblImg = (double *)malloc(((nbRows) * (nbCols)) * sizeof(double));
-        BOOL isComplex = FALSE;
+        double* pdblReal = nullptr;
+        double* pdblImg = nullptr;
+        pdblReal = pD->get();
 
-        if (isNamedVarComplex(NULL, variableName))
+        if (pD->isComplex())
         {
-            err = readNamedComplexMatrixOfDouble(NULL, variableName, &nbRows, &nbCols, pdblReal, pdblImg);
-            isComplex = TRUE;
-        }
-        else
-        {
-            err = readNamedMatrixOfDouble(NULL, variableName, &nbRows, &nbCols, pdblReal);
+            pdblImg = pD->getImg();
         }
 
 
-        return os_strdup(formatMatrix(nbRows, nbCols, isComplex, pdblReal, pdblImg).c_str());
+        return os_strdup(formatMatrix(nbRows, nbCols, pdblReal, pdblImg).c_str());
     }
     else
     {
@@ -390,50 +393,90 @@ static char * valueToDisplay(char * variableName, int variableType, int nbRows,
     }
 }
 
-std::string formatMatrix(int nbRows, int nbCols, BOOL isComplex, double *pdblReal, double *pdblImg)
+std::string addDouble(double dbl)
 {
-    int i, j ;
 #define PRECISION_DISPLAY 3
+    std::ostringstream os;
+    if (ISNAN(dbl))
+    {
+        os << NAN_STR;
+    }
+    else if (finite(dbl))
+    {
+        os.precision(PRECISION_DISPLAY);
+        os << dbl; // Convert the double to string
+    }
+    else
+    {
+        if (dbl > 0)
+        {
+            os << INF_STR;
+        }
+        else
+        {
+            os << NEG_INF_STR;
+        }
+    }
+
+    return os.str();
+}
+std::string formatMatrix(int nbRows, int nbCols, double *pdblReal, double *pdblImg)
+{
+    int i, j ;
     if (nbRows * nbCols == 1)
     {
         std::ostringstream os;
-        os.precision(PRECISION_DISPLAY);
-        os << pdblReal[0]; // Convert the double to string
-        if (isComplex)
+        std::string formated = addDouble(pdblReal[0]);
+        if (pdblImg)
         {
-            os << " + " << pdblImg[0] << "i";
+            double img = pdblImg[0];
+            if (img > 0)
+            {
+                formated += PLUS_STR;
+            }
+            else
+            {
+                formated += MINUS_STR;
+            }
+            formated += addDouble(std::abs(img));
+            formated += I_STR;
         }
-        return os.str();
+        return formated;
     }
 
-    std::string formated = "[";
+    std::string formated = LBRACKET_STR;
     for (j = 0 ; j < nbRows ; j++)
     {
         for (i = 0 ; i < nbCols ; i++)
         {
             /* Display the formated matrix ... the way the user
              * expect */
-            std::ostringstream os;
-            os.precision(PRECISION_DISPLAY);
-            os << pdblReal[i * nbRows + j]; // Convert the double to string
-            formated += os.str();
-            if (isComplex)
+            formated += addDouble(pdblReal[i * nbRows + j]);
+            if (pdblImg)
             {
-                std::ostringstream osComplex;
-                osComplex.precision(PRECISION_DISPLAY);
-                osComplex << pdblImg[i * nbRows + j];
-                formated += " + " + osComplex.str() + "i";
+                double img = pdblImg[i * nbRows + j];
+                if (img > 0)
+                {
+                    formated += PLUS_STR;
+                }
+                else
+                {
+                    formated += MINUS_STR;
+                }
+
+                formated += addDouble(std::abs(img));
+                formated += I_STR;
             }
 
 
             if (i + 1 != nbCols) // Not the last element of the matrix
             {
-                formated += ", ";
+                formated += COMMA_STR;
             }
         }
         if (j + 1 != nbRows) // Not the last line of the matrix
         {
-            formated += "; ";
+            formated += SEMICOLON_STR;
         }
     }
     return formated + "]";
index 2eb6bf8..2a84200 100644 (file)
@@ -35,7 +35,7 @@ int gw_ui_data(void)
     return 0;
 }
 /*--------------------------------------------------------------------------*/
-void UpdateBrowseVar(BOOL b)
+void UpdateBrowseVar()
 {
     return;
 }
index ac1167f..4d15af4 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">
   <ItemGroup>
     <ClCompile Include="..\c\DllmainUi_data.c" />
     <ClCompile Include="noui_data.c" />
+    <ClCompile Include="noui_data_gw.cpp" />
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="noui_data.rc" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
index 6159bae..4dc7d16 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup>
     <Filter Include="Source Files">
@@ -21,6 +21,9 @@
     <ClCompile Include="noui_data.c">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="noui_data_gw.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
     <ClCompile Include="..\c\DllmainUi_data.c">
       <Filter>Source Files</Filter>
     </ClCompile>
@@ -30,4 +33,4 @@
       <Filter>Resource Files</Filter>
     </ResourceCompile>
   </ItemGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/scilab/modules/ui_data/src/noui_data/noui_data_gw.cpp b/scilab/modules/ui_data/src/noui_data/noui_data_gw.cpp
new file mode 100644 (file)
index 0000000..9514067
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ *  Copyright (C) 2015 - Scilab Enterprises - Vincent COUVERT
+ *
+ *  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 "ui_data_gw.hxx"
+
+int UiDataModule::Load()
+{
+    /* Do Nothing */
+    return true;
+}
index 6de87f9..449bca1 100644 (file)
 // <-- Short Description -->
 // Permanent variable check.
 refMsg = msprintf(_("Redefining permanent variable.\n"));
-assert_checkerror( "editvar(''$'')",                   refMsg);
-assert_checkerror( "editvar(''%e'')",                  refMsg);
+assert_checkerror( "editvar(''%e'')",       refMsg);
 assert_checkerror( "editvar(''%eps'')",                refMsg);
-assert_checkerror( "editvar(''%fftw'')",               refMsg);
-assert_checkerror( "editvar(''%f'')",                  refMsg);
-assert_checkerror( "editvar(''%F'')",                  refMsg);
+assert_checkerror( "editvar(''%fftw'')",       refMsg);
 assert_checkerror( "editvar(''%gui'')",                refMsg);
-assert_checkerror( "editvar(''%i'')",                  refMsg);
+assert_checkerror( "editvar(''%i'')",          refMsg);
 assert_checkerror( "editvar(''%io'')",         refMsg);
 assert_checkerror( "editvar(''%inf'')",                refMsg);
 assert_checkerror( "editvar(''%nan'')",                refMsg);
 assert_checkerror( "editvar(''%pi'')",         refMsg);
-assert_checkerror( "editvar(''%s'')",                  refMsg);
+assert_checkerror( "editvar(''%s'')",          refMsg);
 assert_checkerror( "editvar(''%tk'')",         refMsg);
-assert_checkerror( "editvar(''%t'')",                  refMsg);
-assert_checkerror( "editvar(''%T'')",                  refMsg);
-assert_checkerror( "editvar(''%z'')",                  refMsg);
-assert_checkerror( "editvar(''evoid'')",               refMsg);
+assert_checkerror( "editvar(''%z'')",          refMsg);
+assert_checkerror( "editvar(''evoid'')",       refMsg);
 assert_checkerror( "editvar(''home'')",                refMsg);
 assert_checkerror( "editvar(''PWD'')",         refMsg);
 assert_checkerror( "editvar(''SCI'')",         refMsg);
index f9c6032..61c26c8 100644 (file)
 
 refMsg = msprintf(_("Redefining permanent variable.\n"));
 
-assert_checkerror( "editvar(''$'')",                   refMsg);
-assert_checkerror( "editvar(''%e'')",                  refMsg);
+assert_checkerror( "editvar(''%e'')",       refMsg);
 assert_checkerror( "editvar(''%eps'')",                refMsg);
-assert_checkerror( "editvar(''%fftw'')",               refMsg);
-assert_checkerror( "editvar(''%f'')",                  refMsg);
-assert_checkerror( "editvar(''%F'')",                  refMsg);
+assert_checkerror( "editvar(''%fftw'')",       refMsg);
 assert_checkerror( "editvar(''%gui'')",                refMsg);
-assert_checkerror( "editvar(''%i'')",                  refMsg);
+assert_checkerror( "editvar(''%i'')",          refMsg);
 assert_checkerror( "editvar(''%io'')",         refMsg);
 assert_checkerror( "editvar(''%inf'')",                refMsg);
 assert_checkerror( "editvar(''%nan'')",                refMsg);
 assert_checkerror( "editvar(''%pi'')",         refMsg);
-assert_checkerror( "editvar(''%s'')",                  refMsg);
+assert_checkerror( "editvar(''%s'')",          refMsg);
 assert_checkerror( "editvar(''%tk'')",         refMsg);
-assert_checkerror( "editvar(''%t'')",                  refMsg);
-assert_checkerror( "editvar(''%T'')",                  refMsg);
-assert_checkerror( "editvar(''%z'')",                  refMsg);
-assert_checkerror( "editvar(''evoid'')",               refMsg);
+assert_checkerror( "editvar(''%z'')",          refMsg);
+assert_checkerror( "editvar(''evoid'')",       refMsg);
 assert_checkerror( "editvar(''home'')",                refMsg);
 assert_checkerror( "editvar(''PWD'')",         refMsg);
 assert_checkerror( "editvar(''SCI'')",         refMsg);