1 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2 // Copyright (C) - 2013 - Scilab Enterprises - Clément DAVID
4 // Copyright (C) 2012 - 2016 - Scilab Enterprises
6 // This file is hereby licensed under the terms of the GNU GPL v2.0,
7 // pursuant to article 5.3.4 of the CeCILL v.2.1.
8 // This file was originally licensed under the terms of the CeCILL v2.1,
9 // and continues to be available under such terms.
10 // For more information, see the COPYING file which you should have received
11 // along with this program.
13 function blocks = xcosPalGenerateAllIcons(path)
14 // 0. Check number of arguments
17 error(msprintf(gettext("%s: Wrong number of input arguments: %d expected.\n"),"xcosPalGenerateAllIcons",1));
20 error(msprintf(gettext("%s: Wrong number of output arguments: %d expected.\n"),"xcosPalGenerateAllIcons",1));
23 if typeof(path)<>"string" then
24 error(sprintf(gettext("%s: Wrong type for argument #%d: Matrix of strings expected.\n"), "xcosPalGenerateAllIcons", 1));
27 if and(size(path)<>1) then
28 error(sprintf(gettext("%s: Wrong size for input argument #%d: Vector expected.\n"), "xcosPalGenerateAllIcons" , 1));
31 // 3. check the argument validity
32 xcosPalGet(path); // will push a 'pal' mlist
34 if size(pal.blockNames, "*") <= 0 then
35 error(sprintf(gettext("%s: Wrong value for input argument #%d: No block found.\n"), "xcosPalGenerateAllIcons" ,1));
39 for i=1:size(pal.blockNames, "*")
40 name = pal.blockNames(i);
41 iconPath = pal.icons(i);
44 execstr("blk="+name+"(''define'');");
46 // filter-out the text block
47 if typeof(blk) == "Text" then
52 xcosPalGenerateIcon(iconPath);