1 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 // Copyright (C) DIGITEO - 2009 - Allan CORNET
4 // Copyright (C) 2012 - Samuel GOUGEON
6 // This file must be used under the terms of the CeCILL.
7 // This source file is licensed as described in the file COPYING, which
8 // you should have received as part of this distribution. The terms
9 // are also available at
10 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
12 //===========================================================
13 function [y] = toolboxes(path)
14 // INTERNAL macro should NOT used by users
16 // path is a directory to explore for contribs
17 //===========================================================
20 //===========================================================
23 if (rhs == 1) & typeof(path)=="constant" then
24 // return string to exec
25 y = 'exec(""" + %toolboxes_dir + %toolboxes(path) + filesep() + "loader.sce" + """);';
31 path = SCI + filesep() + 'contrib';
36 files = listfiles('.');
38 for k = 1:size(files,'*')
39 if isfile(files(k)+'/loader.sce') then
40 contribs = [contribs ; files(k)];
44 // ATOMS modules without autoloading
45 installed = atomsGetInstalled()
46 autoloading = atomsAutoloadList()
47 for i = 1:size(installed,1)
48 if and(installed(i,1)~=autoloading(:,1)) then
49 tmpath = installed(i,4)+filesep()+"loader.sce"
50 if isfile(tmpath) then
51 contribs = [contribs ; installed(i,1)+filesep()+installed(i,2)]
56 if (contribs <> []) & (getscilabmode() == 'STD') then
57 delmenu(gettext("&Toolboxes"));
58 h = uimenu("parent", 0, "label", gettext("&Toolboxes"));
59 for k=1:size(contribs,'*')
60 m = uimenu(h,'label', string(contribs(k)), 'callback','execstr(toolboxes('+string(k)+'))');
62 unsetmenu(gettext("&Toolboxes"));
65 %toolboxes = contribs;
66 %toolboxes_dir = pathconvert(path);
70 //===========================================================