2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) DIGITEO - 2009-2010 - Allan CORNET <allan.cornet@scilab.org>
4 * Copyright (C) DIGITEO - 2010-2010 - Clément DAVID <clement.david@scilab.org>
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
13 /*--------------------------------------------------------------------------*/
15 #include "api_scilab.h"
17 #include "callFunctionFromGateway.h"
19 #include "scilabmode.h"
20 #include "localization.h"
23 #include "loadOnUseClassPath.h"
24 /*--------------------------------------------------------------------------*/
25 static BOOL loadedDep = FALSE;
27 /*--------------------------------------------------------------------------*/
28 static gw_generic_table Tab[] =
31 {sci_warnBlockByUID, "warnBlockByUID"},
32 {sci_closeXcosFromScilab, "closeXcos"},
33 {sci_xcosDiagramToScilab, "xcosDiagramToScilab"},
34 {sci_xcosPalLoad, "xcosPalLoad"},
35 {sci_xcosPalCategoryAdd, "xcosPalCategoryAdd"},
36 {sci_xcosPalDelete, "xcosPalDelete"},
37 {sci_xcosPalMove, "xcosPalMove"},
38 {sci_xcosPalEnable, "xcosPalEnable"},
39 {sci_xcosPalDisable, "xcosPalDisable"},
40 {sci_xcosPalGenerateIcon, "xcosPalGenerateIcon"},
41 {sci_xcosConfigureXmlFile, "xcosConfigureXmlFile"},
42 {sci_xcosAddToolsMenu, "xcosAddToolsMenu"},
43 {sci_xcosUpdateBlock, "xcosUpdateBlock"},
44 {sci_loadXcos, "loadXcos"},
45 {sci_xcosSimulationStarted, "xcosSimulationStarted"}
48 /*--------------------------------------------------------------------------*/
53 if (getScilabMode() == SCILAB_NWNI)
55 Scierror(999, _("Scilab '%s' module disabled in -nogui or -nwni mode.\n"), "xcos");
59 if (!loadedDep // never reload
60 && Tab[Fin - 1].f != sci_closeXcosFromScilab) // do not load on close
62 loadOnUseClassPath("Xcos");
69 pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
72 pvApiCtx->pstName = (char*)Tab[Fin - 1].name;
73 callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
77 /*--------------------------------------------------------------------------*/
83 /*--------------------------------------------------------------------------*/