Merge remote-tracking branch 'origin/master' into YaSp 02/8502/1
Antoine ELIAS [Thu, 2 Aug 2012 16:44:43 +0000 (18:44 +0200)]
Conflicts:
scilab/configure
scilab/modules/api_scilab/includes/api_common.h
scilab/modules/api_scilab/src/cpp/api_common.cpp
scilab/modules/core/src/c/banier.c
scilab/modules/fftw/sci_gateway/c/sci_fftw.c
scilab/modules/fftw/sci_gateway/c/sci_fftw_flags.c
scilab/modules/gui/etc/main_menubar.xml
scilab/modules/gui/images/icons/aboutscilab.png
scilab/modules/gui/sci_gateway/cpp/sci_toprint.cpp
scilab/modules/helptools/data/pages/homepage-en_US.html
scilab/modules/helptools/data/pages/homepage-fr_FR.html

Change-Id: I8b7556ffa696ac58d4ac39b11b38641b41689a22

35 files changed:
1  2 
scilab/bin/scilab
scilab/configure.ac
scilab/contrib/Makefile.in
scilab/modules/api_scilab/includes/api_common.h
scilab/modules/api_scilab/src/cpp/api_common.cpp
scilab/modules/dynamic_link/Makefile.am
scilab/modules/dynamic_link/Makefile.in
scilab/modules/external_objects/Makefile.am
scilab/modules/external_objects/Makefile.in
scilab/modules/fftw/sci_gateway/c/sci_fftw.c
scilab/modules/fftw/sci_gateway/c/sci_fftw_flags.c
scilab/modules/graphics/sci_gateway/c/sci_delete.c
scilab/modules/graphics/sci_gateway/cpp/graphics_gw.vcxproj
scilab/modules/graphics/src/c/InitObjects.c
scilab/modules/gui/etc/main_menubar.xml
scilab/modules/gui/sci_gateway/c/sci_mpopup.c
scilab/modules/gui/sci_gateway/cpp/sci_toprint.cpp
scilab/modules/helptools/Makefile.am
scilab/modules/helptools/Makefile.in
scilab/modules/helptools/macros/xmltoformat.sci
scilab/modules/jvm/Makefile.am
scilab/modules/jvm/Makefile.in
scilab/modules/renderer/renderer.iss
scilab/modules/scicos/Makefile.in
scilab/modules/scicos_blocks/src/c/bouncexy.c
scilab/modules/scicos_blocks/src/c/canimxy.c
scilab/modules/scicos_blocks/src/c/canimxy3d.c
scilab/modules/scicos_blocks/src/c/cevscpe.c
scilab/modules/scicos_blocks/src/c/cfscope.c
scilab/modules/scicos_blocks/src/c/cmat3d.c
scilab/modules/scicos_blocks/src/c/cmatview.c
scilab/modules/scicos_blocks/src/c/cmscope.c
scilab/modules/scicos_blocks/src/c/cscope.c
scilab/modules/scicos_blocks/src/c/cscopxy.c
scilab/modules/scicos_blocks/src/c/cscopxy3d.c

Simple merge
Simple merge
Simple merge
@@@ -62,9 -62,18 +62,9 @@@ extern "C" 
  #endif
  #define Rhs (*getNbInputArgument(pvApiCtx))
  
 -/*Top*/
 -    int* getNbArgumentOnStack(void* _pvCtx);
 -#define nbArgumentOnStack(PVCTX) (*getNbArgumentOnStack(PVCTX))
 -
 -#ifdef Top
 -#undef Top
 -#endif
 -#define Top (*getNbArgumentOnStack(pvApiCtx))
 -
  /*Lhs*/
      int* getNbOutputArgument(void* _pvCtx);
- #define nbOutputArgument (*getNbOutputArgument(pvApiCtx))
+ #define nbOutputArgument(PVCTX) (*getNbOutputArgument(PVCTX))
  #ifdef Lhs
  #undef Lhs
  #endif
