d6e51fa168dc7ec75fd51edb32da1d5f606257e7
[scilab.git] / scilab / modules / gui / sci_gateway / cpp / gui_gw.cpp
1 /*
2  *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3  *  Copyright (C) 2010-2010 - DIGITEO - Bruno JOFRET
4  *
5  *  This file must be used under the terms of the CeCILL.
6  *  This source file is licensed as described in the file COPYING, which
7  *  you should have received as part of this distribution.  The terms
8  *  are also available at
9  *  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
10  *
11  */
12
13 #include "gui_gw.hxx"
14 #include "function.hxx"
15 #include "context.hxx"
16
17 #define MODULE_NAME L"gui"
18 extern "C"
19 {
20         #include "gw_gui.h"
21 #include "loadOnUseClassPath.h"
22 }
23
24 using namespace types;
25
26 bool GuiModule::loadedDep = false;
27
28 void GuiModule::LoadDeps(void)
29 {
30     if (loadedDep == false)
31     {
32         loadOnUseClassPath("graphics");
33         loadedDep = true;
34     }
35 }
36 int GuiModule::Load()
37 {
38         symbol::Context::getInstance()->AddFunction(Function::createFunction(L"x_dialog", &sci_x_dialog, &GuiModule::LoadDeps, MODULE_NAME));
39         symbol::Context::getInstance()->AddFunction(Function::createFunction(L"x_choose", &sci_x_choose, &GuiModule::LoadDeps, MODULE_NAME));
40         symbol::Context::getInstance()->AddFunction(Function::createFunction(L"x_mdialog", &sci_x_mdialog, &GuiModule::LoadDeps, MODULE_NAME));
41         symbol::Context::getInstance()->AddFunction(Function::createFunction(L"xchoicesi", &sci_x_choice, &GuiModule::LoadDeps, MODULE_NAME));
42         symbol::Context::getInstance()->AddFunction(Function::createFunction(L"delmenu", &sci_delmenu, &GuiModule::LoadDeps, MODULE_NAME));
43         symbol::Context::getInstance()->AddFunction(Function::createFunction(L"setmenu", &sci_setmenu, &GuiModule::LoadDeps, MODULE_NAME));
44         symbol::Context::getInstance()->AddFunction(Function::createFunction(L"unsetmenu", &sci_unsetmenu, &GuiModule::LoadDeps, MODULE_NAME));
45         symbol::Context::getInstance()->AddFunction(Function::createFunction(L"raise_window", &sci_raise_window, &GuiModule::LoadDeps, MODULE_NAME));
46         symbol::Context::getInstance()->AddFunction(Function::createFunction(L"getlookandfeel", &sci_getlookandfeel, &GuiModule::LoadDeps, MODULE_NAME));
47         symbol::Context::getInstance()->AddFunction(Function::createFunction(L"getinstalledlookandfeels", &sci_getinstalledlookandfeels, &GuiModule::LoadDeps, MODULE_NAME));
48         symbol::Context::getInstance()->AddFunction(Function::createFunction(L"setlookandfeel", &sci_setlookandfeel, &GuiModule::LoadDeps, MODULE_NAME));
49         symbol::Context::getInstance()->AddFunction(Function::createFunction(L"ClipBoard", &sci_ClipBoard, &GuiModule::LoadDeps, MODULE_NAME));
50         symbol::Context::getInstance()->AddFunction(Function::createFunction(L"toolbar", &sci_toolbar, &GuiModule::LoadDeps, MODULE_NAME));
51         symbol::Context::getInstance()->AddFunction(Function::createFunction(L"uigetdir", &sci_uigetdir, &GuiModule::LoadDeps, MODULE_NAME));
52         symbol::Context::getInstance()->AddFunction(Function::createFunction(L"uicontrol", &sci_uicontrol, &GuiModule::LoadDeps, MODULE_NAME));
53         symbol::Context::getInstance()->AddFunction(Function::createFunction(L"uimenu", &sci_uimenu, &GuiModule::LoadDeps, MODULE_NAME));
54         symbol::Context::getInstance()->AddFunction(Function::createFunction(L"uipopup", &sci_mpopup, &GuiModule::LoadDeps, MODULE_NAME));
55         symbol::Context::getInstance()->AddFunction(Function::createFunction(L"x_choose_modeless", &sci_x_choose_modeless, &GuiModule::LoadDeps, MODULE_NAME));
56         symbol::Context::getInstance()->AddFunction(Function::createFunction(L"uicontextmenu", &sci_uicontextmenu, &GuiModule::LoadDeps, MODULE_NAME));
57         symbol::Context::getInstance()->AddFunction(Function::createFunction(L"uiwait", &sci_uiwait, &GuiModule::LoadDeps, MODULE_NAME));
58         symbol::Context::getInstance()->AddFunction(Function::createFunction(L"messagebox", &sci_messagebox, &GuiModule::LoadDeps, MODULE_NAME));
59         symbol::Context::getInstance()->AddFunction(Function::createFunction(L"waitbar", &sci_waitbar, &GuiModule::LoadDeps, MODULE_NAME));
60         symbol::Context::getInstance()->AddFunction(Function::createFunction(L"progressionbar", &sci_progressionbar, &GuiModule::LoadDeps, MODULE_NAME));
61         symbol::Context::getInstance()->AddFunction(Function::createFunction(L"helpbrowser", &sci_helpbrowser, &GuiModule::LoadDeps, MODULE_NAME));
62         symbol::Context::getInstance()->AddFunction(Function::createFunction(L"uigetfont", &sci_uigetfont, &GuiModule::LoadDeps, MODULE_NAME));
63         symbol::Context::getInstance()->AddFunction(Function::createFunction(L"uigetcolor", &sci_uigetcolor, &GuiModule::LoadDeps, MODULE_NAME));
64         symbol::Context::getInstance()->AddFunction(Function::createFunction(L"getcallbackobject", &sci_getcallbackobject, &GuiModule::LoadDeps, MODULE_NAME));
65         symbol::Context::getInstance()->AddFunction(Function::createFunction(L"printfigure", &sci_printfigure, &GuiModule::LoadDeps, MODULE_NAME));
66         symbol::Context::getInstance()->AddFunction(Function::createFunction(L"exportUI", &sci_exportUI, &GuiModule::LoadDeps, MODULE_NAME));
67         symbol::Context::getInstance()->AddFunction(Function::createFunction(L"printsetupbox", &sci_printsetupbox, &GuiModule::LoadDeps, MODULE_NAME));
68         symbol::Context::getInstance()->AddFunction(Function::createFunction(L"toprint", &sci_toprint, &GuiModule::LoadDeps, MODULE_NAME));
69         symbol::Context::getInstance()->AddFunction(Function::createFunction(L"uigetfile", &sci_uigetfile, &GuiModule::LoadDeps, MODULE_NAME));
70         symbol::Context::getInstance()->AddFunction(Function::createFunction(L"usecanvas", &sci_usecanvas, &GuiModule::LoadDeps, MODULE_NAME));
71         symbol::Context::getInstance()->AddFunction(Function::createFunction(L"uiDisplayTree", &sci_displaytree, &GuiModule::LoadDeps, MODULE_NAME));
72         symbol::Context::getInstance()->AddFunction(Function::createFunction(L"uiputfile", &sci_uiputfile, &GuiModule::LoadDeps, MODULE_NAME));
73         symbol::Context::getInstance()->AddFunction(Function::createFunction(L"about", &sci_about, &GuiModule::LoadDeps, MODULE_NAME));
74         symbol::Context::getInstance()->AddFunction(Function::createFunction(L"fire_closing_finished", &sci_fire_closing_finished, &GuiModule::LoadDeps, MODULE_NAME));
75     return 1;
76 }