summaryrefslogtreecommitdiff
path: root/modules/tclsci/macros
diff options
context:
space:
mode:
Diffstat (limited to 'modules/tclsci/macros')
-rwxr-xr-xmodules/tclsci/macros/TCL_CreateSlave.binbin0 -> 5188 bytes
-rwxr-xr-xmodules/tclsci/macros/TCL_CreateSlave.sci47
-rwxr-xr-xmodules/tclsci/macros/buildmacros.bat1
-rwxr-xr-xmodules/tclsci/macros/buildmacros.sce15
-rwxr-xr-xmodules/tclsci/macros/cleanmacros.bat3
-rwxr-xr-xmodules/tclsci/macros/gettklib.binbin0 -> 5896 bytes
-rwxr-xr-xmodules/tclsci/macros/gettklib.sci55
-rwxr-xr-xmodules/tclsci/macros/libbin0 -> 356 bytes
-rwxr-xr-xmodules/tclsci/macros/names4
-rwxr-xr-xmodules/tclsci/macros/sciGUI_init.binbin0 -> 1656 bytes
-rwxr-xr-xmodules/tclsci/macros/sciGUI_init.sci19
-rwxr-xr-xmodules/tclsci/macros/winlist.binbin0 -> 2504 bytes
-rwxr-xr-xmodules/tclsci/macros/winlist.sci34
13 files changed, 178 insertions, 0 deletions
diff --git a/modules/tclsci/macros/TCL_CreateSlave.bin b/modules/tclsci/macros/TCL_CreateSlave.bin
new file mode 100755
index 000000000..32fdae917
--- /dev/null
+++ b/modules/tclsci/macros/TCL_CreateSlave.bin
Binary files differ
diff --git a/modules/tclsci/macros/TCL_CreateSlave.sci b/modules/tclsci/macros/TCL_CreateSlave.sci
new file mode 100755
index 000000000..b8eab5ead
--- /dev/null
+++ b/modules/tclsci/macros/TCL_CreateSlave.sci
@@ -0,0 +1,47 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008 - INRIA - 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.1-en.txt
+
+
+function status = TCL_CreateSlave(slaveName, isSafe)
+ // slaveName: name of the slave to create
+ // isSafe: %T to create a safe slave, %F otherwise (default)
+
+ // Input arguments tests
+ [lhs, rhs] = argn();
+ if rhs<>1 & rhs<>2 then
+ error(msprintf(gettext("%s: Wrong number of input argument(s): %d to %d expected.\n"), "TCL_CreateSlave", 1, 2));
+ end
+
+ if lhs<>1 then
+ error(msprintf(gettext("%s: Wrong number of output argument(s): %d expected.\n"), "TCL_CreateSlave", 1));
+ end
+
+ if typeof(slaveName)<>"string" then
+ error(msprintf(gettext("%s: Wrong type for input argument #%d: A String expected.\n"), "TCL_CreateSlave", 1));
+ end
+
+ if rhs==1 then
+ isSafe = %F; // Create an unsafe slave by default
+ end
+
+ if typeof(isSafe)<>"boolean" then
+ error(msprintf(gettext("%s: Wrong type for input argument #%d: A Boolean expected.\n"), "TCL_CreateSlave", 2));
+ end
+
+ if TCL_ExistInterp(slaveName) then
+ error(msprintf(gettext("%s: Slave interpreter already exists.\n"),"TCL_CreateSlave"));
+ end
+
+ if isSafe then
+ status = TCL_EvalStr("interp create -safe "+slaveName);
+ else
+ status = TCL_EvalStr("interp create "+slaveName);
+ end
+
+endfunction
diff --git a/modules/tclsci/macros/buildmacros.bat b/modules/tclsci/macros/buildmacros.bat
new file mode 100755
index 000000000..c4e35ec40
--- /dev/null
+++ b/modules/tclsci/macros/buildmacros.bat
@@ -0,0 +1 @@
+@..\..\..\bin\scilex -nwni -ns -e exec('buildmacros.sce');quit; \ No newline at end of file
diff --git a/modules/tclsci/macros/buildmacros.sce b/modules/tclsci/macros/buildmacros.sce
new file mode 100755
index 000000000..e148c001e
--- /dev/null
+++ b/modules/tclsci/macros/buildmacros.sce
@@ -0,0 +1,15 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2005 - INRIA - 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
+
+if (isdef("genlib") == %f) then
+ exec(SCI+"/modules/functions/scripts/buildmacros/loadgenlib.sce");
+end
+//------------------------------------
+genlib("tclscilib","SCI/modules/tclsci/macros",%f,%t);
+//------------------------------------
diff --git a/modules/tclsci/macros/cleanmacros.bat b/modules/tclsci/macros/cleanmacros.bat
new file mode 100755
index 000000000..5079dfd71
--- /dev/null
+++ b/modules/tclsci/macros/cleanmacros.bat
@@ -0,0 +1,3 @@
+@del *.bin 2>NUL
+@del lib 2>NUL
+@del names 2>NUL \ No newline at end of file
diff --git a/modules/tclsci/macros/gettklib.bin b/modules/tclsci/macros/gettklib.bin
new file mode 100755
index 000000000..309fe9bef
--- /dev/null
+++ b/modules/tclsci/macros/gettklib.bin
Binary files differ
diff --git a/modules/tclsci/macros/gettklib.sci b/modules/tclsci/macros/gettklib.sci
new file mode 100755
index 000000000..bbf91a321
--- /dev/null
+++ b/modules/tclsci/macros/gettklib.sci
@@ -0,0 +1,55 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) INRIA
+//
+// 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
+
+
+function tklib=gettklib()
+ tklib = [];
+ tcltkver = TCL_GetVersion("numbers");
+ // don't use string() but msprintf because of format() - see bug 3602
+ major = msprintf("%d",tcltkver(1));
+ minor = msprintf("%d",tcltkver(2));
+ if getos() == "Windows" then
+ tklib = "tk" + major + minor + getdynlibext();
+ else
+ cur_verbose = ilib_verbose();
+ ilib_verbose(0);
+
+ // In the binary version libtk8.X.so has been copied in
+ // the SCI/bin directory and scilab script add SCI/bin
+ // to the LD_LIBRARY_PATH (or SHLIB_PATH).
+ // So, If libtk8.X.so (or .sl) exists in SCI/bin ... it's ok
+ libname = "libtk" + major + "." + minor;
+ if isfile("SCI/bin/"+libname+getdynlibext()) then
+ tklib = libname + getdynlibext();
+ ilib_verbose(cur_verbose);
+ return;
+ end
+ cmd ="link(''"+libname+getdynlibext()+"'')";
+ ierr = execstr(cmd, "errcatch");
+ if (ierr == 0) then
+ tklib = libname + getdynlibext();
+ else
+ cmd ="link(''"+libname+getdynlibext()+".0'')";
+ ierr = execstr(cmd, "errcatch");
+ if (ierr == 0) then
+ tklib = libname + getdynlibext() + ".0";
+ else
+ warning(msprintf(gettext("Error %s while loading library %s"),lasterror(),libname+getdynlibext()));
+ end
+ end
+
+ ilib_verbose(cur_verbose);
+
+ clear libname;
+ clear cmd;
+ end
+ clear tcltkver;
+ clear major;
+ clear minor;
+endfunction
diff --git a/modules/tclsci/macros/lib b/modules/tclsci/macros/lib
new file mode 100755
index 000000000..56567de89
--- /dev/null
+++ b/modules/tclsci/macros/lib
Binary files differ
diff --git a/modules/tclsci/macros/names b/modules/tclsci/macros/names
new file mode 100755
index 000000000..ec8545801
--- /dev/null
+++ b/modules/tclsci/macros/names
@@ -0,0 +1,4 @@
+TCL_CreateSlave
+gettklib
+sciGUI_init
+winlist
diff --git a/modules/tclsci/macros/sciGUI_init.bin b/modules/tclsci/macros/sciGUI_init.bin
new file mode 100755
index 000000000..f72d1bbd6
--- /dev/null
+++ b/modules/tclsci/macros/sciGUI_init.bin
Binary files differ
diff --git a/modules/tclsci/macros/sciGUI_init.sci b/modules/tclsci/macros/sciGUI_init.sci
new file mode 100755
index 000000000..1a2158d93
--- /dev/null
+++ b/modules/tclsci/macros/sciGUI_init.sci
@@ -0,0 +1,19 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) INRIA
+//
+// 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
+
+
+function sciGUI_init()
+ if execstr("TCL_GetVar(''sciGUITable(win,0,type)'')","errcatch")<>0 then
+ sciGUI_tclpath=SCI+"/modules/tclsci/tcl/sciGUI/"
+ TCL_EvalFile(sciGUI_tclpath+"sciGUI.tcl");
+ TCL_EvalFile(sciGUI_tclpath+"sciBrowseVar.tcl");
+ TCL_EvalFile(sciGUI_tclpath+"sciEditVar.tcl");
+ TCL_EvalStr("sciGUIDoInit """+SCI+"/modules/tclsci"+""";sciGUIBrowseVarINI;");
+ end
+endfunction
diff --git a/modules/tclsci/macros/winlist.bin b/modules/tclsci/macros/winlist.bin
new file mode 100755
index 000000000..f82fcb6a0
--- /dev/null
+++ b/modules/tclsci/macros/winlist.bin
Binary files differ
diff --git a/modules/tclsci/macros/winlist.sci b/modules/tclsci/macros/winlist.sci
new file mode 100755
index 000000000..284b6960b
--- /dev/null
+++ b/modules/tclsci/macros/winlist.sci
@@ -0,0 +1,34 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2004 - Jaime Urzua
+//
+// 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
+
+
+function hout=winlist()
+ // Return a list
+ // This file is part of sciGUI toolbox
+ // rev. 0.1
+ //
+ // This program is free software; you can redistribute it and/or modify
+ //it under the terms of the GNU General Public License as published by
+ //the Free Software Foundation; either version 2 of the License, or
+ //(at your option) any later version.
+
+ rhs=argn(2);
+ if execstr("rep=TCL_GetVar(''sciGUITable(win,id)'')","errcatch")<>0 then
+ hout=[];
+ return
+ end
+ h1=evstr(rep);
+ if (length(h1)==1) then
+ h1=[];
+ else
+ h1=h1(2:$)';
+ end
+ hout=h1;
+endfunction
+