@@@ -129,22 -81,28 +129,23 @@@ int checkInputArgument(void* _pvCtx, in
      sciErr.iErr = 0;
      sciErr.iMsgCount = 0;
  
 -    /*
 -    * store the name in recu array, fname can be a non null terminated char array
 -    * Get_Iname() can be used in other function to get the interface name
 -    */
 -    int cx0 = 0;
 -    C2F(cvname) (&C2F(recu).ids[(C2F(recu).pt + 1) * nsiz - nsiz],  ((StrCtx *) _pvCtx)->pstName, &cx0, (unsigned long int)strlen(((StrCtx *)_pvCtx)->pstName));
 +    GatewayStruct *pStr = (GatewayStruct*)_pvCtx;
 +    int iRhs            = *getNbInputArgument(_pvCtx);
  
-     if(iRhs > _iMax || iRhs < _iMin)
+     if (_iMin <= nbInputArgument(_pvCtx) && _iMax >= nbInputArgument(_pvCtx))
      {
-         if (_iMin == _iMax)
-         {/* No optional argument */
-             ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d expected.\n"), pStr->m_pstName, _iMax);
-         }
-         else
-         {
-             ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d to %d expected.\n"), pStr->m_pstName, _iMin, _iMax);
-         }
-         return 0;
+         return 1;
+     }
 -
 -    if (_iMax == _iMin)
 -    {
 -        Scierror(77, _("%s: Wrong number of input argument(s): %d expected.\n"), ((StrCtx *) _pvCtx)->pstName, _iMax);
++    
++    if (_iMin == _iMax)
++    {/* No optional argument */
++        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d expected.\n"), pStr->m_pstName, _iMax);
+     }
+     else
+     {
 -        Scierror(77, _("%s: Wrong number of input argument(s): %d to %d expected.\n"), ((StrCtx *) _pvCtx)->pstName, _iMin, _iMax);
++        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d to %d expected.\n"), pStr->m_pstName, _iMin, _iMax);
      }
-     return 1;
 -
+     return 0;
  }
  
  /*--------------------------------------------------------------------------*/
@@@ -186,8 -144,8 +187,7 @@@ int checkOutputArgument(void* _pvCtx, i
      sciErr.iErr = 0;
      sciErr.iMsgCount = 0;
  
-     int iLhs = *getNbOutputArgument(_pvCtx);
-     if(_iMin <= iLhs && _iMax >= iLhs)
 -
+     if (_iMin <= nbOutputArgument(_pvCtx) && _iMax >= nbOutputArgument(_pvCtx))
      {
          return 1;
      }
@@@ -4,50 -4,35 +4,50 @@@
  # This file is distributed under the same license as the Scilab package.
  
  
 -DYNAMIC_LINK_C_SOURCES = src/c/addinter.c \
 -src/c/dynamic_link.c \
 -src/c/dl_genErrorMessage.c \
 -src/c/GetFunctionByName.c \
 -src/c/ilib_verbose.c
 -
 -GATEWAY_C_SOURCES = sci_gateway/c/gw_dynamic_link.c \
 -sci_gateway/c/sci_getdynlibext.c \
 -sci_gateway/c/sci_addinter.c \
 -sci_gateway/c/sci_call.c \
 -sci_gateway/c/sci_link.c \
 -sci_gateway/c/sci_ulink.c \
 -sci_gateway/c/sci_c_link.c \
 -sci_gateway/c/sci_ilib_verbose.c
 +DYNAMIC_LINK_C_SOURCES = \
 +    src/c/dl_genErrorMessage.c \
 +    src/c/GetFunctionByName.c \
 +    src/c/ilib_verbose.c
 +
 +DYNAMIC_LINK_CPP_SOURCES = \
 +    src/cpp/dynamic_link.cpp \
 +    src/cpp/addinter.cpp
 +
 +GATEWAY_C_SOURCES = \
 +    sci_gateway/c/gw_dynamic_link.c \
 +    sci_gateway/c/sci_call.c
 +
 +GATEWAY_CPP_SOURCES = \
 +    sci_gateway/cpp/dynamic_link_gw.cpp \
 +    sci_gateway/cpp/sci_link.cpp \
 +    sci_gateway/cpp/sci_c_link.cpp \
 +    sci_gateway/cpp/sci_ulink.cpp \
 +    sci_gateway/cpp/sci_ilib_verbose.cpp \
 +    sci_gateway/cpp/sci_getdynlibext.cpp \
 +    sci_gateway/cpp/sci_addinter.cpp
 +
  
- GATEWAY_FORTRAN_SOURCES = sci_gateway/fortran/sci_fort.f 
+ GATEWAY_FORTRAN_SOURCES = sci_gateway/fortran/sci_fort.f
  
  libscidynamic_link_la_CPPFLAGS = \
 --I$(top_srcdir)/modules/output_stream/includes/ \
 --I$(top_srcdir)/libs/MALLOC/includes/ \
 --I$(top_srcdir)/modules/fileio/includes/ \
 --I$(top_srcdir)/modules/localization/includes/ \
 --I$(top_srcdir)/modules/string/includes/ \
 --I$(top_srcdir)/modules/io/includes/ \
 --I$(top_srcdir)/libs/dynamiclibrary/includes/ \
 --I$(srcdir)/src/c/ \
 --I$(top_srcdir)/modules/api_scilab/includes/ \
 --I$(srcdir)/includes/ \
 -$(AM_CPPFLAGS)
 +      -I$(srcdir)/includes/ \
 +      -I$(srcdir)/src/c/ \
 +    -I$(top_srcdir)/libs/MALLOC/includes/ \
 +    -I$(top_srcdir)/libs/dynamiclibrary/includes/ \
 +    -I$(top_srcdir)/modules/io/includes/ \
 +    -I$(top_srcdir)/modules/api_scilab/includes/ \
 +      -I$(top_srcdir)/modules/operations/includes/ \
 +      -I$(top_srcdir)/modules/symbol/includes/ \
 +      -I$(top_srcdir)/modules/types/includes/ \
 +      -I$(top_srcdir)/modules/output_stream/includes/ \
 +      -I$(top_srcdir)/modules/functions_manager/includes/ \
 +      -I$(top_srcdir)/modules/ast/includes/ \
 +    -I$(top_srcdir)/modules/string/includes/ \
 +    -I$(top_srcdir)/modules/fileio/includes/ \
 +    -I$(top_srcdir)/modules/system_env/includes/ \
 +    -I$(top_srcdir)/modules/threads/includes/ \
 +    -I$(top_srcdir)/modules/localization/includes/ \
 +    $(AM_CPPFLAGS)
  
  if MAINTAINER_MODE
  pkglib_LTLIBRARIES = libscidynamic_link.la
@@@ -447,49 -429,34 +447,49 @@@ target_alias = @target_alias
  top_build_prefix = @top_build_prefix@
  top_builddir = @top_builddir@
  top_srcdir = @top_srcdir@
 -DYNAMIC_LINK_C_SOURCES = src/c/addinter.c \
 -src/c/dynamic_link.c \
 -src/c/dl_genErrorMessage.c \
 -src/c/GetFunctionByName.c \
 -src/c/ilib_verbose.c
 -
 -GATEWAY_C_SOURCES = sci_gateway/c/gw_dynamic_link.c \
 -sci_gateway/c/sci_getdynlibext.c \
 -sci_gateway/c/sci_addinter.c \
 -sci_gateway/c/sci_call.c \
 -sci_gateway/c/sci_link.c \
 -sci_gateway/c/sci_ulink.c \
 -sci_gateway/c/sci_c_link.c \
 -sci_gateway/c/sci_ilib_verbose.c
 +yacc_present = @yacc_present@
 +DYNAMIC_LINK_C_SOURCES = \
 +    src/c/dl_genErrorMessage.c \
 +    src/c/GetFunctionByName.c \
 +    src/c/ilib_verbose.c
 +
 +DYNAMIC_LINK_CPP_SOURCES = \
 +    src/cpp/dynamic_link.cpp \
 +    src/cpp/addinter.cpp
 +
 +GATEWAY_C_SOURCES = \
 +    sci_gateway/c/gw_dynamic_link.c \
 +    sci_gateway/c/sci_call.c
 +
 +GATEWAY_CPP_SOURCES = \
 +    sci_gateway/cpp/dynamic_link_gw.cpp \
 +    sci_gateway/cpp/sci_link.cpp \
 +    sci_gateway/cpp/sci_c_link.cpp \
 +    sci_gateway/cpp/sci_ulink.cpp \
 +    sci_gateway/cpp/sci_ilib_verbose.cpp \
 +    sci_gateway/cpp/sci_getdynlibext.cpp \
 +    sci_gateway/cpp/sci_addinter.cpp
  
- GATEWAY_FORTRAN_SOURCES = sci_gateway/fortran/sci_fort.f 
+ GATEWAY_FORTRAN_SOURCES = sci_gateway/fortran/sci_fort.f
  libscidynamic_link_la_CPPFLAGS = \
 --I$(top_srcdir)/modules/output_stream/includes/ \
 --I$(top_srcdir)/libs/MALLOC/includes/ \
 --I$(top_srcdir)/modules/fileio/includes/ \
 --I$(top_srcdir)/modules/localization/includes/ \
 --I$(top_srcdir)/modules/string/includes/ \
 --I$(top_srcdir)/modules/io/includes/ \
 --I$(top_srcdir)/libs/dynamiclibrary/includes/ \
 --I$(srcdir)/src/c/ \
 --I$(top_srcdir)/modules/api_scilab/includes/ \
 --I$(srcdir)/includes/ \
 -$(AM_CPPFLAGS)
 +      -I$(srcdir)/includes/ \
 +      -I$(srcdir)/src/c/ \
 +    -I$(top_srcdir)/libs/MALLOC/includes/ \
 +    -I$(top_srcdir)/libs/dynamiclibrary/includes/ \
 +    -I$(top_srcdir)/modules/io/includes/ \
 +    -I$(top_srcdir)/modules/api_scilab/includes/ \
 +      -I$(top_srcdir)/modules/operations/includes/ \
 +      -I$(top_srcdir)/modules/symbol/includes/ \
 +      -I$(top_srcdir)/modules/types/includes/ \
 +      -I$(top_srcdir)/modules/output_stream/includes/ \
 +      -I$(top_srcdir)/modules/functions_manager/includes/ \
 +      -I$(top_srcdir)/modules/ast/includes/ \
 +    -I$(top_srcdir)/modules/string/includes/ \
 +    -I$(top_srcdir)/modules/fileio/includes/ \
 +    -I$(top_srcdir)/modules/system_env/includes/ \
 +    -I$(top_srcdir)/modules/threads/includes/ \
 +    -I$(top_srcdir)/modules/localization/includes/ \
 +    $(AM_CPPFLAGS)
  
  @MAINTAINER_MODE_TRUE@pkglib_LTLIBRARIES = libscidynamic_link.la
  @MAINTAINER_MODE_FALSE@noinst_LTLIBRARIES = libscidynamic_link-algo.la libscidynamic_link.la
@@@ -31,8 -31,9 +31,8 @@@ enum Scalin
  };
  /*--------------------------------------------------------------------------*/
  extern void C2F(dscal)(int *n, double *da, double *dx, int *incx); /* blas routine */
 -extern void C2F(dset)(int *n, double *da, double *dx, int *incx); /* blas routine */
  /*--------------------------------------------------------------------------*/
--static int getArrayOfDouble(void* pvApiCtx, int *piAddr, int *ndims, int **dims, double **Ar, double **Ai);
++static int getArrayOfDouble(void* _pvCtx, int *piAddr, int *ndims, int **dims, double **Ar, double **Ai);
  static SciErr allocArrayOfDouble(void* _pvCtx, int _iVar, int ndims, int *dims, double **Ar);
  static SciErr allocComplexArrayOfDouble(void* _pvCtx, int _iVar, int ndims, int *dims, double **Ar, double **Ai);
  static SciErr getScalarIntArg(void* _pvCtx, int _iVar, char *fname, int *value);
@@@ -46,31 -47,31 +46,31 @@@ static int sci_fft_4args(void* _pvCtx, 
  
  int WITHMKL = 0;
  /* fftw function.
-  *
-  * Scilab Calling sequence :
-  *   fftw(A [,option])
-  *   fftw(A,sign [,option])
-  *   fftw(A,sel,sign [,option])
-  *   fftw(A,sign,dim,incr [,option])
-  *
-  * Input : A : a scilab double complex or real vector, matrix or hypermatrix
-  *
-  *         sign : a scilab double or integer scalar (-1 or 1): the sign
-  *                  in the exponential component
-  *
-  *         sel : a scilab double or integer vector, the selection of dimensions
-  *         dim : a scilab double or integer vector: the dimensions
-  *                  of the Fast Fourier Transform to perform
-  *
-  *         incr : a scilab double or integer vector: the increments
-  *                  of the Fast Fourier Transform to perform
-  *
-  * Output : a scilab double complex or real array with same shape as A that
-  *          gives the result of the transform.
-  *
-  */
+ *
+ * Scilab Calling sequence :
+ *   fftw(A [,option])
+ *   fftw(A,sign [,option])
+ *   fftw(A,sel,sign [,option])
+ *   fftw(A,sign,dim,incr [,option])
+ *
+ * Input : A : a scilab double complex or real vector, matrix or hypermatrix
+ *
+ *         sign : a scilab double or integer scalar (-1 or 1): the sign
+ *                  in the exponential component
+ *
+ *         sel : a scilab double or integer vector, the selection of dimensions
+ *         dim : a scilab double or integer vector: the dimensions
+ *                  of the Fast Fourier Transform to perform
+ *
+ *         incr : a scilab double or integer vector: the increments
+ *                  of the Fast Fourier Transform to perform
+ *
+ * Output : a scilab double complex or real array with same shape as A that
+ *          gives the result of the transform.
+ *
+ */
 -int sci_fftw(char *fname, unsigned long fname_len)
 +int sci_fftw(char *fname, void* pvApiCtx)
  {
      SciErr sciErr;
      int *piAddr = NULL;
@@@ -656,13 -657,13 +656,13 @@@ int  sci_fft_3args(void* _pvCtx, char *
  
  
      /******************** get and check third argument (sel) ****************************************/
--    getVarAddressFromPosition(pvApiCtx, 3, &piAddr);
--    if (isVarMatrixType(pvApiCtx, piAddr) == 0)
++    getVarAddressFromPosition(_pvCtx, 3, &piAddr);
++    if (isVarMatrixType(_pvCtx, piAddr) == 0)
      {
          Scierror(999, _("%s: Wrong type for input argument #%d.\n"), fname, 3);
          goto ERR;
      }
--    sciErr = getVectorIntArg(pvApiCtx, 3, fname, &rank, &Sel);
++    sciErr = getVectorIntArg(_pvCtx, 3, fname, &rank, &Sel);
      if (sciErr.iErr)
      {
          Scierror(sciErr.iErr, getErrorMessage(sciErr));
@@@ -832,13 -833,13 +832,13 @@@ int sci_fft_4args(void* _pvCtx, char *f
      }
  
      /******************** get and check third argument (dim) ****************************************/
--    getVarAddressFromPosition(pvApiCtx, 3, &piAddr);
--    if (isVarMatrixType(pvApiCtx, piAddr) == 0)
++    getVarAddressFromPosition(_pvCtx, 3, &piAddr);
++    if (isVarMatrixType(_pvCtx, piAddr) == 0)
      {
          Scierror(999, _("%s: Wrong type for input argument #%d.\n"), fname, 3);
          goto ERR;
      }
--    sciErr = getVectorIntArg(pvApiCtx, 3, fname, &ndims, &Dim1);
++    sciErr = getVectorIntArg(_pvCtx, 3, fname, &ndims, &Dim1);
      if (sciErr.iErr)
      {
          Scierror(sciErr.iErr, getErrorMessage(sciErr));
          goto ERR;
      }
      /******************** get and check fourth argument (incr) ****************************************/
--    sciErr = getVectorIntArg(pvApiCtx, 4, fname, &nincr, &Incr);
++    sciErr = getVectorIntArg(_pvCtx, 4, fname, &nincr, &Incr);
      if (sciErr.iErr)
      {
          Scierror(sciErr.iErr, getErrorMessage(sciErr));
@@@ -1177,7 -1179,7 +1178,7 @@@ int sci_fft_gen(void* _pvCtx, char *fna
              if (issymA)
              {
                  /* result will be real, the imaginary part of A can be allocated alone */
-                 sciErr = allocMatrixOfDouble(pvApiCtx, Rhs + 1, 1, lA, &Ai);
 -                sciErr = allocMatrixOfDouble(pvApiCtx, *getNbInputArgument(_pvCtx) + 1, 1, lA, &Ai);
++                sciErr = allocMatrixOfDouble(_pvCtx, *getNbInputArgument(_pvCtx) + 1, 1, lA, &Ai);
                  if (sciErr.iErr)
                  {
                      Scierror(999, _("%s: Cannot allocate more memory.\n"), fname);
              else
              {
                  /* result will be complex, realloc A for inplace computation */
-                 sciErr = allocComplexArrayOfDouble(pvApiCtx, Rhs + 1, ndimsA, dimsA, &ri, &Ai);
 -                sciErr = allocComplexArrayOfDouble(pvApiCtx, *getNbInputArgument(_pvCtx) + 1, ndimsA, dimsA, &ri, &Ai);
++                sciErr = allocComplexArrayOfDouble(_pvCtx, *getNbInputArgument(_pvCtx) + 1, ndimsA, dimsA, &ri, &Ai);
                  if (sciErr.iErr)
                  {
                      Scierror(999, _("%s: Cannot allocate more memory.\n"), fname);
      if (!isrealA && issymA) /* A is complex but result is real */
      {
          /* result will be complex, realloc real part of A for real part inplace computation */
-         sciErr = allocArrayOfDouble(pvApiCtx, Rhs + 1, ndimsA, dimsA, &ri);
 -        sciErr = allocArrayOfDouble(pvApiCtx, *getNbInputArgument(_pvCtx) + 1, ndimsA, dimsA, &ri);
++        sciErr = allocArrayOfDouble(_pvCtx, *getNbInputArgument(_pvCtx) + 1, ndimsA, dimsA, &ri);
          if (sciErr.iErr)
          {
              Scierror(999, _("%s: Cannot allocate more memory.\n"), fname);
          }
          C2F(dcopy)(&lA, Ar, &one, ri, &one);
          Ar = ri;
-         LhsVar(1) = Rhs + 1;
 -        AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(_pvCtx) + 1;
++        AssignOutputVariable(_pvCtx, 1) = nbInputArgument(_pvCtx) + 1;
      }
  
      /* Set pointers on real and imaginary part of the input */
          {
              /*r2r =  isrealA &&  issymA*/
              /* there is no general plan able to compute r2r transform so it is tranformed into
-                a R2c plan. The computed imaginary part will be zero*/
-             sciErr = allocMatrixOfDouble(pvApiCtx, Rhs + 1, 1, lA,  &io);
+             a R2c plan. The computed imaginary part will be zero*/
 -            sciErr = allocMatrixOfDouble(pvApiCtx, *getNbInputArgument(_pvCtx) + 1, 1, lA,  &io);
++            sciErr = allocMatrixOfDouble(_pvCtx, *getNbInputArgument(_pvCtx) + 1, 1, lA,  &io);
              if (sciErr.iErr)
              {
                  Scierror(999, _("%s: Cannot allocate more memory.\n"), fname);
          {
              /*r2c =  isrealA && ~issymA;*/
              /* transform cannot be done in place */
-             sciErr = allocComplexArrayOfDouble(pvApiCtx, Rhs + 1, ndimsA, dimsA, &ro, &io);
 -            sciErr = allocComplexArrayOfDouble(pvApiCtx, *getNbInputArgument(_pvCtx) + 1, ndimsA, dimsA, &ro, &io);
++            sciErr = allocComplexArrayOfDouble(_pvCtx, *getNbInputArgument(_pvCtx) + 1, ndimsA, dimsA, &ro, &io);
              if (sciErr.iErr)
              {
                  Scierror(999, _("%s: Cannot allocate more memory.\n"), fname);
                  goto ERR;
              }
-             LhsVar(1) = Rhs + 1;
 -            AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(_pvCtx) + 1;
++            AssignOutputVariable(_pvCtx, 1) = nbInputArgument(_pvCtx) + 1;
              type = R2C_PLAN; /* fftw_plan_guru_split_dft_r2c plans for an FFTW_FORWARD transform*/
              if (isn == FFTW_BACKWARD)
              {
  #include "localization.h"
  #include "freeArrayOfString.h"
  #include "Scierror.h"
 +#include "os_strdup.h"
  #include "stack-c.h"
 -#ifdef _MSC_VER
 -#include "strdup_windows.h"
 -#endif
  /*--------------------------------------------------------------------------*/
  /* fftw_flags function.
-  *
-  * Scilab Calling sequence :
-  *   -->[a,b]=fftw_flags();
-  * or
-  *   -->[a,b]=fftw_flags(S);
-  *
-  *  a is an int scalar. (the int value of
-  *                            the flag parameter of fftw)
-  *  b is a string matrix.(the string values of
-  *                             the flag parameter of fftw)
-  *  S is a string matrix or an int or a double scalar
-  *  given the value(s) of the fftw flag parameter.
-  *
-  *  This function gives and set the flag parameter of fftw
-  *  when creating a new plan.
-  *  This should be done before calling fftw function.
-  *  (default is FFTW_ESTIMATE)
-  */
+ *
+ * Scilab Calling sequence :
+ *   -->[a,b]=fftw_flags();
+ * or
+ *   -->[a,b]=fftw_flags(S);
+ *
+ *  a is an int scalar. (the int value of
+ *                            the flag parameter of fftw)
+ *  b is a string matrix.(the string values of
+ *                             the flag parameter of fftw)
+ *  S is a string matrix or an int or a double scalar
+ *  given the value(s) of the fftw flag parameter.
+ *
+ *  This function gives and set the flag parameter of fftw
+ *  when creating a new plan.
+ *  This should be done before calling fftw function.
+ *  (default is FFTW_ESTIMATE)
+ */
  /*--------------------------------------------------------------------------*/
  int sci_fftw_flags(char *fname, unsigned long fname_len)
  {
          }
      }
  
-   /* return value of Sci_Plan.flags in position 2 */
-   m2 = 1;
-   n2 = m2;
-   l2 = I_INT32;
-   CreateVar(Rhs + 2, MATRIX_OF_VARIABLE_SIZE_INTEGER_DATATYPE, &m2, &n2, &l2);
-   *istk(l2) = (int) getCurrentFftwFlags();
+     /* return value of Sci_Plan.flags in position 2 */
+     m2 = 1;
+     n2 = m2;
+     l2 = I_INT32;
+     CreateVar(Rhs + 2, MATRIX_OF_VARIABLE_SIZE_INTEGER_DATATYPE, &m2, &n2, &l2);
+     *istk(l2) = (int) getCurrentFftwFlags();
  
-   /*Test for only FFTW_MEASURE*/
-   if (getCurrentFftwFlags() == 0)
+     /*Test for only FFTW_MEASURE*/
+     if (getCurrentFftwFlags() == 0)
      {
-       j = 1;
-       if ((Str3 = (char **)MALLOC(sizeof(char *))) == NULL)
+         j = 1;
+         if ((Str3 = (char **)MALLOC(sizeof(char *))) == NULL)
          {
-           Scierror(999, _("%s: No more memory.\n"), fname);
-           return 0;
+             Scierror(999, _("%s: No more memory.\n"), fname);
+             return 0;
          }
  
-       Str3[0] = os_strdup(Str[0]);
-       if (Str3[0] == NULL)
 -        Str3[0] = strdup(Str[0]);
++        Str3[0] = os_strdup(Str[0]);
+         if (Str3[0] == NULL)
          {
-           Scierror(999, _("%s: No more memory.\n"), fname);
-           return 0;
+             Scierror(999, _("%s: No more memory.\n"), fname);
+             return 0;
          }
      }
-   else
+     else
      {
-       j = 0;
-       for (i = 1;i < nb_flag; i++)
+         j = 0;
+         for (i = 1;i < nb_flag; i++)
          {
-           if((getCurrentFftwFlags() & flagt[i]) == flagt[i])
+             if((getCurrentFftwFlags() & flagt[i]) == flagt[i])
              {
-               j++;
-               if (Str3)
+                 j++;
+                 if (Str3)
                  {
-                   Str3 = (char **)REALLOC(Str3,sizeof(char *) * j);
+                     Str3 = (char **)REALLOC(Str3,sizeof(char *) * j);
                  }
-               else
+                 else
                  {
-                   Str3 = (char **)MALLOC(sizeof(char *) * j);
+                     Str3 = (char **)MALLOC(sizeof(char *) * j);
                  }
  
-               if ( Str3 == NULL)
+                 if ( Str3 == NULL)
                  {
-                   Scierror(999, _("%s: No more memory.\n"), fname);
-                   return 0;
+                     Scierror(999, _("%s: No more memory.\n"), fname);
+                     return 0;
                  }
  
-               Str3[j - 1] = os_strdup(Str[i]);
-               if (Str3[j - 1] == NULL)
 -                Str3[j - 1] = strdup(Str[i]);
++                Str3[j - 1] = os_strdup(Str[i]);
+                 if (Str3[j - 1] == NULL)
                  {
-                   freeArrayOfString(Str3, j);
-                   Scierror(999, _("%s: No more memory.\n"), fname);
-                   return 0;
+                     freeArrayOfString(Str3, j);
+                     Scierror(999, _("%s: No more memory.\n"), fname);
+                     return 0;
                  }
              }
          }
  #include "getConsoleIdentifier.h"
  #include "CurrentSubwin.h"
  #include "sciprint.h"
+ #ifdef _MSC_VER
 -#include "strdup_windows.h"
++#include "os_strdup.h"
+ #endif
  /*--------------------------------------------------------------------------*/
  int sci_delete(char *fname, unsigned long fname_len)
  {
              Scierror(999, _("A Label object cannot be deleted.\n"));
              return 0;
          }
+         //bug #11485 : duplicate pobjUID before delete it.
 -        pstTemp = strdup(pobjUID);
++        pstTemp = os_strdup(pobjUID);
          deleteGraphicObject(pobjUID);
  
          /*
index 44af189,0000000..ecbc927
mode 100644,000000..100644
--- /dev/null
@@@ -1,202 -1,0 +1,207 @@@
 +<?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">
 +      <Configuration>Debug</Configuration>
 +      <Platform>Win32</Platform>
 +    </ProjectConfiguration>
 +    <ProjectConfiguration Include="Debug|x64">
 +      <Configuration>Debug</Configuration>
 +      <Platform>x64</Platform>
 +    </ProjectConfiguration>
 +    <ProjectConfiguration Include="Release|Win32">
 +      <Configuration>Release</Configuration>
 +      <Platform>Win32</Platform>
 +    </ProjectConfiguration>
 +    <ProjectConfiguration Include="Release|x64">
 +      <Configuration>Release</Configuration>
 +      <Platform>x64</Platform>
 +    </ProjectConfiguration>
 +  </ItemGroup>
 +  <ItemGroup>
 +    <ClInclude Include="..\..\includes\dynlib_graphics_gw.h" />
 +    <ClInclude Include="..\..\includes\graphics_gw.hxx" />
 +  </ItemGroup>
 +  <ItemGroup>
 +    <ClCompile Include="graphics_gw.cpp" />
 +  </ItemGroup>
++  <ItemGroup>
++    <ProjectReference Include="..\..\..\..\Visual-Studio-settings\rename-vc-files\rename-vc-files.vcxproj">
++      <Project>{dd8a0506-8d31-4cf8-856a-c10ece9c13a4}</Project>
++    </ProjectReference>
++  </ItemGroup>
 +  <PropertyGroup Label="Globals">
 +    <ProjectGuid>{61B23D9B-3F73-4204-98F7-6F41218F4564}</ProjectGuid>
 +    <RootNamespace>graphics_gw</RootNamespace>
 +    <Keyword>Win32Proj</Keyword>
 +  </PropertyGroup>
 +  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
 +  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
 +    <ConfigurationType>DynamicLibrary</ConfigurationType>
 +    <CharacterSet>MultiByte</CharacterSet>
 +    <WholeProgramOptimization>true</WholeProgramOptimization>
 +  </PropertyGroup>
 +  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
 +    <ConfigurationType>DynamicLibrary</ConfigurationType>
 +    <CharacterSet>MultiByte</CharacterSet>
 +  </PropertyGroup>
 +  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
 +    <ConfigurationType>DynamicLibrary</ConfigurationType>
 +    <CharacterSet>MultiByte</CharacterSet>
 +    <WholeProgramOptimization>true</WholeProgramOptimization>
 +  </PropertyGroup>
 +  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
 +    <ConfigurationType>DynamicLibrary</ConfigurationType>
 +    <CharacterSet>MultiByte</CharacterSet>
 +  </PropertyGroup>
 +  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
 +  <ImportGroup Label="ExtensionSettings">
 +  </ImportGroup>
 +  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
 +    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 +  </ImportGroup>
 +  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
 +    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 +  </ImportGroup>
 +  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
 +    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 +  </ImportGroup>
 +  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
 +    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
 +  </ImportGroup>
 +  <PropertyGroup Label="UserMacros" />
 +  <PropertyGroup>
 +    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
 +    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)bin\</OutDir>
 +    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
 +    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
 +    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)bin\</OutDir>
 +    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)$(Configuration)\</IntDir>
 +    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
 +    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)bin\</OutDir>
 +    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
 +    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
 +    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)bin\</OutDir>
 +    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)$(Configuration)\</IntDir>
 +    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
 +  </PropertyGroup>
 +  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
 +    <ClCompile>
 +      <Optimization>Disabled</Optimization>
 +      <AdditionalIncludeDirectories>../../includes;../../../operations/includes;../../../types/includes;../../../core/includes;../../../ast/includes;../../../../libs/dynamiclibrary/includes;../../../symbol/includes;../../../localization/includes;../../../../libs/intl;../../../jvm/includes;../../../output_stream/includes;../../../../libs/MALLOC/includes;../../../api_scilab/includes</AdditionalIncludeDirectories>
 +      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;GRAPHICS_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
 +      <MinimalRebuild>true</MinimalRebuild>
 +      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
 +      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
 +      <PrecompiledHeader>
 +      </PrecompiledHeader>
 +      <WarningLevel>Level3</WarningLevel>
 +      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
 +    </ClCompile>
 +    <PreLinkEvent>
 +      <Command>
 +      </Command>
 +    </PreLinkEvent>
 +    <Link>
 +      <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
 +      <GenerateDebugInformation>true</GenerateDebugInformation>
 +      <SubSystem>Windows</SubSystem>
 +      <ImportLibrary>$(TargetDir)$(TargetName).lib</ImportLibrary>
 +      <TargetMachine>MachineX86</TargetMachine>
 +      <RandomizedBaseAddress>false</RandomizedBaseAddress>
 +    </Link>
 +  </ItemDefinitionGroup>
 +  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
 +    <Midl>
 +      <TargetEnvironment>X64</TargetEnvironment>
 +    </Midl>
 +    <ClCompile>
 +      <Optimization>Disabled</Optimization>
 +      <AdditionalIncludeDirectories>../../includes;../../../operations/includes;../../../types/includes;../../../core/includes;../../../ast/includes;../../../../libs/dynamiclibrary/includes;../../../symbol/includes;../../../localization/includes;../../../../libs/intl;../../../jvm/includes;../../../output_stream/includes;../../../../libs/MALLOC/includes;../../../api_scilab/includes</AdditionalIncludeDirectories>
 +      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;GRAPHICS_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
 +      <MinimalRebuild>true</MinimalRebuild>
 +      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
 +      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
 +      <PrecompiledHeader>
 +      </PrecompiledHeader>
 +      <WarningLevel>Level3</WarningLevel>
 +      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
 +    </ClCompile>
 +    <PreLinkEvent>
 +      <Command>
 +      </Command>
 +    </PreLinkEvent>
 +    <Link>
 +      <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
 +      <GenerateDebugInformation>true</GenerateDebugInformation>
 +      <SubSystem>Windows</SubSystem>
 +      <ImportLibrary>$(TargetDir)$(TargetName).lib</ImportLibrary>
 +      <TargetMachine>MachineX64</TargetMachine>
 +      <RandomizedBaseAddress>false</RandomizedBaseAddress>
 +    </Link>
 +  </ItemDefinitionGroup>
 +  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
 +    <ClCompile>
 +      <Optimization>MaxSpeed</Optimization>
 +      <IntrinsicFunctions>true</IntrinsicFunctions>
 +      <AdditionalIncludeDirectories>../../includes;../../../operations/includes;../../../types/includes;../../../core/includes;../../../ast/includes;../../../../libs/dynamiclibrary/includes;../../../symbol/includes;../../../localization/includes;../../../../libs/intl;../../../jvm/includes;../../../output_stream/includes;../../../../libs/MALLOC/includes;../../../api_scilab/includes</AdditionalIncludeDirectories>
 +      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;GRAPHICS_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
 +      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
 +      <FunctionLevelLinking>true</FunctionLevelLinking>
 +      <PrecompiledHeader>
 +      </PrecompiledHeader>
 +      <WarningLevel>Level3</WarningLevel>
 +      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
 +      <MultiProcessorCompilation>true</MultiProcessorCompilation>
 +    </ClCompile>
 +    <PreLinkEvent>
 +      <Command>
 +      </Command>
 +    </PreLinkEvent>
 +    <Link>
 +      <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
 +      <GenerateDebugInformation>true</GenerateDebugInformation>
 +      <SubSystem>Windows</SubSystem>
 +      <OptimizeReferences>true</OptimizeReferences>
 +      <EnableCOMDATFolding>true</EnableCOMDATFolding>
 +      <ImportLibrary>$(TargetDir)$(TargetName).lib</ImportLibrary>
 +      <TargetMachine>MachineX86</TargetMachine>
 +      <RandomizedBaseAddress>false</RandomizedBaseAddress>
 +    </Link>
 +  </ItemDefinitionGroup>
 +  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
 +    <Midl>
 +      <TargetEnvironment>X64</TargetEnvironment>
 +    </Midl>
 +    <ClCompile>
 +      <Optimization>MaxSpeed</Optimization>
 +      <IntrinsicFunctions>true</IntrinsicFunctions>
 +      <AdditionalIncludeDirectories>../../includes;../../../operations/includes;../../../types/includes;../../../core/includes;../../../ast/includes;../../../../libs/dynamiclibrary/includes;../../../symbol/includes;../../../localization/includes;../../../../libs/intl;../../../jvm/includes;../../../output_stream/includes;../../../../libs/MALLOC/includes;../../../api_scilab/includes</AdditionalIncludeDirectories>
 +      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;GRAPHICS_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
 +      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
 +      <FunctionLevelLinking>true</FunctionLevelLinking>
 +      <PrecompiledHeader>
 +      </PrecompiledHeader>
 +      <WarningLevel>Level3</WarningLevel>
 +      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
 +      <MultiProcessorCompilation>true</MultiProcessorCompilation>
 +    </ClCompile>
 +    <PreLinkEvent>
 +      <Command>
 +      </Command>
 +    </PreLinkEvent>
 +    <Link>
 +      <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
 +      <GenerateDebugInformation>true</GenerateDebugInformation>
 +      <SubSystem>Windows</SubSystem>
 +      <OptimizeReferences>true</OptimizeReferences>
 +      <EnableCOMDATFolding>true</EnableCOMDATFolding>
 +      <ImportLibrary>$(TargetDir)$(TargetName).lib</ImportLibrary>
 +      <TargetMachine>MachineX64</TargetMachine>
 +      <RandomizedBaseAddress>false</RandomizedBaseAddress>
 +    </Link>
 +  </ItemDefinitionGroup>
 +  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
 +  <ImportGroup Label="ExtensionTargets">
 +  </ImportGroup>
 +</Project>
  <?xml version="1.0"?>
  <menubar>
-   <!-- All "main" menus are disabled when created and then enabled in scilab.start file after all macros are loaded -->
-   <!-- The accelerator can be "control shift A" or "control A" or "meta A" or "OSSCKEY A" where oskey means "OS ShortCut key"
+     <!-- All "main" menus are disabled when created and then enabled in scilab.start file after all macros are loaded -->
+     <!-- The accelerator can be "control shift A" or "control A" or "meta A" or "OSSCKEY A" where oskey means "OS ShortCut key"
        and is replaced by the good key (control for Unix/Windows OS and meta for Mac) -->
-   <!-- File menu -->
-   <menu label="&amp;File" enabled="true">
-     <submenu label="&amp;Execute..." accelerator="OSSCKEY E">
-       <callback instruction="               %fileToExec = uigetfile(&quot;*.sc*&quot;, &quot;&quot;, gettext(&quot;Select a file to execute&quot;));               if ~(%fileToExec == &quot;&quot;) then                 exec(%fileToExec);                 disp(msprintf(gettext(&quot;Execution done.\n&quot;)));               end               clear(&quot;%fileToExec&quot;);" type="0"/>
-     </submenu>
-     <separator/>
-     <submenu label="&amp;Open a file..." accelerator="OSSCKEY O" icon="document-open-sci">
-       <callback instruction="               %fileToOpen = uigetfile(&quot;*.sc*&quot;, &quot;&quot;, gettext(&quot;Select a file to open with SciNotes&quot;));               if ~(%fileToOpen == &quot;&quot;) then                 editor(%fileToOpen);               end               clear(&quot;%fileToOpen&quot;);" type="0"/>
-     </submenu>
-     <submenu label="&amp;Load environment..." accelerator="OSSCKEY L" icon="document-open">
-       <callback instruction="               %fileToLoad = uigetfile([&quot;*.sav&quot;;&quot;*.sod&quot;], &quot;&quot;, gettext(&quot;Select a file to load&quot;));               if ~(%fileToLoad == &quot;&quot;) then                 load(%fileToLoad);                 disp(msprintf(gettext(&quot;Environment loaded.\n&quot;)));               end               clear(&quot;%fileToLoad&quot;);" type="0"/>
-     </submenu>
-     <submenu label="&amp;Save environment..." accelerator="OSSCKEY S" icon="document-save">
-       <callback instruction="               %fileToSave = uiputfile([&quot;*.sav&quot;;&quot;*.sod&quot;], &quot;&quot;, gettext(&quot;Select a file to write&quot;));               if ~(%fileToSave == &quot;&quot;) then                 if (fileparts(%fileToSave, &quot;extension&quot;) == &quot;&quot;) then                   %fileToSave = %fileToSave + &quot;.sav&quot;;                 end                 save(%fileToSave);                 disp(msprintf(gettext(&quot;Environment saved.\n&quot;)));               end               clear(&quot;%fileToSave&quot;);" type="0"/>
-     </submenu>
-     <separator/>
-     <submenu label="&amp;Change current directory..." icon="scilab-folder-open">
-       <callback instruction="               %newDir = uigetdir(pwd(), gettext(&quot;Select a directory&quot;));               if ~(%newDir == &quot;&quot;) then                 cd(%newDir);               end               clear(&quot;%newDir&quot;);" type="0"/>
-     </submenu>
-     <submenu label="&amp;Display current directory">
-       <callback instruction="if iswaitingforinput() then printf(&quot;\n%s\n\n%s\n&quot;,prompt(),pwd()); else printf(&quot;\n\n%s\n\n&quot;,pwd());end" type="0"/>
-     </submenu>
-     <separator/>
-     <submenu label="P&amp;age setup...">
-       <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.pageSetup" type="3"/>
-     </submenu>
-     <submenu label="&amp;Print..." accelerator="OSSCKEY P" icon="document-print">
-       <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.printConsoleContents" type="3"/>
-     </submenu>
-     <separator/>
-     <submenu label="&amp;Quit" accelerator="OSSCKEY Q">
-       <callback instruction="exit();" type="0"/>
-     </submenu>
-   </menu>
-   <!-- Edit menu -->
-   <menu label="&amp;Edit" enabled="true">
-     <submenu label="C&amp;ut" accelerator="OSSCKEY X" icon="edit-cut">
-       <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.cutConsoleSelection" type="3"/>
-     </submenu>
-     <submenu label="&amp;Copy" accelerator="OSSCKEY C" icon="edit-copy">
-       <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.copyConsoleSelection" type="3"/>
-     </submenu>
-     <submenu label="&amp;Paste" accelerator="OSSCKEY V" icon="edit-paste">
-       <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.pasteClipboardIntoConsole" type="3"/>
-     </submenu>
-     <separator/>
-     <submenu label="&amp;Empty clipboard">
-       <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.emptyClipboard" type="3"/>
-     </submenu>
-     <separator/>
-     <submenu label="&amp;Select all" accelerator="OSSCKEY A" icon="edit-select-all">
-       <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.selectAllConsoleContents" type="3"/>
-     </submenu>
-     <separator/>
-     <submenu label="Show/Hide &amp;Toolbar">
-       <callback instruction="                 if toolbar(-1)==&quot;on&quot; then                   toolbar(-1, &quot;off&quot;);                 else                   toolbar(-1, &quot;on&quot;);                 end" type="0"/>
-     </submenu>
-     <separator/>
-     <submenu label="Clear &amp;History">
-       <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.clearHistory" type="3"/>
-     </submenu>
-     <submenu label="Clear C&amp;onsole" icon="edit-clear">
-       <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.clear" type="3"/>
-     </submenu>
-     <separator/>
-     <submenu label="P&amp;references" icon="preferences-system">
-       <callback instruction='org.scilab.modules.preferences.XConfigManager.openPreferences' type="3"/>
-     </submenu>
-   </menu>
-   <!-- Control menu -->
-   <menu label="&amp;Control" enabled="true">
-     <submenu label="&amp;Resume" icon="media-playback-start">
-       <callback instruction="resume;" type="-2"/>
-     </submenu>
-     <submenu label="&amp;Abort" icon="process-stop">
-       <callback instruction="abort;" type="-2"/>
-     </submenu>
-     <submenu label="&amp;Interrupt">
-       <callback instruction="pause;" type="-2"/>
-     </submenu>
-   </menu>
-   <!-- Applications menu -->
-   <menu label="&amp;Applications" enabled="true">
-     <submenu label="&amp;SciNotes" icon="accessories-text-editor">
-       <callback instruction="editor();" type="0"/>
-     </submenu>
-     <separator/>
-     <submenu label="&amp;Xcos" icon="utilities-system-monitor">
-       <callback instruction="if with_module(&quot;xcos&quot;) then xcos(); else disp(gettext(&quot;Please install xcos module.&quot;)); end" type="0"/>
-     </submenu>
-     <separator/>
-     <submenu label="&amp;Matlab to Scilab translator">
-       <callback instruction="if with_module(&quot;m2sci&quot;) then mfile2sci(); else disp(gettext(&quot;Please install m2sci module.&quot;)); end" type="0"/>
-     </submenu>
-     <separator/>
-     <submenu label="M&amp;odule manager - ATOMS" icon="package-x-generic">
-       <callback instruction="if with_module(&quot;atoms&quot;) then atomsGui(); else disp(gettext(&quot;Please install atoms module.&quot;)); end" type="0"/>
-     </submenu>
-     <separator/>
-     <submenu label="&amp;Variable Browser">
-       <callback instruction="browsevar()" type="0"/>
-     </submenu>
-     <separator/>
-     <submenu label="&amp;Command History">
-       <callback instruction="org.scilab.modules.history_browser.CommandHistory.setVisible" type="3"/>
-     </submenu>
-     <separator/>
-     <submenu label="&amp;File Browser">
-       <callback instruction="filebrowser()" type="0"/>
-     </submenu>
-   </menu>
-   <!-- Help menu -->
-   <menu label="&amp;?" enabled="true">
-     <submenu label="Scilab &amp;Help" accelerator="F1" icon="help-browser">
-       <callback instruction="help();" type="0"/>
-     </submenu>
-     <separator/>
-     <submenu label="Scilab &amp;Demonstrations" icon="applications-system">
-       <callback instruction="demo_gui();" type="0"/>
-     </submenu>
-     <separator/>
-     <submenu label="&amp;Links">
-       <submenu label="Scilab &amp;Web Site">
-         <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openScilabWebSite" type="3"/>
-       </submenu>
-       <separator/>
-       <submenu label="Scilab &amp;Online Help">
-         <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openOnlineHelp" type="3"/>
-       </submenu>
-       <submenu label="Scilab &amp;Wiki">
-         <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openWiki" type="3"/>
-       </submenu>
-       <separator/>
-       <submenu label="Scilab &amp;ATOMS Web Site">
-         <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openAtomsScilab" type="3"/>
-       </submenu>
-       <submenu label="&amp;File Exchange">
-         <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openFileExchange" type="3"/>
-       </submenu>
-       <submenu label="&amp;Mailing Lists">
-         <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openMailingList" type="3"/>
-       </submenu>
-       <submenu label="Mailing Lists &amp;Archives">
-         <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openMailingListArchives" type="3"/>
-       </submenu>
-       <separator/>
-       <submenu label="&amp;Forge">
-         <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openForge" type="3"/>
-       </submenu>
-       <submenu label="&amp;Bugs And Requests">
-         <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openBugzilla" type="3"/>
-       </submenu>
-     </submenu>
-     <separator/>
-     <submenu label="&amp;Scilab Enterprises">
-       <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openSE" type="3"/>
-     </submenu>
-     <separator/>
-     <submenu label="&amp;About Scilab..." accelerator="shift F1">
-       <callback instruction="about()" type="0"/>
-     </submenu>
-   </menu>
+     <!-- File menu -->
 -    <menu label="&amp;File" enabled="false">
++    <menu label="&amp;File" enabled="true">
+         <submenu label="&amp;Execute..." accelerator="OSSCKEY E">
+             <callback instruction="               %fileToExec = uigetfile(&quot;*.sc*&quot;, &quot;&quot;, gettext(&quot;Select a file to execute&quot;));               if ~(%fileToExec == &quot;&quot;) then                 exec(%fileToExec);                 disp(msprintf(gettext(&quot;Execution done.\n&quot;)));               end               clear(&quot;%fileToExec&quot;);" type="0"/>
+         </submenu>
+         <separator/>
+         <submenu label="&amp;Open a file..." accelerator="OSSCKEY O" icon="document-open-sci">
+             <callback instruction="               %fileToOpen = uigetfile(&quot;*.sc*&quot;, &quot;&quot;, gettext(&quot;Select a file to open with SciNotes&quot;));               if ~(%fileToOpen == &quot;&quot;) then                 editor(%fileToOpen);               end               clear(&quot;%fileToOpen&quot;);" type="0"/>
+         </submenu>
+         <submenu label="&amp;Load environment..." accelerator="OSSCKEY L" icon="document-open">
+             <callback instruction="               %fileToLoad = uigetfile([&quot;*.sav&quot;;&quot;*.sod&quot;], &quot;&quot;, gettext(&quot;Select a file to load&quot;));               if ~(%fileToLoad == &quot;&quot;) then                 load(%fileToLoad);                 disp(msprintf(gettext(&quot;Environment loaded.\n&quot;)));               end               clear(&quot;%fileToLoad&quot;);" type="0"/>
+         </submenu>
+         <submenu label="&amp;Save environment..." accelerator="OSSCKEY S" icon="document-save">
+             <callback instruction="               %fileToSave = uiputfile([&quot;*.sav&quot;;&quot;*.sod&quot;], &quot;&quot;, gettext(&quot;Select a file to write&quot;));               if ~(%fileToSave == &quot;&quot;) then                 if (fileparts(%fileToSave, &quot;extension&quot;) == &quot;&quot;) then                   %fileToSave = %fileToSave + &quot;.sav&quot;;                 end                 save(%fileToSave);                 disp(msprintf(gettext(&quot;Environment saved.\n&quot;)));               end               clear(&quot;%fileToSave&quot;);" type="0"/>
+         </submenu>
+         <separator/>
+         <submenu label="&amp;Change current directory..." icon="scilab-folder-open">
+             <callback instruction="               %newDir = uigetdir(pwd(), gettext(&quot;Select a directory&quot;));               if ~(%newDir == &quot;&quot;) then                 cd(%newDir);               end               clear(&quot;%newDir&quot;);" type="0"/>
+         </submenu>
+         <submenu label="&amp;Display current directory">
+             <callback instruction="if iswaitingforinput() then printf(&quot;\n%s\n\n%s\n&quot;,prompt(),pwd()); else printf(&quot;\n\n%s\n\n&quot;,pwd());end" type="0"/>
+         </submenu>
+         <separator/>
+         <submenu label="P&amp;age setup...">
+             <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.pageSetup" type="3"/>
+         </submenu>
+         <submenu label="&amp;Print..." accelerator="OSSCKEY P" icon="document-print">
+             <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.printConsoleContents" type="3"/>
+         </submenu>
+         <separator/>
+         <submenu label="&amp;Quit" accelerator="OSSCKEY Q" macosx="false">
+             <callback instruction="exit();" type="0"/>
+         </submenu>
+     </menu>
+     <!-- Edit menu -->
 -    <menu label="&amp;Edit" enabled="false">
++    <menu label="&amp;Edit" enabled="true">
+         <submenu label="C&amp;ut" accelerator="OSSCKEY X" icon="edit-cut">
+             <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.cutConsoleSelection" type="3"/>
+         </submenu>
+         <submenu label="&amp;Copy" accelerator="OSSCKEY C" icon="edit-copy">
+             <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.copyConsoleSelection" type="3"/>
+         </submenu>
+         <submenu label="&amp;Paste" accelerator="OSSCKEY V" icon="edit-paste">
+             <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.pasteClipboardIntoConsole" type="3"/>
+         </submenu>
+         <separator/>
+         <submenu label="&amp;Empty clipboard">
+             <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.emptyClipboard" type="3"/>
+         </submenu>
+         <separator/>
+         <submenu label="&amp;Select all" accelerator="OSSCKEY A" icon="edit-select-all">
+             <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.selectAllConsoleContents" type="3"/>
+         </submenu>
+         <separator/>
+         <submenu label="Show/Hide &amp;Toolbar">
+             <callback instruction="                 if toolbar(-1)==&quot;on&quot; then                   toolbar(-1, &quot;off&quot;);                 else                   toolbar(-1, &quot;on&quot;);                 end" type="0"/>
+         </submenu>
+         <separator/>
+         <submenu label="Clear &amp;History">
+             <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.clearHistory" type="3"/>
+         </submenu>
+         <submenu label="Clear C&amp;onsole" icon="edit-clear">
+             <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.clear" type="3"/>
+         </submenu>
+         <separator/>
+         <submenu label="P&amp;references" icon="preferences-system" macosx="false">
+             <callback instruction='org.scilab.modules.preferences.XConfigManager.openPreferences' type="3"/>
+         </submenu>
+     </menu>
+     <!-- Control menu -->
 -    <menu label="&amp;Control" enabled="false">
++    <menu label="&amp;Control" enabled="true">
+         <submenu label="&amp;Resume" icon="media-playback-start">
+             <callback instruction="resume;" type="-2"/>
+         </submenu>
+         <submenu label="&amp;Abort" icon="process-stop">
+             <callback instruction="abort;" type="-2"/>
+         </submenu>
+         <submenu label="&amp;Interrupt">
+             <callback instruction="pause;" type="-2"/>
+         </submenu>
+     </menu>
+     <!-- Applications menu -->
 -    <menu label="&amp;Applications" enabled="false">
++    <menu label="&amp;Applications" enabled="true">
+         <submenu label="&amp;SciNotes" icon="accessories-text-editor">
+             <callback instruction="editor();" type="0"/>
+         </submenu>
+         <separator/>
+         <submenu label="&amp;Xcos" icon="utilities-system-monitor">
+             <callback instruction="if with_module(&quot;xcos&quot;) then xcos(); else disp(gettext(&quot;Please install xcos module.&quot;)); end" type="0"/>
+         </submenu>
+         <separator/>
+         <submenu label="&amp;Matlab to Scilab translator">
+             <callback instruction="if with_module(&quot;m2sci&quot;) then mfile2sci(); else disp(gettext(&quot;Please install m2sci module.&quot;)); end" type="0"/>
+         </submenu>
+         <separator/>
+         <submenu label="M&amp;odule manager - ATOMS" icon="package-x-generic">
+             <callback instruction="if with_module(&quot;atoms&quot;) then atomsGui(); else disp(gettext(&quot;Please install atoms module.&quot;)); end" type="0"/>
+         </submenu>
+         <separator/>
+         <submenu label="&amp;Variable Browser">
+             <callback instruction="browsevar()" type="0"/>
+         </submenu>
+         <separator/>
+         <submenu label="&amp;Command History">
+             <callback instruction="org.scilab.modules.history_browser.CommandHistory.setVisible" type="3"/>
+         </submenu>
+         <separator/>
+         <submenu label="&amp;File Browser">
+             <callback instruction="filebrowser()" type="0"/>
+         </submenu>
+     </menu>
+     <!-- Help menu -->
 -    <menu label="&amp;?" enabled="false">
++    <menu label="&amp;?" enabled="true">
+         <submenu label="Scilab &amp;Help" accelerator="F1" icon="help-browser">
+             <callback instruction="help();" type="0"/>
+         </submenu>
+         <separator/>
+         <submenu label="Scilab &amp;Demonstrations" icon="applications-system">
+             <callback instruction="demo_gui();" type="0"/>
+         </submenu>
+         <separator/>
+         <submenu label="&amp;Links">
+             <submenu label="Scilab &amp;Web Site">
+                 <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openScilabWebSite" type="3"/>
+             </submenu>
+             <separator/>
+             <submenu label="Scilab &amp;Online Help">
+                 <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openOnlineHelp" type="3"/>
+             </submenu>
+             <submenu label="Scilab &amp;Wiki">
+                 <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openWiki" type="3"/>
+             </submenu>
+             <separator/>
+             <submenu label="Scilab &amp;ATOMS Web Site">
+                 <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openAtomsScilab" type="3"/>
+             </submenu>
+             <submenu label="&amp;File Exchange">
+                 <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openFileExchange" type="3"/>
+             </submenu>
+             <submenu label="&amp;Mailing Lists">
+                 <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openMailingList" type="3"/>
+             </submenu>
+             <submenu label="Mailing Lists &amp;Archives">
+                 <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openMailingListArchives" type="3"/>
+             </submenu>
+             <separator/>
+             <submenu label="&amp;Forge">
+                 <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openForge" type="3"/>
+             </submenu>
+             <submenu label="&amp;Bugs And Requests">
+                 <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openBugzilla" type="3"/>
+             </submenu>
+         </submenu>
+         <separator/>
+         <submenu label="&amp;Scilab Enterprises">
+             <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openSE" type="3"/>
+         </submenu>
+         <separator/>
+         <submenu label="&amp;About Scilab..." accelerator="shift F1">
+             <callback instruction="about()" type="0"/>
+         </submenu>
+     </menu>
  </menubar>
  
@@@ -39,10 -39,11 +39,10 @@@ static BOOL loadedDep = FALSE
  using namespace org_scilab_modules_gui_bridge;
  
  /*--------------------------------------------------------------------------*/
- static int sci_toprint_one_rhs(const char *fname, void* pvApiCtx);
- static int sci_toprint_two_rhs(const char *fname, void* pvApiCtx);
+ static int sci_toprint_one_rhs(void* _pvCtx, const char *fname);
+ static int sci_toprint_two_rhs(void* _pvCtx, const char *fname);
 -
  /*--------------------------------------------------------------------------*/
 -int sci_toprint(char *fname, unsigned long l)
 +int sci_toprint(char *fname, void* pvApiCtx)
  {
      CheckRhs(1, 2);
      CheckLhs(0, 1);
@@@ -126,12 -127,13 +126,13 @@@ static int sci_toprint_one_rhs(void* _p
              Scierror(999, _("%s: Memory allocation error.\n"), fname);
          }
      }
--    else if (isDoubleType(pvApiCtx, piAddressVarOne))
++    else if (isDoubleType(_pvCtx, piAddressVarOne))
      {
--        if (isScalar(pvApiCtx, piAddressVarOne))
++        if (isScalar(_pvCtx, piAddressVarOne))
          {
              double dValue = 0.;
-             if (!getScalarDouble(pvApiCtx, piAddressVarOne, &dValue))
+             if (!getScalarDouble(_pvCtx, piAddressVarOne, &dValue))
              {
                  int num_win = (int)dValue;
                  BOOL iRet = FALSE;
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge