Merge remote-tracking branch 'refs/remotes/origin/master' into preferences 15/5915/1
Allan CORNET [Fri, 13 Jan 2012 10:37:16 +0000 (11:37 +0100)]
Conflicts:
scilab/Visual-Studio-settings/ant-all/ant-all.vcxproj

Change-Id: Ie8736a54af417e378ba699bc9cf3b99cc438de78

129 files changed:
scilab/Scilab.sln
scilab/Scilab_f2c.sln
scilab/Version.incl
scilab/Visual-Studio-settings/ant-all/ant-all.vcxproj
scilab/build.incl.xml
scilab/configure.ac
scilab/contrib/toolbox_skeleton/etc/toolbox_skeleton.quit
scilab/contrib/toolbox_skeleton/etc/toolbox_skeleton.start
scilab/contrib/toolbox_skeleton/etc/toolbox_skeleton_preferences.xml [new file with mode: 0644]
scilab/contrib/toolbox_skeleton/etc/toolbox_skeleton_preferences.xsl [new file with mode: 0644]
scilab/etc/classpath.xml.in
scilab/etc/classpath.xml.vc
scilab/etc/modules.xml.in
scilab/etc/modules.xml.vc
scilab/etc/scilab.start
scilab/libs/MALLOC/src/win_mem_alloc.c
scilab/modules/Makefile.am
scilab/modules/Makefile.in
scilab/modules/core/includes/callinterf.h
scilab/modules/core/includes/version.h.in
scilab/modules/core/includes/version.h.vc
scilab/modules/core/src/c/callinterf.c
scilab/modules/core/src/c/dynamic_gateways.c
scilab/modules/core/src/c/dynamic_gateways.h
scilab/modules/gui/etc/main_menubar.xml
scilab/modules/gui/images/icons/16x16/actions/go-down.png [new file with mode: 0644]
scilab/modules/gui/images/icons/16x16/actions/go-first.png [new file with mode: 0644]
scilab/modules/gui/images/icons/16x16/actions/go-jump.png [new file with mode: 0644]
scilab/modules/gui/images/icons/16x16/actions/go-last.png [new file with mode: 0644]
scilab/modules/gui/images/icons/16x16/actions/go-up.png [new file with mode: 0644]
scilab/modules/gui/images/icons/16x16/actions/media-eject.png [new file with mode: 0644]
scilab/modules/gui/images/icons/16x16/actions/media-playback-pause.png [new file with mode: 0644]
scilab/modules/gui/images/icons/16x16/actions/media-playback-stop.png [new file with mode: 0644]
scilab/modules/gui/images/icons/16x16/actions/media-seek-backward.png [new file with mode: 0644]
scilab/modules/gui/images/icons/16x16/actions/media-seek-forward.png [new file with mode: 0644]
scilab/modules/gui/images/icons/16x16/actions/media-skip-backward.png [new file with mode: 0644]
scilab/modules/gui/images/icons/16x16/actions/media-skip-forward.png [new file with mode: 0644]
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/CallScilabBridge.java
scilab/modules/preferences/Makefile.am [new file with mode: 0644]
scilab/modules/preferences/Makefile.in [new file with mode: 0644]
scilab/modules/preferences/build.xml [new file with mode: 0644]
scilab/modules/preferences/etc/XConfiguration.xml [new file with mode: 0644]
scilab/modules/preferences/etc/XWizard-expression.xml [new file with mode: 0644]
scilab/modules/preferences/etc/XWizard-function.xml [new file with mode: 0644]
scilab/modules/preferences/etc/XWizard-xcos.xml [new file with mode: 0644]
scilab/modules/preferences/etc/XWizard.xml [new file with mode: 0644]
scilab/modules/preferences/etc/preferences.quit [new file with mode: 0644]
scilab/modules/preferences/etc/preferences.start [new file with mode: 0644]
scilab/modules/preferences/includes/dynlib_preferences_scilab.h [new file with mode: 0644]
scilab/modules/preferences/includes/gw_preferences.h [new file with mode: 0644]
scilab/modules/preferences/license.txt [new file with mode: 0644]
scilab/modules/preferences/macros/buildmacros.bat [new file with mode: 0644]
scilab/modules/preferences/macros/buildmacros.sce [new file with mode: 0644]
scilab/modules/preferences/macros/cleanmacros.bat [new file with mode: 0644]
scilab/modules/preferences/preferences.iss [new file with mode: 0644]
scilab/modules/preferences/sci_gateway/c/gw_preferences.c [new file with mode: 0644]
scilab/modules/preferences/sci_gateway/cpp/sci_addToolboxInfos.cpp [new file with mode: 0644]
scilab/modules/preferences/sci_gateway/cpp/sci_removeToolboxInfos.cpp [new file with mode: 0644]
scilab/modules/preferences/sci_gateway/preferences_gateway.xml [new file with mode: 0644]
scilab/modules/preferences/src/c/DllmainPreferences.c [new file with mode: 0644]
scilab/modules/preferences/src/c/LibScilab_Import.def [new file with mode: 0644]
scilab/modules/preferences/src/c/preferences.rc [new file with mode: 0644]
scilab/modules/preferences/src/c/preferences.vcxproj [new file with mode: 0644]
scilab/modules/preferences/src/c/preferences.vcxproj.filters [new file with mode: 0644]
scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Button.java [new file with mode: 0644]
scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Checkbox.java [new file with mode: 0644]
scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Color.java [new file with mode: 0644]
scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Entry.java [new file with mode: 0644]
scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/File.java [new file with mode: 0644]
scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Grid.java [new file with mode: 0644]
scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/HBox [new file with mode: 0644]
scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/HBox.java [new file with mode: 0644]
scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Icon.java [new file with mode: 0644]
scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Label.java [new file with mode: 0644]
scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Link.java [new file with mode: 0644]
scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Panel.java [new file with mode: 0644]
scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/PreviewCode.java [new file with mode: 0644]
scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Radiobutton.java [new file with mode: 0644]
scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Scroll.java [new file with mode: 0644]
scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Select.java [new file with mode: 0644]
scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Slider.java [new file with mode: 0644]
scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Table.java [new file with mode: 0644]
scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Title.java [new file with mode: 0644]
scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Tree.java [new file with mode: 0644]
scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/VBox.java [new file with mode: 0644]
scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/XCosPreview.java [new file with mode: 0644]
scilab/modules/preferences/src/java/org/scilab/modules/preferences/ScilabPreferences.java [new file with mode: 0644]
scilab/modules/preferences/src/java/org/scilab/modules/preferences/XChooser.java [new file with mode: 0644]
scilab/modules/preferences/src/java/org/scilab/modules/preferences/XCommonManager.java [new file with mode: 0644]
scilab/modules/preferences/src/java/org/scilab/modules/preferences/XComponent.java [new file with mode: 0644]
scilab/modules/preferences/src/java/org/scilab/modules/preferences/XComponentAttributes.java [new file with mode: 0644]
scilab/modules/preferences/src/java/org/scilab/modules/preferences/XConfigManager.java [new file with mode: 0644]
scilab/modules/preferences/src/java/org/scilab/modules/preferences/XSentinel.java [new file with mode: 0644]
scilab/modules/preferences/src/java/org/scilab/modules/preferences/XUpdateVisitor.java [new file with mode: 0644]
scilab/modules/preferences/src/java/org/scilab/modules/preferences/XWizardManager.java [new file with mode: 0644]
scilab/modules/preferences/src/java/preferences-JAVA.vcxproj [new file with mode: 0644]
scilab/modules/preferences/src/java/preferences-JAVA.vcxproj.filters [new file with mode: 0644]
scilab/modules/preferences/src/jni/GiwsException.cpp [new file with mode: 0644]
scilab/modules/preferences/src/jni/GiwsException.hxx [new file with mode: 0644]
scilab/modules/preferences/src/jni/ScilabPreferences.cpp [new file with mode: 0644]
scilab/modules/preferences/src/jni/ScilabPreferences.giws.xml [new file with mode: 0644]
scilab/modules/preferences/src/jni/ScilabPreferences.hxx [new file with mode: 0644]
scilab/modules/preferences/src/nopreferences/nopreferences.c [new file with mode: 0644]
scilab/modules/preferences/src/nopreferences/nopreferences.h [new file with mode: 0644]
scilab/modules/preferences/src/xslt/XCommon-toolbars.xsl [new file with mode: 0644]
scilab/modules/preferences/src/xslt/XCommon.xsl [new file with mode: 0644]
scilab/modules/preferences/src/xslt/XConfiguration.xsl [new file with mode: 0644]
scilab/modules/preferences/src/xslt/XConfiguration/XConfiguration-colors.xsl [new file with mode: 0644]
scilab/modules/preferences/src/xslt/XConfiguration/XConfiguration-console.xsl [new file with mode: 0644]
scilab/modules/preferences/src/xslt/XConfiguration/XConfiguration-font.xsl [new file with mode: 0644]
scilab/modules/preferences/src/xslt/XConfiguration/XConfiguration-general.xsl [new file with mode: 0644]
scilab/modules/preferences/src/xslt/XConfiguration/XConfiguration-history.xsl [new file with mode: 0644]
scilab/modules/preferences/src/xslt/XConfiguration/XConfiguration-scinotes.xsl [new file with mode: 0644]
scilab/modules/preferences/src/xslt/XConfiguration/XConfiguration-toolbars.xsl [new file with mode: 0644]
scilab/modules/preferences/src/xslt/XConfiguration/XConfiguration-variables.xsl [new file with mode: 0644]
scilab/modules/preferences/src/xslt/XConfiguration/XConfiguration-xcos.xsl [new file with mode: 0644]
scilab/modules/preferences/src/xslt/XGeneric.xsl [new file with mode: 0644]
scilab/modules/preferences/src/xslt/XWizard.xsl [new file with mode: 0644]
scilab/modules/preferences/src/xslt/XWizard/XWizard-any.xsl [new file with mode: 0644]
scilab/modules/preferences/src/xslt/XWizard/XWizard-expression.xsl [new file with mode: 0644]
scilab/modules/preferences/src/xslt/XWizard/XWizard-function.xsl [new file with mode: 0644]
scilab/modules/preferences/src/xslt/XWizard/XWizard-xcos.xsl [new file with mode: 0644]
scilab/modules/scinotes/src/java/org/scilab/modules/scinotes/CompoundUndoManager.java
scilab/modules/scinotes/src/java/org/scilab/modules/scinotes/ScilabEditorPane.java
scilab/modules/scinotes/src/java/org/scilab/modules/scinotes/utils/ConfigSciNotesManager.java
scilab/scilab-lib.properties.in
scilab/scilab-lib.properties.vc
scilab/tools/innosetup/code_modules.iss
scilab/tools/innosetup/files.iss

index e34e9ec..99dd933 100644 (file)
@@ -701,6 +701,18 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xml", "modules\xml\xml.vcxp
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "types", "modules\types\types.vcxproj", "{626B9142-13A1-4765-A072-FB08952E7BB8}"
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "preferences", "modules\preferences\src\c\preferences.vcxproj", "{7B893E9F-D032-44DE-9B71-197A29C4989B}"
+       ProjectSection(ProjectDependencies) = postProject
+               {43B095CB-B86C-44CB-BCE8-87FE8E7D2A0E} = {43B095CB-B86C-44CB-BCE8-87FE8E7D2A0E}
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "preferences-Ant", "modules\preferences\src\java\preferences-JAVA.vcxproj", "{32352BC0-9D50-4479-8B77-698287CCB8DE}"
+       ProjectSection(ProjectDependencies) = postProject
+               {FBA3BC3F-8A2C-4D47-A50D-EB808BE42F43} = {FBA3BC3F-8A2C-4D47-A50D-EB808BE42F43}
+               {9188FA91-E039-485D-AF1D-781CEA92F541} = {9188FA91-E039-485D-AF1D-781CEA92F541}
+               {E9783492-017E-4811-9CC7-6B71856F847C} = {E9783492-017E-4811-9CC7-6B71856F847C}
+       EndProjectSection
+EndProject
 Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
                Debug|Win32 = Debug|Win32
@@ -1933,6 +1945,22 @@ Global
                {626B9142-13A1-4765-A072-FB08952E7BB8}.Release|Win32.Build.0 = Release|Win32
                {626B9142-13A1-4765-A072-FB08952E7BB8}.Release|x64.ActiveCfg = Release|x64
                {626B9142-13A1-4765-A072-FB08952E7BB8}.Release|x64.Build.0 = Release|x64
+               {7B893E9F-D032-44DE-9B71-197A29C4989B}.Debug|Win32.ActiveCfg = Debug|Win32
+               {7B893E9F-D032-44DE-9B71-197A29C4989B}.Debug|Win32.Build.0 = Debug|Win32
+               {7B893E9F-D032-44DE-9B71-197A29C4989B}.Debug|x64.ActiveCfg = Debug|x64
+               {7B893E9F-D032-44DE-9B71-197A29C4989B}.Debug|x64.Build.0 = Debug|x64
+               {7B893E9F-D032-44DE-9B71-197A29C4989B}.Release|Win32.ActiveCfg = Release|Win32
+               {7B893E9F-D032-44DE-9B71-197A29C4989B}.Release|Win32.Build.0 = Release|Win32
+               {7B893E9F-D032-44DE-9B71-197A29C4989B}.Release|x64.ActiveCfg = Release|x64
+               {7B893E9F-D032-44DE-9B71-197A29C4989B}.Release|x64.Build.0 = Release|x64
+               {32352BC0-9D50-4479-8B77-698287CCB8DE}.Debug|Win32.ActiveCfg = Debug|Win32
+               {32352BC0-9D50-4479-8B77-698287CCB8DE}.Debug|Win32.Build.0 = Debug|Win32
+               {32352BC0-9D50-4479-8B77-698287CCB8DE}.Debug|x64.ActiveCfg = Debug|x64
+               {32352BC0-9D50-4479-8B77-698287CCB8DE}.Debug|x64.Build.0 = Debug|x64
+               {32352BC0-9D50-4479-8B77-698287CCB8DE}.Release|Win32.ActiveCfg = Release|Win32
+               {32352BC0-9D50-4479-8B77-698287CCB8DE}.Release|Win32.Build.0 = Release|Win32
+               {32352BC0-9D50-4479-8B77-698287CCB8DE}.Release|x64.ActiveCfg = Release|x64
+               {32352BC0-9D50-4479-8B77-698287CCB8DE}.Release|x64.Build.0 = Release|x64
        EndGlobalSection
        GlobalSection(SolutionProperties) = preSolution
                HideSolutionNode = FALSE
index 61f4665..edbafb1 100644 (file)
@@ -699,6 +699,18 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xml", "modules\xml\xml.vcxp
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "types", "modules\types\types.vcxproj", "{626B9142-13A1-4765-A072-FB08952E7BB8}"
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "preferences", "modules\preferences\src\c\preferences.vcxproj", "{7B893E9F-D032-44DE-9B71-197A29C4989B}"
+       ProjectSection(ProjectDependencies) = postProject
+               {43B095CB-B86C-44CB-BCE8-87FE8E7D2A0E} = {43B095CB-B86C-44CB-BCE8-87FE8E7D2A0E}
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "preferences-Ant", "modules\preferences\src\java\preferences-JAVA.vcxproj", "{32352BC0-9D50-4479-8B77-698287CCB8DE}"
+       ProjectSection(ProjectDependencies) = postProject
+               {FBA3BC3F-8A2C-4D47-A50D-EB808BE42F43} = {FBA3BC3F-8A2C-4D47-A50D-EB808BE42F43}
+               {9188FA91-E039-485D-AF1D-781CEA92F541} = {9188FA91-E039-485D-AF1D-781CEA92F541}
+               {E9783492-017E-4811-9CC7-6B71856F847C} = {E9783492-017E-4811-9CC7-6B71856F847C}
+       EndProjectSection
+EndProject
 Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
                Debug|Win32 = Debug|Win32
@@ -1923,6 +1935,22 @@ Global
                {626B9142-13A1-4765-A072-FB08952E7BB8}.Release|Win32.Build.0 = Release|Win32
                {626B9142-13A1-4765-A072-FB08952E7BB8}.Release|x64.ActiveCfg = Release|x64
                {626B9142-13A1-4765-A072-FB08952E7BB8}.Release|x64.Build.0 = Release|x64
+               {7B893E9F-D032-44DE-9B71-197A29C4989B}.Debug|Win32.ActiveCfg = Debug|Win32
+               {7B893E9F-D032-44DE-9B71-197A29C4989B}.Debug|Win32.Build.0 = Debug|Win32
+               {7B893E9F-D032-44DE-9B71-197A29C4989B}.Debug|x64.ActiveCfg = Debug|x64
+               {7B893E9F-D032-44DE-9B71-197A29C4989B}.Debug|x64.Build.0 = Debug|x64
+               {7B893E9F-D032-44DE-9B71-197A29C4989B}.Release|Win32.ActiveCfg = Release|Win32
+               {7B893E9F-D032-44DE-9B71-197A29C4989B}.Release|Win32.Build.0 = Release|Win32
+               {7B893E9F-D032-44DE-9B71-197A29C4989B}.Release|x64.ActiveCfg = Release|x64
+               {7B893E9F-D032-44DE-9B71-197A29C4989B}.Release|x64.Build.0 = Release|x64
+               {32352BC0-9D50-4479-8B77-698287CCB8DE}.Debug|Win32.ActiveCfg = Debug|Win32
+               {32352BC0-9D50-4479-8B77-698287CCB8DE}.Debug|Win32.Build.0 = Debug|Win32
+               {32352BC0-9D50-4479-8B77-698287CCB8DE}.Debug|x64.ActiveCfg = Debug|x64
+               {32352BC0-9D50-4479-8B77-698287CCB8DE}.Debug|x64.Build.0 = Debug|x64
+               {32352BC0-9D50-4479-8B77-698287CCB8DE}.Release|Win32.ActiveCfg = Release|Win32
+               {32352BC0-9D50-4479-8B77-698287CCB8DE}.Release|Win32.Build.0 = Release|Win32
+               {32352BC0-9D50-4479-8B77-698287CCB8DE}.Release|x64.ActiveCfg = Release|x64
+               {32352BC0-9D50-4479-8B77-698287CCB8DE}.Release|x64.Build.0 = Release|x64
        EndGlobalSection
        GlobalSection(SolutionProperties) = preSolution
                HideSolutionNode = FALSE
index d66dd00..6c9bf75 100644 (file)
@@ -1 +1 @@
-SCIVERSION=Scilab-Branch-master-GIT
+SCIVERSION=Scilab-Branch-preferences-GIT
index d0c6244..8f690dc 100644 (file)
@@ -90,6 +90,7 @@ cd $(SolutionDir)modules\ui_data && call ant
 cd $(SolutionDir)modules\history_browser && call ant
 cd $(SolutionDir)modules\javasci && call ant
 cd $(SolutionDir)modules\scinotes && call ant
+cd $(SolutionDir)modules\preferences && call ant
 
 </NMakeBuildCommandLine>
     <NMakeReBuildCommandLine>set JAVA_HOME=$(SolutionDir)java\jdk
@@ -114,29 +115,31 @@ cd $(SolutionDir)modules\ui_data &amp;&amp; call ant clean &amp;&amp; call ant
 cd $(SolutionDir)modules\history_browser &amp;&amp; call ant clean &amp;&amp; call ant
 cd $(SolutionDir)modules\javasci &amp;&amp; call ant clean &amp;&amp; call ant
 cd $(SolutionDir)modules\scinotes &amp;&amp; call ant clean &amp;&amp; call ant
+cd $(SolutionDir)modules\preferences &amp;&amp; call ant clean &amp;&amp; call ant
 </NMakeReBuildCommandLine>
     <NMakeCleanCommandLine>set JAVA_HOME=$(SolutionDir)java\jdk
 set PATH=$(SolutionDir)java\ant\bin;%PATH%;
-cd $(SolutionDir)modules\localization  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\commons  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\jvm  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\renderer  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\history_manager  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\completion  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\action_binding  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\console  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\graphic_export  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\types  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\gui  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\core  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\hdf5  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\graph  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\helptools  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\xcos  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\ui_data  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\history_browser  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\javasci  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\scinotes  &amp;&amp; call ant clean
+cd $(SolutionDir)modules\localization &amp;&amp; call ant clean
+cd $(SolutionDir)modules\commons &amp;&amp; call ant clean
+cd $(SolutionDir)modules\jvm &amp;&amp; call ant clean
+cd $(SolutionDir)modules\renderer &amp;&amp; call ant clean
+cd $(SolutionDir)modules\history_manager &amp;&amp; call ant clean
+cd $(SolutionDir)modules\completion &amp;&amp; call ant clean
+cd $(SolutionDir)modules\action_binding &amp;&amp; call ant clean
+cd $(SolutionDir)modules\console &amp;&amp; call ant clean
+cd $(SolutionDir)modules\graphic_export &amp;&amp; call ant clean
+cd $(SolutionDir)modules\types &amp;&amp; call ant clean
+cd $(SolutionDir)modules\gui &amp;&amp; call ant clean
+cd $(SolutionDir)modules\core &amp;&amp; call ant clean
+cd $(SolutionDir)modules\hdf5 &amp;&amp; call ant clean
+cd $(SolutionDir)modules\graph &amp;&amp; call ant clean
+cd $(SolutionDir)modules\helptools &amp;&amp; call ant clean
+cd $(SolutionDir)modules\xcos &amp;&amp; call ant clean
+cd $(SolutionDir)modules\ui_data &amp;&amp; call ant clean
+cd $(SolutionDir)modules\history_browser &amp;&amp; call ant clean
+cd $(SolutionDir)modules\javasci &amp;&amp; call ant clean
+cd $(SolutionDir)modules\scinotes &amp;&amp; call ant clean
+cd $(SolutionDir)modules\preferences &amp;&amp; call ant clean
 
 </NMakeCleanCommandLine>
     <NMakeOutput>
@@ -166,6 +169,7 @@ cd $(SolutionDir)modules\ui_data &amp;&amp; call ant
 cd $(SolutionDir)modules\history_browser &amp;&amp; call ant
 cd $(SolutionDir)modules\javasci &amp;&amp; call ant
 cd $(SolutionDir)modules\scinotes &amp;&amp; call ant
+cd $(SolutionDir)modules\preferences &amp;&amp; call ant
 
 </NMakeBuildCommandLine>
     <NMakeReBuildCommandLine>set JAVA_HOME=$(SolutionDir)java\jdk
@@ -190,29 +194,31 @@ cd $(SolutionDir)modules\ui_data &amp;&amp; call ant clean &amp;&amp; call ant
 cd $(SolutionDir)modules\history_browser &amp;&amp; call ant clean &amp;&amp; call ant
 cd $(SolutionDir)modules\javasci &amp;&amp; call ant clean &amp;&amp; call ant
 cd $(SolutionDir)modules\scinotes &amp;&amp; call ant clean &amp;&amp; call ant
+cd $(SolutionDir)modules\preferences &amp;&amp; call ant clean &amp;&amp; call ant
 </NMakeReBuildCommandLine>
     <NMakeCleanCommandLine>set JAVA_HOME=$(SolutionDir)java\jdk
 set PATH=$(SolutionDir)java\ant\bin;%PATH%;
-cd $(SolutionDir)modules\localization  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\commons  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\jvm  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\renderer  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\history_manager  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\completion  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\action_binding  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\console  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\graphic_export  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\types  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\gui  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\core  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\hdf5  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\graph  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\helptools  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\xcos  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\ui_data  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\history_browser  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\javasci  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\scinotes  &amp;&amp; call ant clean
+cd $(SolutionDir)modules\localization &amp;&amp; call ant clean
+cd $(SolutionDir)modules\commons &amp;&amp; call ant clean
+cd $(SolutionDir)modules\jvm &amp;&amp; call ant clean
+cd $(SolutionDir)modules\renderer &amp;&amp; call ant clean
+cd $(SolutionDir)modules\history_manager &amp;&amp; call ant clean
+cd $(SolutionDir)modules\completion &amp;&amp; call ant clean
+cd $(SolutionDir)modules\action_binding &amp;&amp; call ant clean
+cd $(SolutionDir)modules\console &amp;&amp; call ant clean
+cd $(SolutionDir)modules\graphic_export &amp;&amp; call ant clean
+cd $(SolutionDir)modules\types &amp;&amp; call ant clean
+cd $(SolutionDir)modules\gui &amp;&amp; call ant clean
+cd $(SolutionDir)modules\core &amp;&amp; call ant clean
+cd $(SolutionDir)modules\hdf5 &amp;&amp; call ant clean
+cd $(SolutionDir)modules\graph &amp;&amp; call ant clean
+cd $(SolutionDir)modules\helptools &amp;&amp; call ant clean
+cd $(SolutionDir)modules\xcos &amp;&amp; call ant clean
+cd $(SolutionDir)modules\ui_data &amp;&amp; call ant clean
+cd $(SolutionDir)modules\history_browser &amp;&amp; call ant clean
+cd $(SolutionDir)modules\javasci &amp;&amp; call ant clean
+cd $(SolutionDir)modules\scinotes &amp;&amp; call ant clean
+cd $(SolutionDir)modules\preferences &amp;&amp; call ant clean
 
 </NMakeCleanCommandLine>
     <NMakeOutput>
@@ -242,6 +248,7 @@ cd $(SolutionDir)modules\ui_data &amp;&amp; call ant
 cd $(SolutionDir)modules\history_browser &amp;&amp; call ant
 cd $(SolutionDir)modules\javasci &amp;&amp; call ant
 cd $(SolutionDir)modules\scinotes &amp;&amp; call ant
+cd $(SolutionDir)modules\preferences &amp;&amp; call ant
 
 </NMakeBuildCommandLine>
     <NMakeReBuildCommandLine>set JAVA_HOME=$(SolutionDir)java\jdk
@@ -266,29 +273,31 @@ cd $(SolutionDir)modules\ui_data &amp;&amp; call ant clean &amp;&amp; call ant
 cd $(SolutionDir)modules\history_browser &amp;&amp; call ant clean &amp;&amp; call ant
 cd $(SolutionDir)modules\javasci &amp;&amp; call ant clean &amp;&amp; call ant
 cd $(SolutionDir)modules\scinotes &amp;&amp; call ant clean &amp;&amp; call ant
+cd $(SolutionDir)modules\preferences &amp;&amp; call ant clean &amp;&amp; call ant
 </NMakeReBuildCommandLine>
     <NMakeCleanCommandLine>set JAVA_HOME=$(SolutionDir)java\jdk
 set PATH=$(SolutionDir)java\ant\bin;%PATH%;
-cd $(SolutionDir)modules\localization  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\commons  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\jvm  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\renderer  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\history_manager  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\completion  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\action_binding  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\console  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\graphic_export  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\types  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\gui  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\core  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\hdf5  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\graph  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\helptools  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\xcos  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\ui_data  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\history_browser  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\javasci  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\scinotes  &amp;&amp; call ant clean
+cd $(SolutionDir)modules\localization &amp;&amp; call ant clean
+cd $(SolutionDir)modules\commons &amp;&amp; call ant clean
+cd $(SolutionDir)modules\jvm &amp;&amp; call ant clean
+cd $(SolutionDir)modules\renderer &amp;&amp; call ant clean
+cd $(SolutionDir)modules\history_manager &amp;&amp; call ant clean
+cd $(SolutionDir)modules\completion &amp;&amp; call ant clean
+cd $(SolutionDir)modules\action_binding &amp;&amp; call ant clean
+cd $(SolutionDir)modules\console &amp;&amp; call ant clean
+cd $(SolutionDir)modules\graphic_export &amp;&amp; call ant clean
+cd $(SolutionDir)modules\types &amp;&amp; call ant clean
+cd $(SolutionDir)modules\gui &amp;&amp; call ant clean
+cd $(SolutionDir)modules\core &amp;&amp; call ant clean
+cd $(SolutionDir)modules\hdf5 &amp;&amp; call ant clean
+cd $(SolutionDir)modules\graph &amp;&amp; call ant clean
+cd $(SolutionDir)modules\helptools &amp;&amp; call ant clean
+cd $(SolutionDir)modules\xcos &amp;&amp; call ant clean
+cd $(SolutionDir)modules\ui_data &amp;&amp; call ant clean
+cd $(SolutionDir)modules\history_browser &amp;&amp; call ant clean
+cd $(SolutionDir)modules\javasci &amp;&amp; call ant clean
+cd $(SolutionDir)modules\scinotes &amp;&amp; call ant clean
+cd $(SolutionDir)modules\preferences &amp;&amp; call ant clean
 
 </NMakeCleanCommandLine>
     <NMakeOutput>
@@ -318,6 +327,7 @@ cd $(SolutionDir)modules\ui_data &amp;&amp; call ant
 cd $(SolutionDir)modules\history_browser &amp;&amp; call ant
 cd $(SolutionDir)modules\javasci &amp;&amp; call ant
 cd $(SolutionDir)modules\scinotes &amp;&amp; call ant
+cd $(SolutionDir)modules\preferences &amp;&amp; call ant
 
 </NMakeBuildCommandLine>
     <NMakeReBuildCommandLine>set JAVA_HOME=$(SolutionDir)java\jdk
@@ -342,29 +352,31 @@ cd $(SolutionDir)modules\ui_data &amp;&amp; call ant clean &amp;&amp; call ant
 cd $(SolutionDir)modules\history_browser &amp;&amp; call ant clean &amp;&amp; call ant
 cd $(SolutionDir)modules\javasci &amp;&amp; call ant clean &amp;&amp; call ant
 cd $(SolutionDir)modules\scinotes &amp;&amp; call ant clean &amp;&amp; call ant
+cd $(SolutionDir)modules\preferences &amp;&amp; call ant clean &amp;&amp; call ant
 </NMakeReBuildCommandLine>
     <NMakeCleanCommandLine>set JAVA_HOME=$(SolutionDir)java\jdk
 set PATH=$(SolutionDir)java\ant\bin;%PATH%;
-cd $(SolutionDir)modules\localization  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\commons  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\jvm  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\renderer  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\history_manager  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\completion  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\action_binding  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\console  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\graphic_export  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\types  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\gui  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\core  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\hdf5  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\graph  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\helptools  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\xcos  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\ui_data  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\history_browser  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\javasci  &amp;&amp; call ant clean
-cd $(SolutionDir)modules\scinotes  &amp;&amp; call ant clean
+cd $(SolutionDir)modules\localization &amp;&amp; call ant clean
+cd $(SolutionDir)modules\commons &amp;&amp; call ant clean
+cd $(SolutionDir)modules\jvm &amp;&amp; call ant clean
+cd $(SolutionDir)modules\renderer &amp;&amp; call ant clean
+cd $(SolutionDir)modules\history_manager &amp;&amp; call ant clean
+cd $(SolutionDir)modules\completion &amp;&amp; call ant clean
+cd $(SolutionDir)modules\action_binding &amp;&amp; call ant clean
+cd $(SolutionDir)modules\console &amp;&amp; call ant clean
+cd $(SolutionDir)modules\graphic_export &amp;&amp; call ant clean
+cd $(SolutionDir)modules\types &amp;&amp; call ant clean
+cd $(SolutionDir)modules\gui &amp;&amp; call ant clean
+cd $(SolutionDir)modules\core &amp;&amp; call ant clean
+cd $(SolutionDir)modules\hdf5 &amp;&amp; call ant clean
+cd $(SolutionDir)modules\graph &amp;&amp; call ant clean
+cd $(SolutionDir)modules\helptools &amp;&amp; call ant clean
+cd $(SolutionDir)modules\xcos &amp;&amp; call ant clean
+cd $(SolutionDir)modules\ui_data &amp;&amp; call ant clean
+cd $(SolutionDir)modules\history_browser &amp;&amp; call ant clean
+cd $(SolutionDir)modules\javasci &amp;&amp; call ant clean
+cd $(SolutionDir)modules\scinotes &amp;&amp; call ant clean
+cd $(SolutionDir)modules\preferences &amp;&amp; call ant clean
 
 </NMakeCleanCommandLine>
     <NMakeOutput>
index 445cce3..95fab95 100644 (file)
@@ -65,6 +65,7 @@
     <pathelement location="${library.renderer.dir}/${library.renderer.name}"/>
     <pathelement location="${library.graphic_export.dir}/${library.graphic_export.name}"/>
     <pathelement location="${library.core.dir}/${library.core.name}"/>
+    <pathelement location="${library.preferences.dir}/${library.preferences.name}"/>
     <!-- Not use at build time but used for unitary tests -->
     <pathelement location="${library.javasci.dir}/${library.javasci.name}"/>
     <pathelement location="${library.javasci.dir}/${library.javasci-v1.name}"/>
index 9904e22..1c79eb4 100644 (file)
@@ -1832,6 +1832,7 @@ modules/graph/Makefile
 modules/parallel/Makefile
 modules/modules_manager/Makefile
 modules/history_browser/Makefile
+modules/preferences/Makefile
 modules/xml/Makefile
 modules/Makefile
 libs/Makefile
index 19b8a25..615d458 100644 (file)
@@ -1,3 +1,10 @@
 // This file is released under the 3-clause BSD license. See COPYING-BSD.
 
 // Some specific hooks can be specify here when the module is unloaded.
+
+etc_tlbx  = get_absolute_file_path("toolbox_skeleton.quit");   
+etc_tlbx  = getshortpathname(etc_tlbx);
+root_tlbx = strncpy( etc_tlbx, length(etc_tlbx)-length("\etc\") );
+removeToolboxInfos(root_tlbx);
+
+clear etc_tlbx root_tlbx
index ec51d7c..527087e 100644 (file)
@@ -50,6 +50,8 @@ function toolbox_skeletonlib = startModule()
     add_demo(toolbox_name, pathdemos);
   end
 
+  addToolboxInfos(toolbox_name, root_tlbx, etc_tlbx + "toolbox_skeleton_preferences.xml");
+
 endfunction
 
 toolbox_skeletonlib = startModule();
diff --git a/scilab/contrib/toolbox_skeleton/etc/toolbox_skeleton_preferences.xml b/scilab/contrib/toolbox_skeleton/etc/toolbox_skeleton_preferences.xml
new file mode 100644 (file)
index 0000000..0cf4a38
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<body>
+  <Form text="Rectangle">
+    <Entry text="intitulé" value="exemple"/>
+    <Select text="Hauteur" value="18">
+      <Option value="12"/>
+      <Option value="18"/>
+      <Option value="24"/>
+    </Select>
+    <Select text="Largeur" value="18">
+      <Option value="12"/>
+      <Option value="18"/>
+      <Option value="24"/>
+    </Select>
+    <Color text="Couleur" value="#0000ff"/>
+    <Checkbox text="Contour" value="yes"/>
+  </Form>
+</body>
diff --git a/scilab/contrib/toolbox_skeleton/etc/toolbox_skeleton_preferences.xsl b/scilab/contrib/toolbox_skeleton/etc/toolbox_skeleton_preferences.xsl
new file mode 100644 (file)
index 0000000..70f1cf0
--- /dev/null
@@ -0,0 +1,39 @@
+<?xml version='1.0' encoding='utf-8'?>
+<xsl:stylesheet version ="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+  <xsl:import href="XCommon.xsl"/>
+
+  <xsl:template match="environment" mode="tooltip">Environment</xsl:template>
+  <xsl:template match="environment">
+    <VSpace height="25"/>
+    <Title text="Environment">
+      <HBox>
+        Foo:
+        <xsl:call-template name="Select">
+          <xsl:with-param name="among">
+            <option foo="bar"/>
+            <option foo="barbar"/>
+            <option foo="barbarbar"/>
+          </xsl:with-param>
+        </xsl:call-template>
+      </HBox>
+    </Title>
+  </xsl:template>
+
+  <xsl:template match="save">
+    <VSpace height="25"/>
+    <Title text="Save">
+      <HBox>
+        <Checkbox listener="ActionListener">
+          <xsl:if test="@bar='true'">
+            <xsl:attribute name="checked">checked</xsl:attribute>
+          </xsl:if>
+          <actionPerformed set="bar" value="true">
+            <xsl:call-template name="context"/>
+          </actionPerformed>
+        </Checkbox>
+        Save:
+      </HBox>
+    </Title>
+  </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
index cdcada7..d968842 100644 (file)
@@ -160,6 +160,8 @@ The option is "disableUnderMode" and can be:
 <path value="$SCILAB/modules/gui/etc"/> <!-- Scilab Flexdock theme -->
 <path value="$SCILAB/modules/gui/images/icons/"/> <!-- Scilab Flexdock icons -->
 
+<path value="$SCILAB/modules/preferences/jar/org.scilab.modules.preferences.jar"/>
+
 <path value="$SCILAB/modules/renderer/jar/org.scilab.modules.renderer.jar"/>
 
 <path value="$SCILAB/modules/graphic_export/jar/org.scilab.modules.graphic_export.jar"/>
index 7e86745..216156e 100644 (file)
@@ -160,6 +160,8 @@ The option is "disableUnderMode" and can be:
 <path value="$SCILAB/modules/gui/etc"/> <!-- Scilab Flexdock theme -->
 <path value="$SCILAB/modules/gui/images/icons/"/> <!-- Scilab Flexdock icons -->
 
+<path value="$SCILAB/modules/preferences/jar/org.scilab.modules.preferences.jar"/>
+
 <path value="$SCILAB/modules/renderer/jar/org.scilab.modules.renderer.jar"/>
 
 <path value="$SCILAB/modules/graphic_export/jar/org.scilab.modules.graphic_export.jar"/>
index dabbd9c..ba3dd31 100644 (file)
@@ -85,6 +85,7 @@
 <module name="parallel" activate="yes"/>
 <module name="modules_manager" activate="yes"/>
 <module name="history_browser" activate="@JAVA_ENABLE@"/>
+<module name="preferences" activate="@GUI_ENABLE@"/>
 <module name="xml" activate="yes"/>
 </modules>
 
index f31cf02..21ed503 100644 (file)
@@ -87,6 +87,7 @@
 <module name="parallel" activate="yes"/>
 <module name="modules_manager" activate="yes"/>
 <module name="history_browser" activate="yes"/>
+<module name="preferences" activate="yes"/>
 <module name="xml" activate="yes"/>
 <!-- comments -->
 </modules>
index 7cb38d6..a580829 100644 (file)
@@ -156,6 +156,5 @@ if getscilabmode() == "STD" then
   setmenu(gettext("&Toolboxes"));
   toolbar(-1, "on");
 end
-
 // ====================================================================
 clear ans
index 0374a62..d41665c 100644 (file)
@@ -18,8 +18,6 @@
 /* an interesting article about HeapAlloc,malloc, and OctAlloc */
 /* bench show that HeapAlloc is faster than malloc on Windows */
 /* http://denisbider.blogspot.com/2007/10/heap-allocation-on-multi-core-systems.html */
-/* With VS 2010, we no more need to use heap, standard malloc is enough fast and compatible */
-/* since malloc of VC runtime uses heapAlloc in internal */
 /*-----------------------------------------------------------------------------------*/
 #define FREE_FLAGS 0
 /*-----------------------------------------------------------------------------------*/
@@ -32,7 +30,7 @@ IMPORT_EXPORT_MALLOC_DLL LPVOID MyHeapRealloc(LPVOID lpAddress,SIZE_T dwSize,cha
        {
                _try
                {
-                       NewPointer = realloc(lpAddress, dwSize);
+                       NewPointer = HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,lpAddress,dwSize);
                }
                _except (EXCEPTION_EXECUTE_HANDLER)
                {
@@ -40,8 +38,7 @@ IMPORT_EXPORT_MALLOC_DLL LPVOID MyHeapRealloc(LPVOID lpAddress,SIZE_T dwSize,cha
        }
        else
        {
-               NewPointer = malloc(dwSize);
-        NewPointer = memset (NewPointer, 0, dwSize);
+               NewPointer = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,dwSize);
 
                if (NewPointer == NULL)
                {
@@ -63,8 +60,7 @@ IMPORT_EXPORT_MALLOC_DLL LPVOID MyHeapAlloc(SIZE_T dwSize,char *fichier,int lign
        {
                _try
                {
-                       NewPointer = malloc(dwSize);
-            NewPointer = memset (NewPointer, 0, dwSize);
+                       NewPointer = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,dwSize);
                }
                _except (EXCEPTION_EXECUTE_HANDLER)
                {
@@ -88,8 +84,7 @@ IMPORT_EXPORT_MALLOC_DLL LPVOID MyHeapAlloc(SIZE_T dwSize,char *fichier,int lign
                #endif
                _try
                {
-            NewPointer = malloc(dwSize);
-            NewPointer = memset (NewPointer, 0, dwSize);
+                       NewPointer = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,dwSize);
                }
                _except (EXCEPTION_EXECUTE_HANDLER)
                {
@@ -102,7 +97,7 @@ IMPORT_EXPORT_MALLOC_DLL void MyHeapFree(LPVOID lpAddress,char *fichier,int lign
 {
        _try
        {
-        free(lpAddress);
+               HeapFree(GetProcessHeap(),FREE_FLAGS,lpAddress);
        }
        _except (EXCEPTION_EXECUTE_HANDLER)
        {
@@ -116,24 +111,23 @@ IMPORT_EXPORT_MALLOC_DLL void MyHeapFree(LPVOID lpAddress,char *fichier,int lign
 /*-----------------------------------------------------------------------------------*/
 IMPORT_EXPORT_MALLOC_DLL LPVOID MyVirtualAlloc(SIZE_T dwSize,char *fichier,int ligne)
 {
-       LPVOID NewPointer = NULL;
+       LPVOID NewPointer=NULL;
 
        if (dwSize>0)
        {
                _try
                {
-            NewPointer = malloc(dwSize);
-            NewPointer = memset (NewPointer, 0, dwSize);
+                       NewPointer = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,dwSize);
                }
                _except (EXCEPTION_EXECUTE_HANDLER)
                {
                }
 
-               if (NewPointer == NULL)
+               if (NewPointer==NULL)
                {
                        #ifdef _DEBUG
                        char MsgError[1024];
-                       wsprintf(MsgError,"MALLOC ( 1) Error File %s Line %d ",fichier,ligne);
+                       wsprintf(MsgError,"MALLOC (VirtualAlloc 1) Error File %s Line %d ",fichier,ligne);
                        MessageBox(NULL,MsgError,"Error",MB_ICONSTOP | MB_OK);
                        #endif
                }
@@ -142,14 +136,13 @@ IMPORT_EXPORT_MALLOC_DLL LPVOID MyVirtualAlloc(SIZE_T dwSize,char *fichier,int l
        {
                #ifdef _DEBUG
                char MsgError[1024];
-               wsprintf(MsgError,"MALLOC (2) Error File %s Line %d ",fichier,ligne);
+               wsprintf(MsgError,"MALLOC (VirtualAlloc 2) Error File %s Line %d ",fichier,ligne);
                MessageBox(NULL,MsgError,"Error",MB_ICONSTOP | MB_OK);
                #endif
 
                _try
                {
-            NewPointer = malloc(dwSize);
-            NewPointer = memset (NewPointer, 0, dwSize);
+                       NewPointer = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,dwSize);
                }
                _except (EXCEPTION_EXECUTE_HANDLER)
                {
@@ -166,7 +159,7 @@ IMPORT_EXPORT_MALLOC_DLL void MyVirtualFree(LPVOID lpAddress,char *fichier,int l
        {
                _try
                {
-            free(lpAddress);
+                       HeapFree(GetProcessHeap(),FREE_FLAGS,lpAddress);
                }
                _except (EXCEPTION_EXECUTE_HANDLER)
                {
@@ -174,3 +167,4 @@ IMPORT_EXPORT_MALLOC_DLL void MyVirtualFree(LPVOID lpAddress,char *fichier,int l
        }
 }
 /*-----------------------------------------------------------------------------------*/
+
index 009c630..ef0787b 100644 (file)
@@ -85,6 +85,7 @@ parallel \
 modules_manager \
 ui_data \
 history_browser \
+preferences \
 xml \
 libscilab-cli \
 types
@@ -205,8 +206,9 @@ ENGINE_LIBS_DYNAMIC_LOAD = \
        $(top_builddir)/modules/umfpack/libsciumfpack.la \
        $(top_builddir)/modules/matio/libscimatio.la \
        $(top_builddir)/modules/helptools/libscihelptools.la \
-       $(top_builddir)/modules/xml/libscixml.la \
-       $(top_builddir)/modules/parallel/libsciparallel.la
+        $(top_builddir)/modules/xml/libscixml.la \
+       $(top_builddir)/modules/parallel/libsciparallel.la \
+       $(top_builddir)/modules/preferences/libscipreferences.la
 
 
 # Core modules
index bfc51a3..336e60d 100644 (file)
@@ -158,8 +158,8 @@ DIST_SUBDIRS = prebuildjava fileio mexlib functions parameters boolean \
        overloading m2sci development_tools compatibility_functions \
        helptools umfpack demo_tools genetic_algorithms \
        simulated_annealing matio atoms graph xcos scinotes parallel \
-       modules_manager ui_data history_browser xml libscilab-cli \
-       types scicos_blocks scicos . javasci
+       modules_manager ui_data history_browser preferences xml \
+       libscilab-cli types scicos_blocks scicos . javasci
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -220,6 +220,7 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEMOTOOLS_ENABLE = @DEMOTOOLS_ENABLE@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
 DOCBOOK_ROOT = @DOCBOOK_ROOT@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
@@ -299,6 +300,7 @@ LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MATIO_CFLAGS = @MATIO_CFLAGS@
 MATIO_ENABLE = @MATIO_ENABLE@
 MATIO_LIBS = @MATIO_LIBS@
@@ -387,6 +389,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
@@ -449,8 +452,9 @@ SUBDIRS = prebuildjava fileio mexlib functions parameters boolean \
        overloading m2sci development_tools compatibility_functions \
        helptools umfpack demo_tools genetic_algorithms \
        simulated_annealing matio atoms hdf5 graph xcos scinotes \
-       parallel modules_manager ui_data history_browser xml \
-       libscilab-cli types $(am__append_1) scicos . $(am__append_2)
+       parallel modules_manager ui_data history_browser preferences \
+       xml libscilab-cli types $(am__append_1) scicos . \
+       $(am__append_2)
 
 #### Basic files ####
 libscilab_la_rootdir = $(mydatadir)
@@ -543,8 +547,9 @@ ENGINE_LIBS_DYNAMIC_LOAD = \
        $(top_builddir)/modules/umfpack/libsciumfpack.la \
        $(top_builddir)/modules/matio/libscimatio.la \
        $(top_builddir)/modules/helptools/libscihelptools.la \
-       $(top_builddir)/modules/xml/libscixml.la \
-       $(top_builddir)/modules/parallel/libsciparallel.la
+        $(top_builddir)/modules/xml/libscixml.la \
+       $(top_builddir)/modules/parallel/libsciparallel.la \
+       $(top_builddir)/modules/preferences/libscipreferences.la
 
 
 # Core modules
index a604df2..421e921 100644 (file)
@@ -90,6 +90,7 @@
 /* 66 */                        #include "dynamic_parallel.h" /* parallel */
 /* 67 */                        #include "dynamic_gateways.h" /* ui_data */
 /* 68 */                        #include "dynamic_gateways.h" /* xml */
+/* 69 */                        #include "dynamic_gateways.h" /* preferences */
 
 
 
index 61214f8..799617b 100644 (file)
@@ -15,7 +15,7 @@
 #define SCI_VERSION_MAJOR @SCILAB_VERSION_MAJOR@
 #define SCI_VERSION_MINOR @SCILAB_VERSION_MINOR@
 #define SCI_VERSION_MAINTENANCE @SCILAB_VERSION_MAINTENANCE@
-#define SCI_VERSION_STRING "scilab-branch-master"
+#define SCI_VERSION_STRING "scilab-branch-preferences"
 /* SCI_VERSION_REVISION --> hash key commit */
 #define SCI_VERSION_REVISION 0
 #define SCI_VERSION_TIMESTAMP 0
@@ -25,7 +25,7 @@ void disp_scilab_version(void);
 /* for compatibility */
 /* Deprecated */
 #define SCI_VERSION SCI_VERSION_STRING
-#define DEFAULT_SCI_VERSION_MESSAGE "scilab-branch-master"
+#define DEFAULT_SCI_VERSION_MESSAGE "scilab-branch-preferences"
 
 
 #endif
index 88d0cbd..f4c5ebb 100644 (file)
@@ -15,7 +15,7 @@
 #define SCI_VERSION_MAJOR 5
 #define SCI_VERSION_MINOR 4
 #define SCI_VERSION_MAINTENANCE 0
-#define SCI_VERSION_STRING "scilab-branch-master"
+#define SCI_VERSION_STRING "scilab-branch-preferences"
 /* SCI_VERSION_REVISION --> hash key commit */
 #define SCI_VERSION_REVISION 0
 #define SCI_VERSION_TIMESTAMP 0
@@ -25,7 +25,7 @@ void disp_scilab_version(void);
 /* for compatibility */
 /* Deprecated */
 #define SCI_VERSION SCI_VERSION_STRING
-#define DEFAULT_SCI_VERSION_MESSAGE "scilab-branch-master"
+#define DEFAULT_SCI_VERSION_MESSAGE "scilab-branch-preferences"
 
 
 #endif
index a0697b2..deca6cd 100644 (file)
@@ -34,7 +34,7 @@ jmp_buf jmp_env;
  ** Watch out the positions are crutial !!!
  ** @TODO : Make this less crappy...
  **/
-#define INTERFACES_MAX 68
+#define INTERFACES_MAX 69
 static OpTab Interfaces[INTERFACES_MAX] = {
     /* 01  */ {gw_user}, /* free position may be used */
     /* 02  */ {gw_linear_algebra},
@@ -103,7 +103,9 @@ static OpTab Interfaces[INTERFACES_MAX] = {
     /* 65  */ {gw_dynamic_action_binding},
     /* 66  */ {gw_dynamic_parallel},
     /* 67  */ {gw_dynamic_ui_data},
-    /* 68  */ {gw_dynamic_xml}
+    /* 68  */ {gw_dynamic_xml},
+    /* 69  */ {gw_dynamic_preferences}
+
 };
 /*--------------------------------------------------------------------------*/
 /**
index 0eb9b07..cf17d5d 100644 (file)
@@ -385,6 +385,22 @@ int gw_dynamic_ui_data(void)
         &ptr_gw_ui_data);
 }
 /*--------------------------------------------------------------------------*/
+/* preferences module */
+#define PREFERENCES_MODULE_NAME "preferences"
+static DynLibHandle hPreferencesLib = NULL;
+static PROC_GATEWAY ptr_gw_preferences = NULL;
+static char* dynlibname_preferences = NULL;
+static char* gatewayname_preferences = NULL;
+/*--------------------------------------------------------------------------*/
+int gw_dynamic_preferences(void)
+{
+    return gw_dynamic_generic(PREFERENCES_MODULE_NAME,
+        &dynlibname_preferences,
+        &gatewayname_preferences,
+        &hPreferencesLib,
+        &ptr_gw_preferences);
+}
+/*--------------------------------------------------------------------------*/       
 /* xml module */
 #define XML_MODULE_NAME "xml"
 static DynLibHandle hXmlLib = NULL;
@@ -509,10 +525,16 @@ void freeAllDynamicGateways(void)
         &hUi_dataLib,
         &ptr_gw_ui_data);
 
+    freeDynamicGateway(&dynlibname_preferences,
+        &gatewayname_preferences,
+        &hPreferencesLib,
+        &ptr_gw_preferences);
+
     freeDynamicGateway(&dynlibname_xml,
         &gatewayname_xml,
         &hXmlLib,
         &ptr_gw_xml);
+
 }
 /*--------------------------------------------------------------------------*/
 
index 352f4da..a2a47f9 100644 (file)
@@ -169,6 +169,13 @@ int gw_dynamic_graphic_export(void);
 int gw_dynamic_action_binding(void);
 
 /**
+* preferences gateway
+* preferences is loaded dynamically at runtime
+* load gw_preferences in SCI/modules/preferences/sci_gateway/gw_preferences.c
+*/
+int gw_dynamic_preferences(void);
+
+/**
 * action_binding gateway
 * action_binding is loaded dynamically at runtime
 * load gw_action_binding in SCI/modules/xml/sci_gateway/gw_xml.c
@@ -176,6 +183,7 @@ int gw_dynamic_action_binding(void);
 int gw_dynamic_xml(void);
 
 
+
 #endif /* __DYNAMIC_GATEWAYS_H__ */
 /*--------------------------------------------------------------------------*/
 
index 3da5d1c..d3ae3e3 100644 (file)
     <submenu label="&amp;Select all" accelerator="OSSCKEY A">
       <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.selectAllConsoleContents" type="3"/>
     </submenu>
+    <submenu label="P&amp;references">
+      <callback instruction='org.scilab.modules.preferences.XConfigManager.openPreferences' type="3"/>
+    </submenu>
+    <submenu label="User block W&amp;izard (tmp)">
+      <callback instruction='org.scilab.modules.preferences.XWizardManager.openUserBlockWizard' type="3"/>
+    </submenu>    
   </menu>
   <!-- Preferences menu -->
   <menu label="&amp;Preferences" enabled="false">
     </submenu>
   </menu>
 </menubar>
+
diff --git a/scilab/modules/gui/images/icons/16x16/actions/go-down.png b/scilab/modules/gui/images/icons/16x16/actions/go-down.png
new file mode 100644 (file)
index 0000000..3dd7fcc
Binary files /dev/null and b/scilab/modules/gui/images/icons/16x16/actions/go-down.png differ
diff --git a/scilab/modules/gui/images/icons/16x16/actions/go-first.png b/scilab/modules/gui/images/icons/16x16/actions/go-first.png
new file mode 100644 (file)
index 0000000..9c15c09
Binary files /dev/null and b/scilab/modules/gui/images/icons/16x16/actions/go-first.png differ
diff --git a/scilab/modules/gui/images/icons/16x16/actions/go-jump.png b/scilab/modules/gui/images/icons/16x16/actions/go-jump.png
new file mode 100644 (file)
index 0000000..1d218c3
Binary files /dev/null and b/scilab/modules/gui/images/icons/16x16/actions/go-jump.png differ
diff --git a/scilab/modules/gui/images/icons/16x16/actions/go-last.png b/scilab/modules/gui/images/icons/16x16/actions/go-last.png
new file mode 100644 (file)
index 0000000..6e904ef
Binary files /dev/null and b/scilab/modules/gui/images/icons/16x16/actions/go-last.png differ
diff --git a/scilab/modules/gui/images/icons/16x16/actions/go-up.png b/scilab/modules/gui/images/icons/16x16/actions/go-up.png
new file mode 100644 (file)
index 0000000..fa9a7d7
Binary files /dev/null and b/scilab/modules/gui/images/icons/16x16/actions/go-up.png differ
diff --git a/scilab/modules/gui/images/icons/16x16/actions/media-eject.png b/scilab/modules/gui/images/icons/16x16/actions/media-eject.png
new file mode 100644 (file)
index 0000000..2084067
Binary files /dev/null and b/scilab/modules/gui/images/icons/16x16/actions/media-eject.png differ
diff --git a/scilab/modules/gui/images/icons/16x16/actions/media-playback-pause.png b/scilab/modules/gui/images/icons/16x16/actions/media-playback-pause.png
new file mode 100644 (file)
index 0000000..c8b4fe2
Binary files /dev/null and b/scilab/modules/gui/images/icons/16x16/actions/media-playback-pause.png differ
diff --git a/scilab/modules/gui/images/icons/16x16/actions/media-playback-stop.png b/scilab/modules/gui/images/icons/16x16/actions/media-playback-stop.png
new file mode 100644 (file)
index 0000000..ede2815
Binary files /dev/null and b/scilab/modules/gui/images/icons/16x16/actions/media-playback-stop.png differ
diff --git a/scilab/modules/gui/images/icons/16x16/actions/media-seek-backward.png b/scilab/modules/gui/images/icons/16x16/actions/media-seek-backward.png
new file mode 100644 (file)
index 0000000..ffcac31
Binary files /dev/null and b/scilab/modules/gui/images/icons/16x16/actions/media-seek-backward.png differ
diff --git a/scilab/modules/gui/images/icons/16x16/actions/media-seek-forward.png b/scilab/modules/gui/images/icons/16x16/actions/media-seek-forward.png
new file mode 100644 (file)
index 0000000..4d7e2cd
Binary files /dev/null and b/scilab/modules/gui/images/icons/16x16/actions/media-seek-forward.png differ
diff --git a/scilab/modules/gui/images/icons/16x16/actions/media-skip-backward.png b/scilab/modules/gui/images/icons/16x16/actions/media-skip-backward.png
new file mode 100644 (file)
index 0000000..94381f5
Binary files /dev/null and b/scilab/modules/gui/images/icons/16x16/actions/media-skip-backward.png differ
diff --git a/scilab/modules/gui/images/icons/16x16/actions/media-skip-forward.png b/scilab/modules/gui/images/icons/16x16/actions/media-skip-forward.png
new file mode 100644 (file)
index 0000000..758ec6f
Binary files /dev/null and b/scilab/modules/gui/images/icons/16x16/actions/media-skip-forward.png differ
index d9e2a4b..403794d 100644 (file)
@@ -99,7 +99,7 @@ import org.scilab.modules.gui.tab.Tab;
 import org.scilab.modules.gui.textbox.ScilabTextBox;
 import org.scilab.modules.gui.textbox.TextBox;
 import org.scilab.modules.gui.toolbar.ToolBar;
-import org.scilab.modules.gui.utils.ConfigManager;
+import org.scilab.modules.gui.utils.ConfigManager;// Deprecated by next line
 import org.scilab.modules.gui.utils.ImageExporter;
 import org.scilab.modules.gui.utils.MenuBarBuilder;
 import org.scilab.modules.gui.utils.Position;
@@ -2390,7 +2390,6 @@ public class CallScilabBridge {
      * @return execution status
      */
     public static boolean printString(String theString, String pageHeader) {
-        /* TODO use pageHeader */
         return PrinterHelper.printString(theString, pageHeader);
     }
 
diff --git a/scilab/modules/preferences/Makefile.am b/scilab/modules/preferences/Makefile.am
new file mode 100644 (file)
index 0000000..774a18f
--- /dev/null
@@ -0,0 +1,113 @@
+#
+# Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+# Copyright (C) 2011 - DIGITEO
+#
+# 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-en.txt
+#
+
+#### Target ######
+modulename=preferences
+
+
+#### preferences : Conf files ####
+libscipreferences_la_rootdir = $(mydatadir)
+libscipreferences_la_root_DATA =  license.txt 
+
+
+#### preferences : init scripts & configuration files ####
+libscipreferences_la_etcdir = $(mydatadir)/etc
+libscipreferences_la_etc_DATA = 
+
+include $(top_srcdir)/Makefile.incl.am
+
+
+PREFERENCES_JNI_SOURCES = src/jni/ScilabPreferences.cpp
+
+PREFERENCES_C_SOURCES =
+
+PREFERENCES_CPP_SOURCES =
+
+GIWS_WRAPPERS = src/jni/ScilabPreferences.giws.xml
+
+if GIWS
+    BUILT_SOURCES=giws
+endif
+
+
+GATEWAY_C_SOURCES = sci_gateway/c/gw_preferences.c
+
+GATEWAY_CPP_SOURCES = sci_gateway/cpp/sci_addToolboxInfos.cpp \
+                      sci_gateway/cpp/sci_removeToolboxInfos.cpp
+
+libscipreferences_la_CFLAGS= $(JAVA_JNI_INCLUDE) \
+    -I$(top_srcdir)/libs/MALLOC/includes/ \
+    -I$(top_srcdir)/modules/jvm/includes/ \
+    -I$(top_srcdir)/modules/output_stream/includes \
+    -I$(top_srcdir)/modules/localization/includes \
+    -I$(top_srcdir)/modules/api_scilab/includes \
+    -I$(top_srcdir)/modules/fileio/includes \
+    -I$(top_srcdir)/modules/core/includes \
+    -I$(top_srcdir)/modules/functions/includes
+
+libscipreferences_la_CPPFLAGS = $(JAVA_JNI_INCLUDE) \
+    -I$(srcdir)/includes/ \
+    -I$(srcdir)/src/cpp/ \
+    -I$(srcdir)/src/c/ \
+    -I$(srcdir)/src/jni/ \
+    -I$(top_srcdir)/modules/jvm/includes/ \
+    -I$(top_srcdir)/modules/fileio/includes \
+    -I$(top_srcdir)/modules/output_stream/includes \
+    -I$(top_srcdir)/modules/localization/includes \
+    -I$(top_srcdir)/modules/api_scilab/includes
+
+# Without the preferences module 
+libscipreferences_disable_la_CFLAGS = -Iincludes/ \
+    -I$(top_srcdir)/modules/output_stream/includes
+
+PREFERENCES_DISABLE_C_SOURCES = src/nopreferences/nopreferences.c
+libscipreferences_disable_la_LDFLAGS = -version-number $(SCILAB_LIBRARY_VERSION) $(LD_FLAGS)
+libscipreferences_disable_la_SOURCES = $(PREFERENCES_DISABLE_C_SOURCES)
+
+pkglib_LTLIBRARIES = libscipreferences-disable.la
+
+if GUI
+    pkglib_LTLIBRARIES += libscipreferences.la 
+    noinst_LTLIBRARIES = libscipreferences-algo.la 
+endif
+
+libscipreferences_la_LDFLAGS = -version-number $(SCILAB_LIBRARY_VERSION) $(LD_FLAGS)  $(X_LIBS) $(X_EXTRA_LIBS)
+
+libscipreferences_algo_la_SOURCES = $(PREFERENCES_C_SOURCES) $(PREFERENCES_JNI_SOURCES) $(PREFERENCES_CPP_SOURCES)
+libscipreferences_la_SOURCES = $(GATEWAY_C_SOURCES) $(GATEWAY_CPP_SOURCES) 
+libscipreferences_algo_la_CFLAGS = $(libscipreferences_la_CFLAGS)
+libscipreferences_algo_la_CPPFLAGS = $(libscipreferences_la_CPPFLAGS)
+
+# For the code check (splint)
+CHECK_SRC= $(PREFERENCES_C_SOURCES) $(GATEWAY_C_SOURCES)
+INCLUDE_FLAGS = $(libscipreferences_la_CFLAGS)
+
+
+#### SWIG Declaration ####
+SWIG_WRAPPERS = 
+
+if SWIG
+    BUILT_SOURCES=swig
+endif
+
+libscipreferences_la_LIBADD = libscipreferences-algo.la \
+    $(top_builddir)/libs/MALLOC/libscimalloc.la \
+    $(top_builddir)/modules/jvm/libscijvm.la \
+    $(top_builddir)/modules/output_stream/libscioutput_stream.la
+
+
+#### preferences : gateway declaration ####
+libscipreferences_la_sci_gatewaydir = $(mydatadir)/sci_gateway
+libscipreferences_la_sci_gateway_DATA = sci_gateway/preferences_gateway.xml
+
+if GUI
+    USEANT=1
+endif
diff --git a/scilab/modules/preferences/Makefile.in b/scilab/modules/preferences/Makefile.in
new file mode 100644 (file)
index 0000000..7a8d2c7
--- /dev/null
@@ -0,0 +1,1227 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+#
+# Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+# Copyright (C) 2011 - DIGITEO
+#
+# 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-en.txt
+#
+
+# Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+# Copyright (C) 2006-2008 - INRIA - Sylvestre LEDRU <sylvestre.ledru@inria.fr>
+# Copyright (C) 2008      - INRIA - Pierre MARECHAL <pierre.marechal@inria.fr>
+#
+# 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-en.txt
+#
+
+##########
+### Makefile included stuff
+### Target, variable, suffixes which are supposed to be usefull in every makefile.am
+##########
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+       $(top_srcdir)/Makefile.incl.am
+@NEED_JAVA_TRUE@am__append_1 = java
+@GUI_TRUE@am__append_2 = libscipreferences.la 
+subdir = modules/preferences
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/backtrace.m4 \
+       $(top_srcdir)/m4/docbook.m4 $(top_srcdir)/m4/fftw.m4 \
+       $(top_srcdir)/m4/fortran.m4 $(top_srcdir)/m4/giws.m4 \
+       $(top_srcdir)/m4/hdf5.m4 $(top_srcdir)/m4/intel_compiler.m4 \
+       $(top_srcdir)/m4/java-thirdparty.m4 $(top_srcdir)/m4/java.m4 \
+       $(top_srcdir)/m4/largefile.m4 $(top_srcdir)/m4/lib-ld.m4 \
+       $(top_srcdir)/m4/libsmath.m4 $(top_srcdir)/m4/libtool.m4 \
+       $(top_srcdir)/m4/libxml2.m4 $(top_srcdir)/m4/ltoptions.m4 \
+       $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+       $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/macosx.m4 \
+       $(top_srcdir)/m4/ocaml.m4 $(top_srcdir)/m4/pcre.m4 \
+       $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/m4/relocatable.m4 \
+       $(top_srcdir)/m4/swig.m4 $(top_srcdir)/m4/symlinks.m4 \
+       $(top_srcdir)/m4/tcltk.m4 $(top_srcdir)/m4/umfpack.m4 \
+       $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/modules/core/includes/machine.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__installdirs = "$(DESTDIR)$(pkglibdir)" \
+       "$(DESTDIR)$(libscipreferences_la_etcdir)" \
+       "$(DESTDIR)$(libscipreferences_la_rootdir)" \
+       "$(DESTDIR)$(libscipreferences_la_sci_gatewaydir)"
+LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkglib_LTLIBRARIES)
+libscipreferences_algo_la_LIBADD =
+am__objects_1 =
+am__objects_2 = libscipreferences_algo_la-ScilabPreferences.lo
+am_libscipreferences_algo_la_OBJECTS = $(am__objects_1) \
+       $(am__objects_2) $(am__objects_1)
+libscipreferences_algo_la_OBJECTS =  \
+       $(am_libscipreferences_algo_la_OBJECTS)
+@GUI_TRUE@am_libscipreferences_algo_la_rpath =
+libscipreferences_disable_la_LIBADD =
+am__objects_3 = libscipreferences_disable_la-nopreferences.lo
+am_libscipreferences_disable_la_OBJECTS = $(am__objects_3)
+libscipreferences_disable_la_OBJECTS =  \
+       $(am_libscipreferences_disable_la_OBJECTS)
+libscipreferences_disable_la_LINK = $(LIBTOOL) --tag=CC \
+       $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+       $(libscipreferences_disable_la_CFLAGS) $(CFLAGS) \
+       $(libscipreferences_disable_la_LDFLAGS) $(LDFLAGS) -o $@
+libscipreferences_la_DEPENDENCIES = libscipreferences-algo.la \
+       $(top_builddir)/libs/MALLOC/libscimalloc.la \
+       $(top_builddir)/modules/jvm/libscijvm.la \
+       $(top_builddir)/modules/output_stream/libscioutput_stream.la
+am__objects_4 = libscipreferences_la-gw_preferences.lo
+am__objects_5 = libscipreferences_la-sci_addToolboxInfos.lo \
+       libscipreferences_la-sci_removeToolboxInfos.lo
+am_libscipreferences_la_OBJECTS = $(am__objects_4) $(am__objects_5)
+libscipreferences_la_OBJECTS = $(am_libscipreferences_la_OBJECTS)
+libscipreferences_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+       $(CXXFLAGS) $(libscipreferences_la_LDFLAGS) $(LDFLAGS) -o $@
+@GUI_TRUE@am_libscipreferences_la_rpath = -rpath $(pkglibdir)
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/modules/core/includes
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+       $(LDFLAGS) -o $@
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+       $(LDFLAGS) -o $@
+SOURCES = $(libscipreferences_algo_la_SOURCES) \
+       $(libscipreferences_disable_la_SOURCES) \
+       $(libscipreferences_la_SOURCES)
+DIST_SOURCES = $(libscipreferences_algo_la_SOURCES) \
+       $(libscipreferences_disable_la_SOURCES) \
+       $(libscipreferences_la_SOURCES)
+DATA = $(libscipreferences_la_etc_DATA) \
+       $(libscipreferences_la_root_DATA) \
+       $(libscipreferences_la_sci_gateway_DATA)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALL_LINGUAS = @ALL_LINGUAS@
+ALL_LINGUAS_DOC = @ALL_LINGUAS_DOC@
+AMTAR = @AMTAR@
+ANT = @ANT@
+ANTLR = @ANTLR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AVALON_FRAMEWORK = @AVALON_FRAMEWORK@
+AWK = @AWK@
+BATIK = @BATIK@
+BLAS_LIBS = @BLAS_LIBS@
+BSH = @BSH@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CHECKSTYLE = @CHECKSTYLE@
+COMMONS_BEANUTILS = @COMMONS_BEANUTILS@
+COMMONS_IO = @COMMONS_IO@
+COMMONS_LOGGING = @COMMONS_LOGGING@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEMOTOOLS_ENABLE = @DEMOTOOLS_ENABLE@
+DEPDIR = @DEPDIR@
+DOCBOOK_ROOT = @DOCBOOK_ROOT@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FFTW3_LIB = @FFTW3_LIB@
+FFTW_ENABLE = @FFTW_ENABLE@
+FGREP = @FGREP@
+FLEXDOCK = @FLEXDOCK@
+FLIBS = @FLIBS@
+FOP = @FOP@
+GENHTML = @GENHTML@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GIWS_BIN = @GIWS_BIN@
+GLUEGEN_RT = @GLUEGEN_RT@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GRAPHICS_ENABLE = @GRAPHICS_ENABLE@
+GREP = @GREP@
+GUI_ENABLE = @GUI_ENABLE@
+HDF5_CFLAGS = @HDF5_CFLAGS@
+HDF5_ENABLE = @HDF5_ENABLE@
+HDF5_LIBS = @HDF5_LIBS@
+HELP_ENABLE = @HELP_ENABLE@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+JAR = @JAR@
+JAVA = @JAVA@
+JAVAC = @JAVAC@
+JAVAC_DEBUG = @JAVAC_DEBUG@
+JAVADOC = @JAVADOC@
+JAVAH = @JAVAH@
+JAVASCI_ENABLE = @JAVASCI_ENABLE@
+JAVA_ENABLE = @JAVA_ENABLE@
+JAVA_G = @JAVA_G@
+JAVA_HOME = @JAVA_HOME@
+JAVA_JNI_INCLUDE = @JAVA_JNI_INCLUDE@
+JAVA_JNI_LIBS = @JAVA_JNI_LIBS@
+JDB = @JDB@
+JEUCLID_CORE = @JEUCLID_CORE@
+JGRAPHX = @JGRAPHX@
+JHALL = @JHALL@
+JHDF5 = @JHDF5@
+JLATEXMATH = @JLATEXMATH@
+JLATEXMATH_FOP = @JLATEXMATH_FOP@
+JOGL = @JOGL@
+JROSETTA_API = @JROSETTA_API@
+JROSETTA_ENGINE = @JROSETTA_ENGINE@
+JUNIT = @JUNIT@
+LAPACK_LIBS = @LAPACK_LIBS@
+LCOV = @LCOV@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBM = @LIBM@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOGGING_LEVEL = @LOGGING_LEVEL@
+LOOKS = @LOOKS@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MATIO_CFLAGS = @MATIO_CFLAGS@
+MATIO_ENABLE = @MATIO_ENABLE@
+MATIO_LIBS = @MATIO_LIBS@
+MKDIR_P = @MKDIR_P@
+MSGCAT = @MSGCAT@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OCAMLC = @OCAMLC@
+OCAMLDEP = @OCAMLDEP@
+OCAMLLEX = @OCAMLLEX@
+OCAMLOPT = @OCAMLOPT@
+OCAMLYACC = @OCAMLYACC@
+OPENMP_CFLAGS = @OPENMP_CFLAGS@
+OPENMP_CXXFLAGS = @OPENMP_CXXFLAGS@
+OPENMP_ENABLE = @OPENMP_ENABLE@
+OPENMP_LIBS = @OPENMP_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PCRE_CFLAGS = @PCRE_CFLAGS@
+PCRE_CONFIG = @PCRE_CONFIG@
+PCRE_LIBS = @PCRE_LIBS@
+PCRE_VERSION = @PCRE_VERSION@
+PKG_CONFIG = @PKG_CONFIG@
+POSUB = @POSUB@
+POW_LIB = @POW_LIB@
+PYTHON = @PYTHON@
+QDOX = @QDOX@
+RANLIB = @RANLIB@
+RELOCATABLE = @RELOCATABLE@
+RT_LIB = @RT_LIB@
+SAXON = @SAXON@
+SCILAB_BINARY_VERSION = @SCILAB_BINARY_VERSION@
+SCILAB_LIBRARY_VERSION = @SCILAB_LIBRARY_VERSION@
+SCILAB_VERSION_MAINTENANCE = @SCILAB_VERSION_MAINTENANCE@
+SCILAB_VERSION_MAJOR = @SCILAB_VERSION_MAJOR@
+SCILAB_VERSION_MINOR = @SCILAB_VERSION_MINOR@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SET_RELOCATABLE = @SET_RELOCATABLE@
+SHELL = @SHELL@
+SKINLF = @SKINLF@
+SPLINT = @SPLINT@
+STRIP = @STRIP@
+SWIG_BIN = @SWIG_BIN@
+SWIG_JAVA = @SWIG_JAVA@
+SWIG_RUNTIME_LIBS_DIR = @SWIG_RUNTIME_LIBS_DIR@
+TCLTK_LIBS = @TCLTK_LIBS@
+TCL_INC_PATH = @TCL_INC_PATH@
+TESTNG = @TESTNG@
+TK_INC_PATH = @TK_INC_PATH@
+UMFPACK_ENABLE = @UMFPACK_ENABLE@
+UMFPACK_LIB = @UMFPACK_LIB@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+WITH_OCAML = @WITH_OCAML@
+WITH_TKSCI = @WITH_TKSCI@
+XCOS_ENABLE = @XCOS_ENABLE@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+XMKMF = @XMKMF@
+XMLGRAPHICS_COMMONS = @XMLGRAPHICS_COMMONS@
+XML_APIS_EXT = @XML_APIS_EXT@
+XML_CONFIG = @XML_CONFIG@
+XML_FLAGS = @XML_FLAGS@
+XML_LIBS = @XML_LIBS@
+XML_VERSION = @XML_VERSION@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+cxx_present = @cxx_present@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#### Target ######
+modulename = preferences
+
+#### preferences : Conf files ####
+libscipreferences_la_rootdir = $(mydatadir)
+libscipreferences_la_root_DATA = license.txt 
+
+#### preferences : init scripts & configuration files ####
+libscipreferences_la_etcdir = $(mydatadir)/etc
+libscipreferences_la_etc_DATA = 
+
+# Where all the Scilab stuff is installed (macros, help, ...)
+mydatadir = $(pkgdatadir)/modules/$(modulename)
+
+# splint options
+SPLINT_OPTIONS = -weak -booltype BOOL
+
+########################### JAVA ######################################
+#### We are delegating java compilation to ant... Thanks to that
+#### the procedure will be the same with Microsoft Windows (C)
+#### and Linux/Unix
+#######################################################################
+TARGETS_ALL = $(am__append_1)
+
+################ MACROS ######################
+# Rule to build a macro
+# NOT USED  AT THE MOMENT
+SUFFIXES = .sci 
+
+########### INSTALL DOCUMENTATION ###################
+
+# Install documentation files into the right target
+# We do not use the automake mechanism (libxxxx_la_help_fr_DATA) because
+# automake needs the html files to be present which is not the case when
+# we are building Scilab
+
+# Where it should be installed
+pkgdocdir = $(mydatadir)
+
+# What is the mask of the help source
+DOCMASKXML = *.xml
+
+# What is the mask of the MathML sources
+DOCMASKMML = *.mml
+
+########### INSTALL DATA ###################
+# Install macros, help & demos
+# Where it should be installed
+pkgmacrosdir = $(mydatadir)
+# Which directory we process
+MACRODIRS = macros/
+# Mask of the Scilab sources macros
+MACROMASK = *.sci
+# Mask of the Scilab executable sources macros
+MACROBUILDMASK = *.sce
+# Mask of the Scilab compiled macros
+MACROBINMASK = *.bin
+# List of the standard directory for tests
+TESTS_DIR = tests/benchmarks tests/nonreg_tests tests/unit_tests tests/java
+# Where the demos should be installed
+pkgdemosdir = $(mydatadir)
+# List of the standard directory for demos
+DEMOS_DIR = demos
+# List of the standard directory for examples
+EXAMPLES_DIR = examples
+# Where to export JAVA archives (.jar)
+JARDIR = jar/
+# JAR files mask
+JARMASK = *.jar
+# Chapter file 
+HELP_CHAPTERDIR = help/
+HELP_CHAPTERFILE = addchapter.sce
+HELP_CHAPTERLANG = en_US fr_FR pt_BR
+PREFERENCES_JNI_SOURCES = src/jni/ScilabPreferences.cpp
+PREFERENCES_C_SOURCES = 
+PREFERENCES_CPP_SOURCES = 
+GIWS_WRAPPERS = src/jni/ScilabPreferences.giws.xml
+@GIWS_TRUE@BUILT_SOURCES = giws
+@SWIG_TRUE@BUILT_SOURCES = swig
+GATEWAY_C_SOURCES = sci_gateway/c/gw_preferences.c
+GATEWAY_CPP_SOURCES = sci_gateway/cpp/sci_addToolboxInfos.cpp \
+                      sci_gateway/cpp/sci_removeToolboxInfos.cpp
+
+libscipreferences_la_CFLAGS = $(JAVA_JNI_INCLUDE) \
+    -I$(top_srcdir)/libs/MALLOC/includes/ \
+    -I$(top_srcdir)/modules/jvm/includes/ \
+    -I$(top_srcdir)/modules/output_stream/includes \
+    -I$(top_srcdir)/modules/localization/includes \
+    -I$(top_srcdir)/modules/api_scilab/includes \
+    -I$(top_srcdir)/modules/fileio/includes \
+    -I$(top_srcdir)/modules/core/includes \
+    -I$(top_srcdir)/modules/functions/includes
+
+libscipreferences_la_CPPFLAGS = $(JAVA_JNI_INCLUDE) \
+    -I$(srcdir)/includes/ \
+    -I$(srcdir)/src/cpp/ \
+    -I$(srcdir)/src/c/ \
+    -I$(srcdir)/src/jni/ \
+    -I$(top_srcdir)/modules/jvm/includes/ \
+    -I$(top_srcdir)/modules/fileio/includes \
+    -I$(top_srcdir)/modules/output_stream/includes \
+    -I$(top_srcdir)/modules/localization/includes \
+    -I$(top_srcdir)/modules/api_scilab/includes
+
+
+# Without the preferences module 
+libscipreferences_disable_la_CFLAGS = -Iincludes/ \
+    -I$(top_srcdir)/modules/output_stream/includes
+
+PREFERENCES_DISABLE_C_SOURCES = src/nopreferences/nopreferences.c
+libscipreferences_disable_la_LDFLAGS = -version-number $(SCILAB_LIBRARY_VERSION) $(LD_FLAGS)
+libscipreferences_disable_la_SOURCES = $(PREFERENCES_DISABLE_C_SOURCES)
+pkglib_LTLIBRARIES = libscipreferences-disable.la $(am__append_2)
+@GUI_TRUE@noinst_LTLIBRARIES = libscipreferences-algo.la 
+libscipreferences_la_LDFLAGS = -version-number $(SCILAB_LIBRARY_VERSION) $(LD_FLAGS)  $(X_LIBS) $(X_EXTRA_LIBS)
+libscipreferences_algo_la_SOURCES = $(PREFERENCES_C_SOURCES) $(PREFERENCES_JNI_SOURCES) $(PREFERENCES_CPP_SOURCES)
+libscipreferences_la_SOURCES = $(GATEWAY_C_SOURCES) $(GATEWAY_CPP_SOURCES) 
+libscipreferences_algo_la_CFLAGS = $(libscipreferences_la_CFLAGS)
+libscipreferences_algo_la_CPPFLAGS = $(libscipreferences_la_CPPFLAGS)
+
+# For the code check (splint)
+CHECK_SRC = $(PREFERENCES_C_SOURCES) $(GATEWAY_C_SOURCES)
+INCLUDE_FLAGS = $(libscipreferences_la_CFLAGS)
+
+#### SWIG Declaration ####
+SWIG_WRAPPERS = 
+libscipreferences_la_LIBADD = libscipreferences-algo.la \
+    $(top_builddir)/libs/MALLOC/libscimalloc.la \
+    $(top_builddir)/modules/jvm/libscijvm.la \
+    $(top_builddir)/modules/output_stream/libscioutput_stream.la
+
+
+#### preferences : gateway declaration ####
+libscipreferences_la_sci_gatewaydir = $(mydatadir)/sci_gateway
+libscipreferences_la_sci_gateway_DATA = sci_gateway/preferences_gateway.xml
+@GUI_TRUE@USEANT = 1
+all: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: .sci .bin .c .cpp .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.incl.am $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign modules/preferences/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --foreign modules/preferences/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstLTLIBRARIES:
+       -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+       @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+         test "$$dir" != "$$p" || dir=.; \
+         echo "rm -f \"$${dir}/so_locations\""; \
+         rm -f "$${dir}/so_locations"; \
+       done
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+       @$(NORMAL_INSTALL)
+       test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
+       @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+       list2=; for p in $$list; do \
+         if test -f $$p; then \
+           list2="$$list2 $$p"; \
+         else :; fi; \
+       done; \
+       test -z "$$list2" || { \
+         echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+         $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+       }
+
+uninstall-pkglibLTLIBRARIES:
+       @$(NORMAL_UNINSTALL)
+       @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+       for p in $$list; do \
+         $(am__strip_dir) \
+         echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+         $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+       done
+
+clean-pkglibLTLIBRARIES:
+       -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+       @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+         test "$$dir" != "$$p" || dir=.; \
+         echo "rm -f \"$${dir}/so_locations\""; \
+         rm -f "$${dir}/so_locations"; \
+       done
+libscipreferences-algo.la: $(libscipreferences_algo_la_OBJECTS) $(libscipreferences_algo_la_DEPENDENCIES) 
+       $(CXXLINK) $(am_libscipreferences_algo_la_rpath) $(libscipreferences_algo_la_OBJECTS) $(libscipreferences_algo_la_LIBADD) $(LIBS)
+libscipreferences-disable.la: $(libscipreferences_disable_la_OBJECTS) $(libscipreferences_disable_la_DEPENDENCIES) 
+       $(libscipreferences_disable_la_LINK) -rpath $(pkglibdir) $(libscipreferences_disable_la_OBJECTS) $(libscipreferences_disable_la_LIBADD) $(LIBS)
+libscipreferences.la: $(libscipreferences_la_OBJECTS) $(libscipreferences_la_DEPENDENCIES) 
+       $(libscipreferences_la_LINK) $(am_libscipreferences_la_rpath) $(libscipreferences_la_OBJECTS) $(libscipreferences_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscipreferences_algo_la-ScilabPreferences.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscipreferences_disable_la-nopreferences.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscipreferences_la-gw_preferences.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscipreferences_la-sci_addToolboxInfos.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscipreferences_la-sci_removeToolboxInfos.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
+
+libscipreferences_disable_la-nopreferences.lo: src/nopreferences/nopreferences.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscipreferences_disable_la_CFLAGS) $(CFLAGS) -MT libscipreferences_disable_la-nopreferences.lo -MD -MP -MF $(DEPDIR)/libscipreferences_disable_la-nopreferences.Tpo -c -o libscipreferences_disable_la-nopreferences.lo `test -f 'src/nopreferences/nopreferences.c' || echo '$(srcdir)/'`src/nopreferences/nopreferences.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscipreferences_disable_la-nopreferences.Tpo $(DEPDIR)/libscipreferences_disable_la-nopreferences.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/nopreferences/nopreferences.c' object='libscipreferences_disable_la-nopreferences.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscipreferences_disable_la_CFLAGS) $(CFLAGS) -c -o libscipreferences_disable_la-nopreferences.lo `test -f 'src/nopreferences/nopreferences.c' || echo '$(srcdir)/'`src/nopreferences/nopreferences.c
+
+libscipreferences_la-gw_preferences.lo: sci_gateway/c/gw_preferences.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscipreferences_la_CPPFLAGS) $(CPPFLAGS) $(libscipreferences_la_CFLAGS) $(CFLAGS) -MT libscipreferences_la-gw_preferences.lo -MD -MP -MF $(DEPDIR)/libscipreferences_la-gw_preferences.Tpo -c -o libscipreferences_la-gw_preferences.lo `test -f 'sci_gateway/c/gw_preferences.c' || echo '$(srcdir)/'`sci_gateway/c/gw_preferences.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscipreferences_la-gw_preferences.Tpo $(DEPDIR)/libscipreferences_la-gw_preferences.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/gw_preferences.c' object='libscipreferences_la-gw_preferences.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscipreferences_la_CPPFLAGS) $(CPPFLAGS) $(libscipreferences_la_CFLAGS) $(CFLAGS) -c -o libscipreferences_la-gw_preferences.lo `test -f 'sci_gateway/c/gw_preferences.c' || echo '$(srcdir)/'`sci_gateway/c/gw_preferences.c
+
+.cpp.o:
+@am__fastdepCXX_TRUE@  $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@  $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@  $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+
+libscipreferences_algo_la-ScilabPreferences.lo: src/jni/ScilabPreferences.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscipreferences_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscipreferences_algo_la-ScilabPreferences.lo -MD -MP -MF $(DEPDIR)/libscipreferences_algo_la-ScilabPreferences.Tpo -c -o libscipreferences_algo_la-ScilabPreferences.lo `test -f 'src/jni/ScilabPreferences.cpp' || echo '$(srcdir)/'`src/jni/ScilabPreferences.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscipreferences_algo_la-ScilabPreferences.Tpo $(DEPDIR)/libscipreferences_algo_la-ScilabPreferences.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='src/jni/ScilabPreferences.cpp' object='libscipreferences_algo_la-ScilabPreferences.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscipreferences_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscipreferences_algo_la-ScilabPreferences.lo `test -f 'src/jni/ScilabPreferences.cpp' || echo '$(srcdir)/'`src/jni/ScilabPreferences.cpp
+
+libscipreferences_la-sci_addToolboxInfos.lo: sci_gateway/cpp/sci_addToolboxInfos.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscipreferences_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscipreferences_la-sci_addToolboxInfos.lo -MD -MP -MF $(DEPDIR)/libscipreferences_la-sci_addToolboxInfos.Tpo -c -o libscipreferences_la-sci_addToolboxInfos.lo `test -f 'sci_gateway/cpp/sci_addToolboxInfos.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_addToolboxInfos.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscipreferences_la-sci_addToolboxInfos.Tpo $(DEPDIR)/libscipreferences_la-sci_addToolboxInfos.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_addToolboxInfos.cpp' object='libscipreferences_la-sci_addToolboxInfos.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscipreferences_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscipreferences_la-sci_addToolboxInfos.lo `test -f 'sci_gateway/cpp/sci_addToolboxInfos.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_addToolboxInfos.cpp
+
+libscipreferences_la-sci_removeToolboxInfos.lo: sci_gateway/cpp/sci_removeToolboxInfos.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscipreferences_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscipreferences_la-sci_removeToolboxInfos.lo -MD -MP -MF $(DEPDIR)/libscipreferences_la-sci_removeToolboxInfos.Tpo -c -o libscipreferences_la-sci_removeToolboxInfos.lo `test -f 'sci_gateway/cpp/sci_removeToolboxInfos.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_removeToolboxInfos.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscipreferences_la-sci_removeToolboxInfos.Tpo $(DEPDIR)/libscipreferences_la-sci_removeToolboxInfos.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_removeToolboxInfos.cpp' object='libscipreferences_la-sci_removeToolboxInfos.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscipreferences_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscipreferences_la-sci_removeToolboxInfos.lo `test -f 'sci_gateway/cpp/sci_removeToolboxInfos.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_removeToolboxInfos.cpp
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+install-libscipreferences_la_etcDATA: $(libscipreferences_la_etc_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(libscipreferences_la_etcdir)" || $(MKDIR_P) "$(DESTDIR)$(libscipreferences_la_etcdir)"
+       @list='$(libscipreferences_la_etc_DATA)'; test -n "$(libscipreferences_la_etcdir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(libscipreferences_la_etcdir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(libscipreferences_la_etcdir)" || exit $$?; \
+       done
+
+uninstall-libscipreferences_la_etcDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(libscipreferences_la_etc_DATA)'; test -n "$(libscipreferences_la_etcdir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(libscipreferences_la_etcdir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(libscipreferences_la_etcdir)" && rm -f $$files
+install-libscipreferences_la_rootDATA: $(libscipreferences_la_root_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(libscipreferences_la_rootdir)" || $(MKDIR_P) "$(DESTDIR)$(libscipreferences_la_rootdir)"
+       @list='$(libscipreferences_la_root_DATA)'; test -n "$(libscipreferences_la_rootdir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(libscipreferences_la_rootdir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(libscipreferences_la_rootdir)" || exit $$?; \
+       done
+
+uninstall-libscipreferences_la_rootDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(libscipreferences_la_root_DATA)'; test -n "$(libscipreferences_la_rootdir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(libscipreferences_la_rootdir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(libscipreferences_la_rootdir)" && rm -f $$files
+install-libscipreferences_la_sci_gatewayDATA: $(libscipreferences_la_sci_gateway_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(libscipreferences_la_sci_gatewaydir)" || $(MKDIR_P) "$(DESTDIR)$(libscipreferences_la_sci_gatewaydir)"
+       @list='$(libscipreferences_la_sci_gateway_DATA)'; test -n "$(libscipreferences_la_sci_gatewaydir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(libscipreferences_la_sci_gatewaydir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(libscipreferences_la_sci_gatewaydir)" || exit $$?; \
+       done
+
+uninstall-libscipreferences_la_sci_gatewayDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(libscipreferences_la_sci_gateway_DATA)'; test -n "$(libscipreferences_la_sci_gatewaydir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       test -n "$$files" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(libscipreferences_la_sci_gatewaydir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(libscipreferences_la_sci_gatewaydir)" && rm -f $$files
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       set x; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+             END { if (nonempty) { for (i in files) print i; }; }'`; \
+       test -z "$(CTAGS_ARGS)$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && $(am__cd) $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+       $(MAKE) $(AM_MAKEFLAGS) check-local
+check: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(LTLIBRARIES) $(DATA) all-local
+installdirs:
+       for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(libscipreferences_la_etcdir)" "$(DESTDIR)$(libscipreferences_la_rootdir)" "$(DESTDIR)$(libscipreferences_la_sci_gatewaydir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+       -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-local \
+       clean-noinstLTLIBRARIES clean-pkglibLTLIBRARIES mostlyclean-am
+
+distclean: distclean-am
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-local distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-data-local \
+       install-libscipreferences_la_etcDATA \
+       install-libscipreferences_la_rootDATA \
+       install-libscipreferences_la_sci_gatewayDATA
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am: install-html-local
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-libscipreferences_la_etcDATA \
+       uninstall-libscipreferences_la_rootDATA \
+       uninstall-libscipreferences_la_sci_gatewayDATA \
+       uninstall-pkglibLTLIBRARIES
+
+.MAKE: all check check-am install install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am all-local check check-am check-local \
+       clean clean-generic clean-libtool clean-local \
+       clean-noinstLTLIBRARIES clean-pkglibLTLIBRARIES ctags \
+       distclean distclean-compile distclean-generic \
+       distclean-libtool distclean-local distclean-tags distdir dvi \
+       dvi-am html html-am info info-am install install-am \
+       install-data install-data-am install-data-local install-dvi \
+       install-dvi-am install-exec install-exec-am install-html \
+       install-html-am install-html-local install-info \
+       install-info-am install-libscipreferences_la_etcDATA \
+       install-libscipreferences_la_rootDATA \
+       install-libscipreferences_la_sci_gatewayDATA install-man \
+       install-pdf install-pdf-am install-pkglibLTLIBRARIES \
+       install-ps install-ps-am install-strip installcheck \
+       installcheck-am installdirs maintainer-clean \
+       maintainer-clean-generic mostlyclean mostlyclean-compile \
+       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+       tags uninstall uninstall-am \
+       uninstall-libscipreferences_la_etcDATA \
+       uninstall-libscipreferences_la_rootDATA \
+       uninstall-libscipreferences_la_sci_gatewayDATA \
+       uninstall-pkglibLTLIBRARIES
+
+
+# This target enables tests for Scilab
+check-local: $(top_builddir)/scilab-bin test
+       @COMMAND="test_run('$(modulename)');quit";\
+       export LANG=C;\
+       $(top_builddir)/bin/scilab -nwni -nb -e "$$COMMAND"
+check-code:
+       if test -f build.xml; then \
+               $(ANT) checkstyle; \
+       fi
+       if test -x "$(SPLINT)"; then \
+               $(SPLINT) $(SPLINT_OPTIONS) -I$(top_srcdir)/modules/core/includes/ -I$(top_srcdir)/libs/MALLOC/includes/ -I$(top_srcdir)/modules/localization/includes/ $(INCLUDE_FLAGS) $(CHECK_SRC); \
+       fi
+@NEED_JAVA_TRUE@java:
+# Some configurations needs to export JAVA_HOME in the current env
+@NEED_JAVA_TRUE@       @if test "$(JAVA_HOME)"; then export JAVA_HOME=$(JAVA_HOME); fi; \
+@NEED_JAVA_TRUE@       if test -z "$(USEANT)"; then USEANT=0; else USEANT=1; fi; \
+@NEED_JAVA_TRUE@       if test -f build.xml -a $$USEANT -eq 1; then \
+@NEED_JAVA_TRUE@               $(ANT); \
+@NEED_JAVA_TRUE@       fi
+
+@NEED_JAVA_TRUE@clean-java:
+# Some configurations needs to export JAVA_HOME in the current env
+@NEED_JAVA_TRUE@       @if test "$(JAVA_HOME)"; then export JAVA_HOME=$(JAVA_HOME); fi; \
+@NEED_JAVA_TRUE@       if test -z "$(USEANT)"; then USEANT=0; else USEANT=1; fi; \
+@NEED_JAVA_TRUE@       if test -f build.xml -a $$USEANT -eq 1; then \
+@NEED_JAVA_TRUE@               $(ANT) clean; \
+@NEED_JAVA_TRUE@       fi;
+
+# If the user request for the SWIG generation of the wrappers Java => C/C++ 
+# We call the target swig-build on the variable SWIG_WRAPPERS
+
+@SWIG_TRUE@swig: $(SWIG_WRAPPERS)
+@SWIG_TRUE@    @SWIG_PACKAGENAME=org.scilab.modules.$(modulename); \
+@SWIG_TRUE@    SWIG_OUTDIR=src/java/org/scilab/modules/$(modulename)/; \
+@SWIG_TRUE@    if test -n "$(SWIG_WRAPPERS)"; then \
+@SWIG_TRUE@            for file in $(SWIG_WRAPPERS) ; do \
+@SWIG_TRUE@                    echo "Swig process of $$file ..."; \
+@SWIG_TRUE@                    $(SWIG_BIN) $(SWIG_JAVA) -package $$SWIG_PACKAGENAME  -outdir $$SWIG_OUTDIR $$file; \
+@SWIG_TRUE@            done; \
+@SWIG_TRUE@    fi
+
+# If the user request for the SWIG generation of the wrappers Java => C/C++ 
+# We call the target swig-build on the variable SWIG_WRAPPERS
+
+@GIWS_TRUE@giws: $(GIWS_WRAPPERS)
+@GIWS_TRUE@    @GIWS_OUTPUTDIR=src/jni/;\
+@GIWS_TRUE@    if test -n "$(GIWS_WRAPPERS)"; then \
+@GIWS_TRUE@            for file in $(GIWS_WRAPPERS) ; do \
+@GIWS_TRUE@                    echo "GIWS process of $$file ..."; \
+@GIWS_TRUE@                    $(GIWS_BIN) --disable-return-size-array --output-dir $$GIWS_OUTPUTDIR --throws-exception-on-error --description-file $$file; \
+@GIWS_TRUE@            done; \
+@GIWS_TRUE@    fi
+
+macros:
+       -@( if test ! -x $(top_builddir)/scilab-bin; then \
+               echo "Error : Cannot build $< : Scilab has not been built"; \
+       else \
+               $(top_builddir)/bin/scilab -ns -nwni -e "exec('macros/buildmacros.sce');quit;";\
+       fi)
+
+# Removes the macros
+clean-macros:
+# Removes macros (*.bin generated from .sci)
+       @for dir in $(MACRODIRS) $(MACROSDIRSEXT) ; do \
+               echo "rm -f $(builddir)/$$dir/$(MACROBINMASK)"; \
+               rm -f $(builddir)/$$dir/$(MACROBINMASK); \
+       done
+
+test:
+# More tests could be added here
+       @if test -z "$(USEANT)"; then USEANT=0; else USEANT=1; fi; \
+       if test -f build.xml -a $$USEANT -eq 1; then \
+               $(ANT) test; \
+       fi
+
+all-local: $(TARGETS_ALL)
+
+.sci.bin:
+       -@( if test ! -x $(top_builddir)/scilab-bin; then \
+       echo "Error : Cannot build $< : Scilab has not been build"; \
+       else \
+       echo "Creating $@"; \
+       $(top_builddir)/bin/scilab -ns -nwni -e "exec('$(abs_srcdir)/$<');save('$(abs_srcdir)/$@');exit;"; \
+       fi )
+
+install-html-local:
+
+install-data-local-local:
+# Mainly for javasci
+       @if test -d $(srcdir)/javadoc; then \
+               cp -R $(srcdir)/javadoc $(DESTDIR)/$(mydatadir)/; \
+       fi
+# If the user wants the help sources to be installed
+@INSTALL_HELP_XML_TRUE@        @echo "-------- Install of XML sources of help files --------"; \
+@INSTALL_HELP_XML_TRUE@        for lang in $(ALL_LINGUAS); do \
+@INSTALL_HELP_XML_TRUE@         if test -d $(srcdir)/help/$$lang; then \
+@INSTALL_HELP_XML_TRUE@          $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/help/$$lang && \
+@INSTALL_HELP_XML_TRUE@                if ls -lLd $(srcdir)/help/$$lang/$(DOCMASKXML) >/dev/null 2>&1; then \
+@INSTALL_HELP_XML_TRUE@                  for file in $(srcdir)/help/$$lang/$(DOCMASKXML) ; do \
+@INSTALL_HELP_XML_TRUE@                    echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdocdir)/help/$$lang" ; \
+@INSTALL_HELP_XML_TRUE@                $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgdocdir)/help/$$lang ; \
+@INSTALL_HELP_XML_TRUE@                  done ; \
+@INSTALL_HELP_XML_TRUE@                fi; \
+@INSTALL_HELP_XML_TRUE@         fi; \
+@INSTALL_HELP_XML_TRUE@        done; \
+@INSTALL_HELP_XML_TRUE@        @echo "-------- Install of MathML sources --------"; \
+@INSTALL_HELP_XML_TRUE@         if test -d $(srcdir)/help/mml/; then \
+@INSTALL_HELP_XML_TRUE@          $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/help/mml/ && \
+@INSTALL_HELP_XML_TRUE@                if ls -lLd $(srcdir)/help/mml/$(DOCMASKMML) >/dev/null 2>&1; then \
+@INSTALL_HELP_XML_TRUE@                  for file in $(srcdir)/help/mml/$(DOCMASKMML) ; do \
+@INSTALL_HELP_XML_TRUE@                    echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdocdir)/help/mml" ; \
+@INSTALL_HELP_XML_TRUE@                $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgdocdir)/help/mml ; \
+@INSTALL_HELP_XML_TRUE@                  done ; \
+@INSTALL_HELP_XML_TRUE@                fi; \
+@INSTALL_HELP_XML_TRUE@        fi
+install-data-local:
+# Install the tests
+       @echo "-------- Install tests (if any) --------"; \
+       for dir in $(TESTS_DIR) $(TESTS_DIREXT) ; do \
+         if test -d $(srcdir)/$$dir/; then \
+           $(mkinstalldirs) $(DESTDIR)$(pkgmacrosdir)/$$dir && \
+                 for file in `find $(srcdir)/$$dir | sed "s|^$(srcdir)/$$dir||" 2>/dev/null`; do \
+                   if test -d "$(srcdir)/$$dir/$$file"; then \
+                         echo $(mkinstalldirs) $(DESTDIR)$(pkgmacrosdir)/$$dir/$$file; \
+                         $(mkinstalldirs) "$(DESTDIR)$(pkgmacrosdir)/$$dir/$$file"; \
+                   else \
+                     echo "$(INSTALL_DATA) $(srcdir)/$$dir/$$file $(DESTDIR)$(pkgmacrosdir)/`dirname $$dir/$$file`" ; \
+                 $(INSTALL_DATA) "$(srcdir)/$$dir/$$file" "$(DESTDIR)$(pkgmacrosdir)/`dirname $$dir/$$file`" ; \
+                   fi \
+                 done; \
+         fi; \
+       done
+# Install the help chapter
+       @echo "-------- Install the help chapter (if any) --------"; \
+       for lang in $(HELP_CHAPTERLANG); do \
+               HELPFILE=$(srcdir)/$(HELP_CHAPTERDIR)$$lang/$(HELP_CHAPTERFILE); \
+               if test -f $$HELPFILE; then \
+                       echo $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$(HELP_CHAPTERDIR)/$$lang/; \
+                       $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$(HELP_CHAPTERDIR)/$$lang/; \
+                       echo $(INSTALL_DATA) $$HELPFILE $(DESTDIR)$(pkgdocdir)/$$HELPFILE; \
+                       $(INSTALL_DATA) $$HELPFILE $(DESTDIR)$(pkgdocdir)/$$HELPFILE; \
+               fi; \
+       done
+# Install the demos & examples
+       @echo "-------- Install demos & examples (if any) --------"; \
+       for dir in $(DEMOS_DIR) $(DEMOS_DIREXT) $(EXAMPLES_DIR) $(EXAMPLES_DIREXT) ; do \
+         if test -d $(srcdir)/$$dir/; then \
+           $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$$dir && \
+                 for file in `find $(srcdir)/$$dir | sed "s|^$(srcdir)/$$dir||" 2>/dev/null`; do \
+                   if test -d "$(srcdir)/$$dir/$$file"; then \
+                         echo $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$$dir/$$file; \
+                         $(mkinstalldirs) "$(DESTDIR)$(pkgdocdir)/$$dir/$$file"; \
+                   else \
+                     echo "$(INSTALL_DATA) $(srcdir)/$$dir/$$file $(DESTDIR)$(pkgdocdir)/`dirname $$dir/$$file`" ; \
+                 $(INSTALL_DATA) "$(srcdir)/$$dir/$$file" "$(DESTDIR)$(pkgdocdir)/`dirname $$dir/$$file`" ; \
+                   fi \
+                 done; \
+         fi; \
+       done
+# Install the macros
+       @echo "-------- Install macros (if any) --------"; \
+       for dir in $(MACRODIRS) $(MACROSDIRSEXT) ; do \
+         $(mkinstalldirs) $(DESTDIR)$(pkgmacrosdir)/$$dir && \
+               if test -d $(srcdir)/$$dir/; then \
+                       FILELIST="$(srcdir)/$$dir/$(MACROMASK) $(srcdir)/$$dir/$(MACROBINMASK) $(srcdir)/$$dir/$(MACROBUILDMASK) $(srcdir)/$$dir/names $(srcdir)/$$dir/lib";\
+                       if test -n "$(MACROSSPECIALEXT)"; then \
+                               specialExtDir=""; \
+                               for specialExt in $(MACROSSPECIALEXT); do \
+                                       specialExtDir="$$specialExtDir $(srcdir)/$$dir/$$specialExt"; \
+                               done; \
+                               FILELIST="$$FILELIST $$specialExtDir"; \
+                       fi; \
+                 for file in `ls -1 $$FILELIST 2>/dev/null`; do \
+                   echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgmacrosdir)/$$dir" ; \
+               $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgmacrosdir)/$$dir ; \
+                 done; \
+               fi; \
+       done
+# Install java files (.jar)
+       @if ls -lLd $(srcdir)/$(JARDIR)$(JARMASK) >/dev/null 2>&1; then \
+       echo "-------- Install jar files --------"; \
+    $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$(JARDIR); \
+         for file in $(srcdir)/$(JARDIR)$(JARMASK); do\
+                   echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdocdir)/$(JARDIR)" ; \
+               $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgdocdir)/$(JARDIR) ; \
+         done ; \
+       fi
+
+########### CLEAN ###################
+# Clean help (generated automatically by Scilab)
+# It used to clean the macro (clean-macros) but this was causing
+# make clean && make to fail Scilab startup
+@NEED_JAVA_TRUE@clean-local: clean-java
+@NEED_JAVA_FALSE@clean-local:
+
+distclean-local:
+       rm -f $(builddir)/help/*/.last_successful_build_javaHelp $(builddir)/help/*/.list_*
+
+.PHONY: macros java swig giws
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/scilab/modules/preferences/build.xml b/scilab/modules/preferences/build.xml
new file mode 100644 (file)
index 0000000..0bd408a
--- /dev/null
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - DIGITEO - 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-en.txt
+ *
+ -->
+<project name="preferences" default="jar">
+  <import file="../../build.incl.xml"/>
+  <property name="library.name" value="${library.preferences.name}"/>
+  <property name="library.title" value="Preferences for Scilab"/>
+  <description>
+    Build the Scilab preferences module
+  </description>
+</project>
diff --git a/scilab/modules/preferences/etc/XConfiguration.xml b/scilab/modules/preferences/etc/XConfiguration.xml
new file mode 100644 (file)
index 0000000..17ec8d3
--- /dev/null
@@ -0,0 +1,147 @@
+<?xml version="1.0" encoding="utf-8"?>
+<interface path="1/" width="700" height="500">
+  <general>
+    <body maturity="B">
+      <environment floating-point-exception="Produces a warning" printing-format="long" width="10"/>
+      <java-heap-memory heap-size="128"/>
+    </body>
+    <confirmation-dialogs>
+      <body maturity="B">
+        <tools order="ascending">
+          <tool state="checked" name="Scinotes" description="Prompt"/>
+          <tool state="unchecked" name="Console" description="Warn before clearing the Console"/>
+          <tool state="checked" name="Command History" description="Warn before deleting Command History items"/>
+        </tools>
+      </body>
+    </confirmation-dialogs>
+    <shortcuts>
+      <body maturity="B">
+        <actions active="scilab" browse="--choose a file --" filter="">
+          <action-folder name="Console" state="open">
+            <action ctrl="E" description="Execute..."/>
+            <action ctrl="N" description="New..."/>
+            <action ctrl="O" description="Open a file"/>
+          </action-folder>
+          <action-folder name="Scinotes" state="close">
+            <action ctrl="A" description="Abort..."/>
+            <action ctrl="B" description="Battle"/>
+            <action ctrl="C" description="Copy"/>
+            <action ctrl="D" description="Delete"/>
+            <action ctrl="E" description="Erase..."/>
+            <action ctrl="F" description="Flush"/>
+            <action ctrl="G" description="Giggle..."/>
+            <action ctrl="H" description="Help"/>
+            <action ctrl="I" description="Ignite"/>
+          </action-folder>
+        </actions>
+      </body>
+    </shortcuts>
+  </general>
+  <fonts>
+    <body maturity="B">
+      <fonts item="1" system="true" font-family="Monospaced" font-face="plain" font-size="10">
+        <item name="Console" desktop="false" font-family="Monospaced" font-face="plain" font-size="10"/>
+        <item name="Command History" desktop="true" font-family="Monospaced" font-face="plain" font-size="10"/>
+        <item name="Variable Browser" desktop="true" font-family="Monospaced" font-face="plain" font-size="10"/>
+        <item name="Help" desktop="true" font-family="Monospaced" font-face="plain" font-size="10"/>
+        <item name="Scinotes" desktop="true" font-family="Monospaced" font-face="plain" font-size="10"/>
+        <item name="Variables Editor" desktop="true" font-family="Monospaced" font-face="plain" font-size="10"/>
+      </fonts>
+    </body>
+  </fonts>
+  <colors>
+    <body maturity="B">
+      <desktop-colors use-system-color="true" text="#000000" background="#ffffff" cursor="#000000"/>
+      <syntax-highlighting-colors name="Special">
+        <item name="Default" color="#345678" bold="false" italic="false" underline="false" strinke-through="false"/>
+        <item name="Special" color="#456783" bold="false" italic="false" underline="false" strinke-through="false"/>
+        <item name="Operator" color="#567834" bold="false" italic="false" underline="false" strinke-through="false"/>
+        <item name="Primitive" color="#678345" bold="false" italic="false" underline="false" strinke-through="false"/>
+        <item name="Macro" color="#783456" bold="false" italic="false" underline="false" strinke-through="false"/>
+        <item name="MacroInFile" color="#834567" bold="false" italic="false" underline="false" strinke-through="false"/>
+        <item name="String" color="#345678" bold="false" italic="false" underline="false" strinke-through="false"/>
+        <item name="ExternalVariable" color="#456783" bold="false" italic="false" underline="false" strinke-through="false"/>
+        <item name="InputOutputArgs" color="#567834" bold="false" italic="false" underline="false" strinke-through="false"/>
+        <item name="Identifier" color="#567834" bold="false" italic="false" underline="false" strinke-through="false"/>
+        <item name="Comment" color="#567834" bold="false" italic="false" underline="false" strinke-through="false"/>
+        <item name="Field" color="#567834" bold="false" italic="false" underline="false" strinke-through="false"/>
+        <item name="FunctionKwd" color="#567834" bold="false" italic="false" underline="false" strinke-through="false"/>
+        <item name="Url" color="#567834" bold="false" italic="false" underline="false" strinke-through="false"/>
+        <item name="Mail" color="#567834" bold="false" italic="false" underline="false" strinke-through="false"/>
+        <item name="Number" color="#567834" bold="false" italic="false" underline="false" strinke-through="false"/>
+        <item name="Control" color="#567834" bold="false" italic="false" underline="false" strinke-through="false"/>
+        <item name="Structure" color="#567834" bold="false" italic="false" underline="false" strinke-through="false"/>
+        <item name="Constantes" color="#567834" bold="false" italic="false" underline="false" strinke-through="false"/>
+        <item name="White" color="#567834" bold="false" italic="false" underline="false" strinke-through="false"/>
+        <item name="WhiteInComment" color="#567834" bold="false" italic="false" underline="false" strinke-through="false"/>
+        <item name="WhiteInString" color="#567834" bold="false" italic="false" underline="false" strinke-through="false"/>
+        <item name="Tabulation" color="#567834" bold="false" italic="false" underline="false" strinke-through="false"/>
+        <item name="TabulationInComment" color="#567834" bold="false" italic="false" underline="false" strinke-through="false"/>
+        <item name="LaTeXInComment" color="#567834" bold="false" italic="false" underline="false" strinke-through="false"/>
+        <item name="TabulationInString" color="#567834" bold="false" italic="false" underline="false" strinke-through="false"/>
+        <item name="OpenClose" color="#567834" bold="false" italic="false" underline="false" strinke-through="false"/>
+      </syntax-highlighting-colors>
+    </body>
+  </colors>
+  <console>
+    <body maturity="B">
+      <display wrap-lines="true" lines-to-display="100" columns-to-display="100" tab-size="4" scroll-size="3000">
+                       </display>
+      <accessibility/>
+    </body>
+  </console>
+  <command-history>
+    <body maturity="B">
+      <history-save kind="quit" after="1"/>
+      <history-settings history-file="" history-lines="1000"/>
+    </body>
+  </command-history>
+  <scinotes>
+    <body maturity="B">
+      <scinotes-preferences restart-reopen="true" reload-unedited="true" add-line-termination="true" number-of-entries="5" encoding="utf-8" eol="Unix(LF)"/>
+    </body>
+    <display>
+      <body maturity="B">
+        <scinotes-display highlight-current-line="true" current-line-color="#facade" show-line-numbers="true" wrap-lines="true"/>
+      </body>
+    </display>
+    <syntax>
+      <body maturity="B">
+        <scinotes-syntax highlight="true" hightlight-brackets="true" tab-size="4" use-spaces="true" indent-size="4" automatic-indent="true"/>
+      </body>
+    </syntax>
+    <autosave>
+      <body maturity="B">
+        <scinotes-autosave enable="true" save-every="5" save-untitled="true" automatic-delete="true" append-flag="true" append-with="~" replace-with="tmp" source-flag="true" single-directory=""/>
+      </body>
+    </autosave>
+  </scinotes>
+  <variables>
+    <body maturity="B">
+      <variable-browser maximum-array-size="500000"/>
+      <variable-editor default-array-format="short" move-selection-after-enter="true" direction="Down" decimal-separator=","/>
+    </body>
+  </variables>
+  <xcos>
+    <body maturity="B">
+      <xcos/>
+    </body>
+  </xcos>
+  <toolbar>
+    <body maturity="I">
+      <toolbars select="scilab">
+        <toolbar title="scilab" position="1" selection="0">
+          <item title="Cut"/>
+          <separator/>
+          <item title="Paste"/>
+        </toolbar>
+        <toolbar title="scinotes" position="2" selection="2">
+          <item title="Cut"/>
+          <separator/>
+          <item title="Copy"/>
+        </toolbar>
+      </toolbars>
+    </body>
+  </toolbar>
+  <toolboxes/>
+</interface>
diff --git a/scilab/modules/preferences/etc/XWizard-expression.xml b/scilab/modules/preferences/etc/XWizard-expression.xml
new file mode 100644 (file)
index 0000000..b112afc
--- /dev/null
@@ -0,0 +1,39 @@
+<?xml version='1.0' encoding='utf-8'?>\r
+<expression step="expression">\r
+       <expression zero-crossing="true">\r
+               <outputs>\r
+                       <item value="A*sin(u1)*cos(u2)"/>\r
+                       <item value="tan(u1)"/>\r
+               </outputs>\r
+               <inputs>\r
+                       <item value="[1 2]"/>\r
+                       <item value="[2 3]"/>\r
+               </inputs>\r
+       </expression>\r
+\r
+\r
+       <!-- selectable pattern -->\r
+       <parameters item="1">\r
+               <!-- test -->\r
+               <item name="A"    type="double"  min="0.0" max="99.9"\r
+          test="5.15" tooltip="Gain" description="Gain"/>\r
+       </parameters>\r
+       <graphics item="1">\r
+               <item title="Title"     family="arial" size="11" face="plain" color="#facade"/>\r
+               <item title="Text"      family="arial" size="11" face="plain" color="#facade"/>\r
+               <item title="I/O label" family="arial" size="11" face="plain" color="#facade"/>\r
+               <item title="Border"                                          color="#facade"/>\r
+               <item title="Background"                                      color="#facade"/>\r
+       </graphics>\r
+       <documentation>\r
+               <short-description> Signal transformation\r
+               </short-description>\r
+               <long-description> Signal transformation\r
+               </long-description>\r
+               <exemple-description> Performed on a set of two values\r
+               </exemple-description>\r
+               <exemple-xcos-image src="none"/>\r
+               <exemple-png-image src="none"/>\r
+       </documentation>\r
+</expression>\r
+\r
diff --git a/scilab/modules/preferences/etc/XWizard-function.xml b/scilab/modules/preferences/etc/XWizard-function.xml
new file mode 100644 (file)
index 0000000..1f361d9
--- /dev/null
@@ -0,0 +1,41 @@
+<?xml version='1.0' encoding='utf-8'?>\r
+<function step="function">\r
+       <function always-active="true" discrete-state="" continuous-state=""/> \r
+       <interface>\r
+               <regular-inputs>\r
+                       <item name="In" type="double" rows="" columns="1"/>\r
+               </regular-inputs>\r
+               <regular-outputs>\r
+                       <item name="Out" type="double" rows="-1" columns="-1"/>\r
+               </regular-outputs>\r
+               <activation-inputs>\r
+                       <item name="Clock"/>\r
+               </activation-inputs>\r
+               <activation-outputs/>\r
+       </interface>\r
+\r
+       <!-- selectable pattern -->\r
+       <parameters item="1">\r
+               <!-- test -->\r
+               <item name="A"    type="double"  min="0.0" max="99.9" \r
+          test="5.15" tooltip="Gain" description="Gain"/>\r
+       </parameters>\r
+       <graphics item="1">\r
+               <item title="Title"     family="arial" size="11" face="plain" color="#facade"/>\r
+               <item title="Text"      family="arial" size="11" face="plain" color="#facade"/>\r
+               <item title="I/O label" family="arial" size="11" face="plain" color="#facade"/>\r
+               <item title="Border"                                          color="#facade"/>\r
+               <item title="Background"                                      color="#facade"/>\r
+       </graphics>\r
+       <documentation>\r
+               <short-description> A scilab function\r
+               </short-description>\r
+               <long-description> A scilab function\r
+               </long-description>\r
+               <exemple-description> How this exemple is described?\r
+               </exemple-description>\r
+               <exemple-xcos-image src="none"/>\r
+               <exemple-png-image src="none"/>\r
+       </documentation>\r
+</function>\r
+\r
diff --git a/scilab/modules/preferences/etc/XWizard-xcos.xml b/scilab/modules/preferences/etc/XWizard-xcos.xml
new file mode 100644 (file)
index 0000000..6943786
--- /dev/null
@@ -0,0 +1,44 @@
+<?xml version='1.0' encoding='utf-8'?>\r
+<xcos step="interface">\r
+       <interface>\r
+               <regular-inputs>\r
+                       <item name="In" type="double" rows="" columns="1"/>\r
+               </regular-inputs>\r
+               <regular-outputs>\r
+                       <item name="Out" type="double" rows="-1" columns="-1"/>\r
+               </regular-outputs>\r
+               <activation-inputs>\r
+                       <item name="Clock"/>\r
+               </activation-inputs>\r
+               <activation-outputs/>\r
+       </interface>\r
+\r
+\r
+       <!-- selectable pattern -->\r
+       <parameters item="1">\r
+               <!-- test -->\r
+               <item name="A"    type="double"  min="0.0" max="99.9" \r
+          test="5.15" tooltip="Gain" description="Gain"/>\r
+       </parameters>\r
+       <graphics item="1">\r
+               <item title="Title"     family="arial" size="11" face="plain" color="#00ffff"/>\r
+               <item title="Text"      family="arial" size="11" face="plain" color="#facade"/>\r
+               <item title="I/O label" family="arial" size="11" face="plain" color="#facade"/>\r
+               <item title="Border"                                          color="#facade"/>\r
+               <item title="Background"                                      color="#facade"/>\r
+       </graphics>\r
+       <documentation>\r
+               <short-description text="An XCos super-block"> \r
+               </short-description>\r
+               <long-description> An XCos super-block with different \r
+inputs, \r
+outputs\r
+and activations signals.\r
+               </long-description>\r
+               <exemple-description> Not yet implemented...\r
+               </exemple-description>\r
+               <exemple-xcos-image src="none"/>\r
+               <exemple-png-image src="none"/>\r
+       </documentation>\r
+</xcos>\r
+\r
diff --git a/scilab/modules/preferences/etc/XWizard.xml b/scilab/modules/preferences/etc/XWizard.xml
new file mode 100644 (file)
index 0000000..f407fd6
--- /dev/null
@@ -0,0 +1,26 @@
+<?xml version='1.0' encoding='utf-8'?>\r
+<user-block-wizard select="xcos">\r
+       <kind name="xcos" title="XCos super block">&lt;HTML&gt;\r
+               Some explanatory text about &lt;U&gt;XCos super block&lt;/U&gt;.\r
+       </kind>\r
+       <folder title="Function block">\r
+               <kind name="expression" title="Scilab expression">&lt;HTML&gt;\r
+                       Some explanatory text about &lt;U&gt;Scilab expression&lt;/U&gt;.\r
+               </kind>\r
+               <kind name="function" title="Scilab function">&lt;HTML&gt;\r
+                       Some explanatory text about &lt;U&gt;Scilab function&lt;/U&gt;.\r
+               </kind>\r
+               <kind title="C, C++ or Java function"> <!-- name="imperative" -->\r
+                       This item is not fully explained in the specification.\r
+               </kind>\r
+               <kind title="Fortran function"> <!-- name="fortran"  -->\r
+                       This item is not fully explained in the specification.\r
+               </kind>\r
+               <kind title="Modelica model"> <!-- name="modelica" -->\r
+                       This item is not fully explained in the specification.\r
+               </kind>\r
+       </folder>\r
+       <kind title="PDE">\r
+               This item is not explained in the specification.\r
+       </kind>\r
+</user-block-wizard>\r
diff --git a/scilab/modules/preferences/etc/preferences.quit b/scilab/modules/preferences/etc/preferences.quit
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/scilab/modules/preferences/etc/preferences.start b/scilab/modules/preferences/etc/preferences.start
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/scilab/modules/preferences/includes/dynlib_preferences_scilab.h b/scilab/modules/preferences/includes/dynlib_preferences_scilab.h
new file mode 100644 (file)
index 0000000..d04bfb2
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) DIGITEO - 2011 - Calixte DENIZET
+* 
+* 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-en.txt
+*
+*/
+
+/*--------------------------------------------------------------------------*/ 
+#ifndef __DYNLIB_PREFERENCES_SCILAB_H__
+#define __DYNLIB_PREFERENCES_SCILAB_H__
+
+#ifdef _MSC_VER
+       #ifdef PREFERENCES_SCILAB_EXPORTS
+               #define PREFERENCES_SCILAB_IMPEXP __declspec(dllexport)
+       #else
+               #define PREFERENCES_SCILAB_IMPEXP __declspec(dllimport)
+       #endif
+#else
+       #define PREFERENCES_SCILAB_IMPEXP
+#endif
+
+#endif /* __DYNLIB_PREFERENCES_SCILAB_H__ */
+/*--------------------------------------------------------------------------*/ 
diff --git a/scilab/modules/preferences/includes/gw_preferences.h b/scilab/modules/preferences/includes/gw_preferences.h
new file mode 100644 (file)
index 0000000..f6e98bf
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2011 - DIGITEO - Calixte DENIZET
+* 
+* 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-en.txt
+*
+*/
+
+#ifndef __GW_PREFERENCES__
+#define __GW_PREFERENCES__
+/*--------------------------------------------------------------------------*/
+#include "dynlib_preferences_scilab.h"
+/*--------------------------------------------------------------------------*/
+PREFERENCES_SCILAB_IMPEXP int gw_preferences(void);
+int sci_addToolboxInfos(char * fname, unsigned long l);
+int sci_removeToolboxInfos(char * fname, unsigned long l);
+/*--------------------------------------------------------------------------*/
+#endif /* __GW_PREFERENCES__ */
+/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/preferences/license.txt b/scilab/modules/preferences/license.txt
new file mode 100644 (file)
index 0000000..898a815
--- /dev/null
@@ -0,0 +1,11 @@
+Copyright:
+Copyright (c) 2011 - DIGITEO
+
+License:
+This module must be used under the terms of the CeCILL.
+This module 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-en.txt
+
+
diff --git a/scilab/modules/preferences/macros/buildmacros.bat b/scilab/modules/preferences/macros/buildmacros.bat
new file mode 100644 (file)
index 0000000..f9bd674
--- /dev/null
@@ -0,0 +1,11 @@
+
+rem Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+rem Copyright (C) 2009 - DIGITEO
+rem
+rem This file must be used under the terms of the CeCILL.
+rem This source file is licensed as described in the file COPYING, which
+rem you should have received as part of this distribution.  The terms
+rem are also available at
+rem http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
+@..\..\..\bin\scilex -nwni -ns -e exec('buildmacros.sce');quit;
diff --git a/scilab/modules/preferences/macros/buildmacros.sce b/scilab/modules/preferences/macros/buildmacros.sce
new file mode 100644 (file)
index 0000000..aaf60f4
--- /dev/null
@@ -0,0 +1,16 @@
+
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2009 - DIGITEO - Allan CORNET <allan.cornet@inria.fr>
+//
+// 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-en.txt
+
+if (isdef('genlib') == %f) then
+  exec(SCI+'/modules/functions/scripts/buildmacros/loadgenlib.sce');
+end
+
+genlib("scinoteslib","SCI/modules/scinotes/macros",%f,%t);
+
diff --git a/scilab/modules/preferences/macros/cleanmacros.bat b/scilab/modules/preferences/macros/cleanmacros.bat
new file mode 100644 (file)
index 0000000..d8e26bf
--- /dev/null
@@ -0,0 +1,13 @@
+
+rem Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+rem Copyright (C) 2009 - DIGITEO
+rem
+rem This file must be used under the terms of the CeCILL.
+rem This source file is licensed as described in the file COPYING, which
+rem you should have received as part of this distribution.  The terms
+rem are also available at
+rem http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
+@del *.bin 2>NUL
+@del lib 2>NUL
+@del names 2>NUL
diff --git a/scilab/modules/preferences/preferences.iss b/scilab/modules/preferences/preferences.iss
new file mode 100644 (file)
index 0000000..f226fdb
--- /dev/null
@@ -0,0 +1,48 @@
+;
+; Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+
+; Copyright (C) DIGITEO - 2011 - 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-en.txt
+;
+;--------------------------------------------------------------------------------------------------------------
+; Inno Setup Script (5.3 and more) for Scilab (UNICODE version required)
+;
+;--------------------------------------------------------------------------------------------------------------
+; preferences module
+;--------------------------------------------------------------------------------------------------------------
+;
+#define PREFERENCES "preferences"
+;
+Source: bin\{#PREFERENCES}.dll; DestDir: {app}\bin; Components: {#COMPN_SCILAB} and {#COMPN_JVM_MODULE}
+;
+Source: modules\{#PREFERENCES}\jar\org.scilab.modules.{#PREFERENCES}.jar; DestDir: {app}\modules\{#PREFERENCES}\jar; Components: {#COMPN_SCILAB} and {#COMPN_JVM_MODULE}
+;
+Source: modules\{#PREFERENCES}\license.txt; DestDir: {app}\modules\{#PREFERENCES}; Components: {#COMPN_SCILAB} and {#COMPN_JVM_MODULE}
+;
+Source: modules\{#PREFERENCES}\sci_gateway\{#PREFERENCES}_gateway.xml; DestDir: {app}\modules\{#PREFERENCES}\sci_gateway; Components: {#COMPN_SCILAB} and {#COMPN_JVM_MODULE}
+;
+Source: modules\{#PREFERENCES}\etc\{#PREFERENCES}.quit; DestDir: {app}\modules\{#PREFERENCES}\etc; Components: {#COMPN_SCILAB} and {#COMPN_JVM_MODULE}
+Source: modules\{#PREFERENCES}\etc\{#PREFERENCES}.start; DestDir: {app}\modules\{#PREFERENCES}\etc; Components: {#COMPN_SCILAB} and {#COMPN_JVM_MODULE}
+;
+;Source: modules\{#PREFERENCES}\includes\*.h; DestDir: {app}\modules\{#PREFERENCES}\includes; Components: {#COMPN_SCILAB} and {#COMPN_JVM_MODULE}
+;
+;Source: modules\{#PREFERENCES}\macros\buildmacros.sce; DestDir: {app}\modules\{#PREFERENCES}\macros; Components: {#COMPN_SCILAB} and {#COMPN_JVM_MODULE}
+;Source: modules\{#PREFERENCES}\macros\buildmacros.bat; DestDir: {app}\modules\{#PREFERENCES}\macros; Components: {#COMPN_PREFERENCES}
+;Source: modules\{#PREFERENCES}\macros\cleanmacros.bat; DestDir: {app}\modules\{#PREFERENCES}\macros; Components: {#COMPN_PREFERENCES}
+;Source: modules\{#PREFERENCES}\macros\lib; DestDir: {app}\modules\{#PREFERENCES}\macros; Components: {#COMPN_PREFERENCES}
+;Source: modules\{#PREFERENCES}\macros\names; DestDir: {app}\modules\{#PREFERENCES}\macros; Components: {#COMPN_PREFERENCES}
+;Source: modules\{#PREFERENCES}\macros\*.bin; DestDir: {app}\modules\{#PREFERENCES}\macros; Components: {#COMPN_PREFERENCES}
+;Source: modules\{#PREFERENCES}\macros\*.sci; DestDir: {app}\modules\{#PREFERENCES}\macros; Components: {#COMPN_PREFERENCES}
+;
+;Source: modules\{#PREFERENCES}\examples\*.*; DestDir: {app}\modules\{#PREFERENCES}\examples; Flags: recursesubdirs; Components: {#COMPN_PREFERENCES}
+;
+;Source: modules\{#PREFERENCES}\demos\*.*; DestDir: {app}\modules\{#PREFERENCES}\demos; Flags: recursesubdirs; Components: {#COMPN_PREFERENCES}
+;
+;Source: modules\{#PREFERENCES}\tests\*.*; DestDir: {app}\modules\{#PREFERENCES}\tests; Flags: recursesubdirs; Components: {#COMPN_PREFERENCES} and {#COMPN_TESTS}
+;
+;--------------------------------------------------------------------------------------------------------------
diff --git a/scilab/modules/preferences/sci_gateway/c/gw_preferences.c b/scilab/modules/preferences/sci_gateway/c/gw_preferences.c
new file mode 100644 (file)
index 0000000..13b387c
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ *  Copyright (C) 2011 - DIGITEO - Calixte DENIZET
+ *
+ *  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-en.txt
+ *
+ */
+/*--------------------------------------------------------------------------*/
+#include "gw_preferences.h"
+#include "stack-c.h"
+#include "callFunctionFromGateway.h"
+#include "BOOL.h"
+#include "scilabmode.h"
+#include "localization.h"
+#include "Scierror.h"
+#include "BOOL.h"
+#include "loadOnUseClassPath.h"
+/*--------------------------------------------------------------------------*/
+static BOOL loadedDep = FALSE;
+/*--------------------------------------------------------------------------*/
+static gw_generic_table Tab[]=
+{
+    {sci_addToolboxInfos, "addToolboxInfos"},
+    {sci_removeToolboxInfos, "removeToolboxInfos"}
+};
+/*--------------------------------------------------------------------------*/
+int gw_preferences(void)
+{
+    Rhs = Max(0, Rhs);
+
+    if ( getScilabMode() == SCILAB_NWNI)
+    {
+        Scierror(999,_("Scilab '%s' module disabled in -nogui or -nwni mode.\n"), "preferences");
+        return 0;
+    }
+
+    if (!loadedDep)
+    {
+        loadOnUseClassPath("preferences");
+        loadedDep = TRUE;
+    }
+    callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
+    return 0;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/preferences/sci_gateway/cpp/sci_addToolboxInfos.cpp b/scilab/modules/preferences/sci_gateway/cpp/sci_addToolboxInfos.cpp
new file mode 100644 (file)
index 0000000..33b22d0
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - DIGITEO - Calixte DENIZET
+ *
+ * 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-en.txt
+ *
+ */
+
+#include "ScilabPreferences.hxx"
+#include "GiwsException.hxx"
+
+extern "C"
+{
+#include "gw_preferences.h"
+#include "stack-c.h"
+#include "Scierror.h"
+#include "api_scilab.h"
+#include "localization.h"
+#include "getScilabJavaVM.h"
+#include "expandPathVariable.h"
+#include "MALLOC.h"
+}
+
+using namespace org_scilab_modules_preferences;
+
+/*--------------------------------------------------------------------------*/
+int sci_addToolboxInfos(char * fname, unsigned long fname_len)
+{
+    SciErr err;
+    int * addr = 0;
+    char * tbxName = 0;
+    char * tbxPath = 0;
+    char * expTbxPath = 0;
+    char * tbxPrefFile = 0;
+    char * expTbxPrefFile = 0;
+    char ** array[] = {&tbxName, &tbxPath, &tbxPrefFile};
+    bool error = false;
+
+    CheckLhs(1, 1);
+    CheckRhs(3, 3);
+
+    for (int i = 0; i < Rhs; i++)
+    {
+        err = getVarAddressFromPosition(pvApiCtx, i + 1, &addr);
+        if (err.iErr)
+        {
+            printError(&err, 0);
+            return 0;
+        }
+
+        if (!isStringType(pvApiCtx, addr))
+        {
+            Scierror(999, gettext("%s: Wrong type for input argument #%i: A string expected.\n"), fname, i + 1);
+            for (int j = 0; j < i; j++)
+            {
+                if (array[j])
+                {
+                    freeAllocatedSingleString(*(array[j]));
+                }
+            }
+            return 0;
+       }
+       
+       getAllocatedSingleString(pvApiCtx, addr, array[i]);
+    }
+
+    expTbxPath = expandPathVariable(const_cast<char *>(tbxPath));
+    expTbxPrefFile = expandPathVariable(const_cast<char *>(tbxPrefFile));
+
+    try
+    {
+        ScilabPreferences::addToolboxInfos(getScilabJavaVM(), tbxName, expTbxPath, expTbxPrefFile);
+    }
+    catch (const GiwsException::JniException & e)
+    {
+        Scierror(999, _("%s: A Java exception arised:\n%s"), fname, e.what());
+        error = true;
+    }
+
+    for (int i = 0; i < Rhs; i++)
+    {
+        if (array[i])
+        {
+            freeAllocatedSingleString(*(array[i]));
+        }
+    }
+    FREE(expTbxPath);
+    FREE(expTbxPrefFile);
+
+    if (!error)
+    {
+        LhsVar(1) = 0;
+        PutLhsVar();
+    }
+
+    return 0;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/preferences/sci_gateway/cpp/sci_removeToolboxInfos.cpp b/scilab/modules/preferences/sci_gateway/cpp/sci_removeToolboxInfos.cpp
new file mode 100644 (file)
index 0000000..e9e6a98
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - DIGITEO - Calixte DENIZET
+ *
+ * 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-en.txt
+ *
+ */
+
+#include "ScilabPreferences.hxx"
+#include "GiwsException.hxx"
+
+extern "C"
+{
+#include "gw_preferences.h"
+#include "stack-c.h"
+#include "Scierror.h"
+#include "api_scilab.h"
+#include "localization.h"
+#include "getScilabJavaVM.h"
+}
+
+using namespace org_scilab_modules_preferences;
+
+/*--------------------------------------------------------------------------*/
+int sci_removeToolboxInfos(char * fname, unsigned long fname_len)
+{
+    SciErr err;
+    int * addr = 0;
+    char * tbxName = 0;
+    bool error = false;
+
+    CheckLhs(1, 1);
+    CheckRhs(1, 1);
+
+    err = getVarAddressFromPosition(pvApiCtx, 1, &addr);
+    if (err.iErr)
+    {
+        printError(&err, 0);
+        return 0;
+    }
+
+    if (!isEmptyMatrix(pvApiCtx, addr))
+    {
+        if (!isStringType(pvApiCtx, addr))
+        {
+            Scierror(999, gettext("%s: Wrong type for input argument #%i: A string expected.\n"), fname, 1);
+        }
+        getAllocatedSingleString(pvApiCtx, addr, &tbxName);
+    }
+
+    try
+    {
+        ScilabPreferences::removeToolboxInfos(getScilabJavaVM(), tbxName);
+    }
+    catch (const GiwsException::JniException & e)
+    {
+        Scierror(999, _("%s: A Java exception arised:\n%s"), fname, e.what());
+        error = true;
+    }
+
+    if (tbxName)
+    {
+        freeAllocatedSingleString(tbxName);
+    }
+
+    if (!error)
+    {
+        LhsVar(1) = 0;
+        PutLhsVar();
+    }
+
+    return 0;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/preferences/sci_gateway/preferences_gateway.xml b/scilab/modules/preferences/sci_gateway/preferences_gateway.xml
new file mode 100644 (file)
index 0000000..cfc0853
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+
+<!DOCTYPE GATEWAY SYSTEM "../../functions/xml/gateway.dtd">
+<GATEWAY name="preferences">
+<!-- =================== -->
+<!--
+ Scilab
+ Interface description. In this file, we define the list of the function which
+ will be available into Scilab and the link to the "native" function.
+
+ gatewayId is the position in the hashtable 'Interfaces' defined in the
+ file SCI/modules/core/src/c/callinterf.h
+
+ primitiveId is the position in the hashtable '<module>Table Tab[]' defined
+ in the file modules/<module>/sci_gateway/c/gw_<module>.c
+
+ primitiveName is the name of the Scilab function
+
+ @author Allan CORNET
+ @date DIGITEO 2009
+ ===================
+ Don't touch if you do not know what you are doing
+-->
+<!-- =================== -->
+<PRIMITIVE gatewayId="69" primitiveId="1" primitiveName="addToolboxInfos" />
+<PRIMITIVE gatewayId="69" primitiveId="2" primitiveName="removeToolboxInfos" />
+</GATEWAY>
diff --git a/scilab/modules/preferences/src/c/DllmainPreferences.c b/scilab/modules/preferences/src/c/DllmainPreferences.c
new file mode 100644 (file)
index 0000000..caf1f15
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2009 - DIGITEO - 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-en.txt
+ *
+ */
+
+#include <windows.h> 
+/*--------------------------------------------------------------------------*/ 
+#pragma comment(lib,"../../../../bin/libintl.lib")
+/*--------------------------------------------------------------------------*/ 
+int WINAPI DllMain (HINSTANCE hInstance , DWORD reason, PVOID pvReserved)
+{
+       switch (reason) 
+       {
+       case DLL_PROCESS_ATTACH:
+               break;
+       case DLL_PROCESS_DETACH:
+               break;
+       case DLL_THREAD_ATTACH:
+               break;
+       case DLL_THREAD_DETACH:
+               break;
+       }
+       return 1;
+}
+/*--------------------------------------------------------------------------*/ 
+
diff --git a/scilab/modules/preferences/src/c/LibScilab_Import.def b/scilab/modules/preferences/src/c/LibScilab_Import.def
new file mode 100644 (file)
index 0000000..39fb8ea
--- /dev/null
@@ -0,0 +1,14 @@
+LIBRARY    LibScilab.dll
+
+
+EXPORTS
+;
+callFunctionFromGateway
+putlhsvar_
+intersci_
+getScilabMode
+com_
+freeArrayOfString
+checklhs_
+checkrhs_
+overload_
\ No newline at end of file
diff --git a/scilab/modules/preferences/src/c/preferences.rc b/scilab/modules/preferences/src/c/preferences.rc
new file mode 100644 (file)
index 0000000..7634d16
--- /dev/null
@@ -0,0 +1,96 @@
+// Microsoft Visual C++ generated resource script.
+//
+
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+//#include "afxres.h"
+#define APSTUDIO_HIDDEN_SYMBOLS
+#include "windows.h"
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// French (France) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
+#ifdef _WIN32
+LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE 
+BEGIN
+    "resource.h\0"
+END
+
+3 TEXTINCLUDE 
+BEGIN
+    "\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 5,4,0,0
+ PRODUCTVERSION 5,4,0,0
+ FILEFLAGSMASK 0x17L
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "040c04b0"
+        BEGIN
+            VALUE "FileDescription", "preferences module"
+            VALUE "FileVersion", "5, 4, 0, 0"
+            VALUE "InternalName", "preferences module"
+            VALUE "LegalCopyright", "Copyright (C) 2011"
+            VALUE "OriginalFilename", "preferences.dll"
+            VALUE "ProductName", "preferences module"
+            VALUE "ProductVersion", "5, 4, 0, 0"
+        END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x40c, 1200
+    END
+END
+
+#endif    // French (France) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
diff --git a/scilab/modules/preferences/src/c/preferences.vcxproj b/scilab/modules/preferences/src/c/preferences.vcxproj
new file mode 100644 (file)
index 0000000..9915448
--- /dev/null
@@ -0,0 +1,280 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{7B893E9F-D032-44DE-9B71-197A29C4989B}</ProjectGuid>
+    <RootNamespace>preferences</RootNamespace>
+    <Keyword>Win32Proj</Keyword>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>MultiByte</CharacterSet>
+    <WholeProgramOptimization>false</WholeProgramOptimization>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>MultiByte</CharacterSet>
+    <WholeProgramOptimization>false</WholeProgramOptimization>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup>
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)bin\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)bin\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)$(Configuration)\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)bin\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)bin\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)$(Configuration)\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
+      <Optimization>Disabled</Optimization>
+      <AdditionalIncludeDirectories>.;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../../../libs/intl;../../includes;../../../../libs/MALLOC/includes;../../../api_scilab/includes;../../../core/includes;../../../localization/includes;../../../jvm/includes;../../../fileio/includes;../../../output_stream/includes;../cpp;../jni;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;PREFERENCES_SCILAB_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MinimalRebuild>true</MinimalRebuild>
+      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+    </ClCompile>
+    <PreLinkEvent>
+      <Message>Make dependencies</Message>
+      <Command>lib /DEF:"$(ProjectDir)LibScilab_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)LibScilab.lib" 1&gt;NUL 2&gt;NUL
+</Command>
+    </PreLinkEvent>
+    <Link>
+      <AdditionalDependencies>libscilab.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
+      <ModuleDefinitionFile>
+      </ModuleDefinitionFile>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <SubSystem>Windows</SubSystem>
+      <RandomizedBaseAddress>false</RandomizedBaseAddress>
+      <DataExecutionPrevention>
+      </DataExecutionPrevention>
+      <ImportLibrary>$(SolutionDir)bin\$(ProjectName).lib</ImportLibrary>
+      <TargetMachine>MachineX86</TargetMachine>
+      <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <Midl>
+      <TargetEnvironment>X64</TargetEnvironment>
+    </Midl>
+    <ClCompile>
+      <Optimization>Disabled</Optimization>
+      <AdditionalIncludeDirectories>.;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../../../libs/intl;../../includes;../../../../libs/MALLOC/includes;../../../api_scilab/includes;../../../core/includes;../../../localization/includes;../../../jvm/includes;../../../fileio/includes;../../../output_stream/includes;../cpp;../jni;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;PREFERENCES_SCILAB_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MinimalRebuild>true</MinimalRebuild>
+      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+    </ClCompile>
+    <PreLinkEvent>
+      <Message>Make dependencies</Message>
+      <Command>lib /DEF:"$(ProjectDir)LibScilab_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)LibScilab.lib" 1&gt;NUL 2&gt;NUL
+</Command>
+    </PreLinkEvent>
+    <Link>
+      <AdditionalDependencies>libscilab.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
+      <ModuleDefinitionFile>
+      </ModuleDefinitionFile>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <SubSystem>Windows</SubSystem>
+      <RandomizedBaseAddress>false</RandomizedBaseAddress>
+      <DataExecutionPrevention>
+      </DataExecutionPrevention>
+      <ImportLibrary>$(SolutionDir)bin\$(ProjectName).lib</ImportLibrary>
+      <TargetMachine>MachineX64</TargetMachine>
+      <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
+      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+      <WholeProgramOptimization>false</WholeProgramOptimization>
+      <AdditionalIncludeDirectories>.;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../../../libs/intl;../../includes;../../../../libs/MALLOC/includes;../../../api_scilab/includes;../../../core/includes;../../../localization/includes;../../../jvm/includes;../../../fileio/includes;../../../output_stream/includes;../cpp;../jni;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;PREFERENCES_SCILAB_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <StringPooling>true</StringPooling>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>
+    </ClCompile>
+    <PreLinkEvent>
+      <Message>Make dependencies</Message>
+      <Command>lib /DEF:"$(ProjectDir)LibScilab_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)LibScilab.lib" 1&gt;NUL 2&gt;NUL
+</Command>
+    </PreLinkEvent>
+    <Link>
+      <AdditionalDependencies>libscilab.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
+      <ModuleDefinitionFile>
+      </ModuleDefinitionFile>
+      <GenerateDebugInformation>false</GenerateDebugInformation>
+      <SubSystem>Windows</SubSystem>
+      <OptimizeReferences>true</OptimizeReferences>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <LinkTimeCodeGeneration>
+      </LinkTimeCodeGeneration>
+      <RandomizedBaseAddress>false</RandomizedBaseAddress>
+      <DataExecutionPrevention>
+      </DataExecutionPrevention>
+      <ImportLibrary>$(SolutionDir)bin\$(ProjectName).lib</ImportLibrary>
+      <TargetMachine>MachineX86</TargetMachine>
+      <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <Midl>
+      <TargetEnvironment>X64</TargetEnvironment>
+    </Midl>
+    <ClCompile>
+      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+      <WholeProgramOptimization>false</WholeProgramOptimization>
+      <AdditionalIncludeDirectories>.;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../../../libs/intl;../../includes;../../../../libs/MALLOC/includes;../../../api_scilab/includes;../../../core/includes;../../../localization/includes;../../../jvm/includes;../../../fileio/includes;../../../output_stream/includes;../cpp;../jni;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;PREFERENCES_SCILAB_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <StringPooling>true</StringPooling>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>
+    </ClCompile>
+    <PreLinkEvent>
+      <Message>Make dependencies</Message>
+      <Command>lib /DEF:"$(ProjectDir)LibScilab_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)LibScilab.lib" 1&gt;NUL 2&gt;NUL
+</Command>
+    </PreLinkEvent>
+    <Link>
+      <AdditionalDependencies>libscilab.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
+      <ModuleDefinitionFile>
+      </ModuleDefinitionFile>
+      <GenerateDebugInformation>false</GenerateDebugInformation>
+      <SubSystem>Windows</SubSystem>
+      <OptimizeReferences>true</OptimizeReferences>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <LinkTimeCodeGeneration>
+      </LinkTimeCodeGeneration>
+      <RandomizedBaseAddress>false</RandomizedBaseAddress>
+      <DataExecutionPrevention>
+      </DataExecutionPrevention>
+      <ImportLibrary>$(SolutionDir)bin\$(ProjectName).lib</ImportLibrary>
+      <TargetMachine>MachineX64</TargetMachine>
+      <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <None Include="..\..\locales\en_US\preferences.pot" />
+    <None Include="LibScilab_Import.def" />
+    <None Include="..\..\Makefile.am" />
+    <None Include="..\..\preferences.iss" />
+    <None Include="..\..\sci_gateway\preferences_gateway.xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="preferences.rc" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\..\..\libs\MALLOC\MALLOC.vcxproj">
+      <Project>{6a84ad8c-ba18-4a3f-9c72-ec3df0939e9e}</Project>
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\api_scilab\api_scilab.vcxproj">
+      <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project>
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\fileio\fileio.vcxproj">
+      <Project>{4fc72d4a-80ee-4b1a-8724-0201c1a35621}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\jvm\libjvm.vcxproj">
+      <Project>{8ba2dda8-bd04-4d4d-8ee6-6caa955f7470}</Project>
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\localization\src\localization.vcxproj">
+      <Project>{ecffeb0c-1eda-45ee-9a10-b18143852e17}</Project>
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\output_stream\src\c\output_stream.vcxproj">
+      <Project>{a5911cd7-f8e8-440c-a23e-4843a0636f3a}</Project>
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_addToolboxInfos.cpp" />
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_removeToolboxInfos.cpp" />
+    <ClCompile Include="..\..\sci_gateway\c\gw_preferences.c" />
+    <ClCompile Include="..\jni\GiwsException.cpp" />
+    <ClCompile Include="..\jni\ScilabPreferences.cpp" />
+    <ClCompile Include="DllmainPreferences.c" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\jni\GiwsException.hxx" />
+    <ClInclude Include="..\jni\ScilabPreferences.hxx" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file
diff --git a/scilab/modules/preferences/src/c/preferences.vcxproj.filters b/scilab/modules/preferences/src/c/preferences.vcxproj.filters
new file mode 100644 (file)
index 0000000..d33f086
--- /dev/null
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{03fbdde8-2541-40ee-b83f-7bda6ed23378}</UniqueIdentifier>
+      <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{55490fa8-9302-4001-9210-cbc2aa6747ec}</UniqueIdentifier>
+      <Extensions>h;hpp;hxx;hm;inl</Extensions>
+    </Filter>
+    <Filter Include="localization">
+      <UniqueIdentifier>{7ed96ca6-802f-40a5-910e-a6881cf98c3d}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Libraries Dependencies">
+      <UniqueIdentifier>{a56ef58c-a5d4-410e-b230-a14d884ad982}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Libraries Dependencies\Imports">
+      <UniqueIdentifier>{e60d124f-f2a9-42ae-9bd7-2d37894651db}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Resource Files">
+      <UniqueIdentifier>{abf739f5-063b-407b-a7a1-8b18fdebd6ca}</UniqueIdentifier>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\locales\en_US\preferences.pot">
+      <Filter>localization</Filter>
+    </None>
+    <None Include="LibScilab_Import.def">
+      <Filter>Libraries Dependencies\Imports</Filter>
+    </None>
+    <None Include="..\..\Makefile.am" />
+    <None Include="..\..\preferences.iss" />
+    <None Include="..\..\sci_gateway\preferences_gateway.xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="preferences.rc">
+      <Filter>Resource Files</Filter>
+    </ResourceCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="DllmainPreferences.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\jni\GiwsException.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\jni\ScilabPreferences.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\sci_gateway\c\gw_preferences.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_addToolboxInfos.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_removeToolboxInfos.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\jni\GiwsException.hxx">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\jni\ScilabPreferences.hxx">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Button.java b/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Button.java
new file mode 100644 (file)
index 0000000..aa0d79e
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - Pierre GRADIT
+ *
+ * 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-en.txt
+ *
+ */
+
+package org.scilab.modules.preferences.Component;
+
+import org.scilab.modules.gui.bridge.pushbutton.SwingScilabPushButton;
+import org.scilab.modules.preferences.XCommonManager;
+import org.scilab.modules.preferences.XComponent;
+import org.scilab.modules.preferences.XConfigManager;
+import org.w3c.dom.Node;
+
+/** Implementation of Button compliant with extended management.
+ *
+ * @author Pierre GRADIT
+ *
+ */
+//public class Button extends JButton implements XComponent {
+public class Button extends SwingScilabPushButton implements XComponent {
+
+    /** Universal identifier for serialization.
+     *
+     */
+    private static final long serialVersionUID = -3412653691044553310L;
+
+    
+    private String cachedStatus = "enabled";
+    
+    /** Define the set of actuators.
+    *
+    * @return array of actuator names.
+    */
+    public final String [] actuators() {
+        String [] actuators = {"enable", "text"};
+        return actuators;
+    }
+
+    /** Constructor.
+     *
+     * @param peer : associated view DOM node.
+     */
+    public Button(final Node peer) {
+        super();
+        refresh(peer);
+    }
+
+    /** Refresh the component by the use of actuators.
+    *
+    * @param peer the corresponding view DOM node
+    */
+    public final void refresh(final Node peer) {
+        String text = XCommonManager.getAttribute(peer, "text", XCommonManager.NAV);
+        if (!text.equals(text())) {
+            text(text);
+        }
+        String enable     = XConfigManager.getAttribute(peer , "enable", "true");
+        setEnabled(enable.equals("true"));
+
+    }
+
+    /** Sensor for 'text' attribute.
+     *
+     * @return the attribute value.
+     */
+    public final String text() {
+        return getText();
+    }
+
+    /** Actuator for 'text' attribute.
+     *
+     * @param text : the attribute value.
+     */
+    public final void text(final String text) {
+        setText(text);
+    }
+
+   /** Developer serialization method.
+     *
+     * @return equivalent signature.
+     */
+    public final String toString() {
+        String signature = "Button";
+
+        if (!text().equals(XConfigManager.NAV)) {
+            signature += " text='" + text() + "'";
+        }
+
+        return signature;
+    }
+
+
+}
+
+
diff --git a/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Checkbox.java b/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Checkbox.java
new file mode 100644 (file)
index 0000000..d2bd354
--- /dev/null
@@ -0,0 +1,143 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - Pierre GRADIT
+ *
+ * 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-en.txt
+ *
+ */
+
+package org.scilab.modules.preferences.Component;
+
+import org.scilab.modules.preferences.XComponent;
+import org.scilab.modules.preferences.XChooser;
+import org.scilab.modules.preferences.XConfigManager;
+import org.scilab.modules.gui.bridge.checkbox.SwingScilabCheckBox;
+
+import org.w3c.dom.Node;
+
+/** Implementation of Checkbox compliant with extended management.
+*
+* @author Pierre GRADIT
+*
+*/
+public class Checkbox extends SwingScilabCheckBox implements XComponent, XChooser {
+
+    /** Universal identifier for serialization.
+     *
+     */
+    private static final long serialVersionUID = -7007541669965737408L;
+
+    /** Define the set of actuators.
+    *
+    * @return array of actuator names.
+    */
+    public final String [] actuators() {
+        String [] actuators = {"text", "checked"};
+        return actuators;
+    }
+
+    /** Constructor.
+    *
+    * @param peer : associated view DOM node.
+    */
+    public Checkbox(final Node peer) {
+        super();
+        setOpaque(false);
+        refresh(peer);
+    }
+
+    /** Refresh the component by the use of actuators.
+    *
+    * @param peer the corresponding view DOM node
+    */
+    public final void refresh(final Node peer) {
+        String text = XConfigManager.getAttribute(peer , "text");
+        if (!text.equals(text())) {
+            text(text);
+        }
+
+        String checked = XConfigManager.getAttribute(peer , "checked");
+        if (!checked.equals(checked())) {
+            checked(checked);
+        }
+
+    }
+
+    /** Sensor for 'text' attribute.
+    *
+    * @return the attribute value.
+    */
+    public final String text() {
+        String text = getText();
+        if (text != null) {
+            return text;
+        } else {
+            return XConfigManager.NAV;
+        }
+    }
+
+    /** Actuator for 'text' attribute.
+    *
+    * @param text : the attribute value.
+    */
+    public final void text(final String text) {
+       if (text!=XConfigManager.NAV) {
+            setText(text);
+        } else {
+            setText(null);
+        }
+    }
+
+    /** Sensor for 'checked' attribute.
+    *
+    * @return the attribute value.
+    */
+    public final String checked() {
+        boolean state = isSelected();
+        if (state) {
+            return "checked";
+        } else {
+            return "unchecked";
+        }
+    }
+
+    /** Actuator for 'checked' attribute.
+    *
+    * @param text : the attribute value.
+    */
+    public final void checked(final String checked) {
+        boolean state =  checked.equals("checked");
+        setSelected(state);
+    }
+
+    /** Actual response read by the listener.
+    *
+    * @return response read by the listener.
+    */
+    public final String choose() {
+        if (isSelected()) {
+            return "checked";
+        }
+        return "unchecked";
+    }
+
+    /** Developer serialization method.
+    *
+    * @return equivalent signature.
+    */
+    public final String toString() {
+        String signature = "CHECKBOX";
+        if (!text().equals(XConfigManager.NAV)) {
+            signature += " text='" + text() + "'";
+        }
+        if (!checked().equals(XConfigManager.NAV)) {
+            signature += " checked='" + checked() + "'";
+        }
+        return signature;
+    }
+}
+
diff --git a/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Color.java b/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Color.java
new file mode 100644 (file)
index 0000000..faad43c
--- /dev/null
@@ -0,0 +1,161 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - Pierre GRADIT
+ *
+ * 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-en.txt
+ *
+ */
+
+package org.scilab.modules.preferences.Component;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+
+import org.scilab.modules.gui.bridge.colorchooser.SwingScilabColorChooser;
+import org.scilab.modules.preferences.XChooser;
+import org.scilab.modules.preferences.XComponent;
+import org.scilab.modules.preferences.XCommonManager;
+import javax.swing.JLabel;
+import org.w3c.dom.Node;
+
+//TODO import org.scilab.modules.gui.bridge.label.SwingScilabLabel;
+// - text does not appear.
+
+/** Implementation of Label compliant with extended management.
+*
+* @author Pierre GRADIT
+* TODO http://www.java-tips.org/java-se-tips/javax.swing/how-to-use-popup-menus-in-swing-applications.html
+*/
+public class Color extends JLabel implements XComponent, XChooser, MouseListener {
+
+  /**
+    * 
+    */
+    private static final long serialVersionUID = 5598263085800128888L;
+
+/** Define the set of actuators.
+    *
+    * @return array of actuator names.
+    */
+    public final String [] actuators() {
+        String [] actuators = {"color"};
+        return actuators;
+    }
+
+    /** Constructor.
+    *
+    * @param peer : associated view DOM node.
+    */
+    public Color(final Node peer) {
+        super();
+        setText("\u2588\u2588\u2588\u2588");
+        String color = XCommonManager.getAttribute(peer , "color", "000000");
+        color(color);
+        setOpaque(false);
+        addMouseListener((MouseListener) this);
+    }
+
+    /** Refresh the component by the use of actuators.
+    *
+    * @param peer the corresponding view DOM node
+    */
+    public final void refresh(final Node peer) {
+        String color = XCommonManager.getAttribute(peer , "color", "000000");
+        if (!color.equals(color())) {
+               color(color);
+        }
+    }
+
+    /** Sensor for 'color' attribute.
+    *
+    * @return the attribute value.
+    */
+    public final String color() {
+       java.awt.Color color = getForeground();
+        return XCommonManager.getColor(color);
+    }
+
+    /** Actuator for 'color' attribute.
+    *
+    * @param text : the attribute value.
+    */
+    public final void color(final String color) {
+       java.awt.Color jColor= XCommonManager.getColor(color);
+       setForeground(jColor);
+    }
+
+   /** Developer serialization method.
+    *
+    * @return equivalent signature.
+    */
+    public final String toString() {
+        String signature = "Color";
+        signature += " color='" + color() + "'";
+        return signature;
+    }
+
+    /** Event management
+     * 
+     */
+    ActionListener actionListener = null;
+    /** Color chooser must be invoked on mouse click, 
+     *  and post actionEvent
+     */
+    private SwingScilabColorChooser colorChooser;
+
+    /** Registration of a single listener. 
+     * @param listener
+     */
+    public void addActionListener(ActionListener listener) {
+       actionListener = listener;
+    }
+
+    /** External consultation 
+     *
+     */
+    public String choose() {
+       java.awt.Color jColor = colorChooser.getSelectedColor();
+           return XCommonManager.getColor(jColor);
+    }
+    
+    /** Mouse listener used callback. 
+     * @param e : event
+     */
+    public void mouseClicked(final MouseEvent e) {
+        java.awt.Color jColor = XCommonManager.getColor(color());
+        ActionEvent transmit  = new ActionEvent(
+             this, 
+             e.getID(), 
+             "Color change", 
+             e.getWhen() + 1, 
+             e.getModifiers());
+        colorChooser = new SwingScilabColorChooser(jColor);
+        colorChooser.displayAndWait();
+        if (actionListener != null) {
+            actionListener.actionPerformed(transmit);
+        } else {
+            System.out.println("----> No registered listener!");
+        }
+    }
+
+    /** Mouse listener unused callback. @param e : event*/
+    public void mouseEntered(final MouseEvent e) {
+    }
+    /** Mouse listener unused callback. @param e : event*/
+    public void mouseExited(final MouseEvent e) {
+    }
+    /** Mouse listener unused callback. @param e : event*/
+    public void mousePressed(final MouseEvent e) {
+    }
+    /** Mouse listener unused callback. @param e : event*/
+    public void mouseReleased(final MouseEvent e) {
+    }
+
+}
+
diff --git a/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Entry.java b/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Entry.java
new file mode 100644 (file)
index 0000000..9ba1082
--- /dev/null
@@ -0,0 +1,128 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - Pierre GRADIT
+ *
+ * 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-en.txt
+ *
+ */
+
+package org.scilab.modules.preferences.Component;
+
+import javax.swing.JTextField;
+
+import org.scilab.modules.preferences.XCommonManager;
+import org.scilab.modules.preferences.XComponent;
+import org.scilab.modules.preferences.XChooser;
+import org.scilab.modules.preferences.XConfigManager;
+import org.scilab.modules.gui.bridge.checkbox.SwingScilabCheckBox;
+
+import org.w3c.dom.Node;
+
+/** Implementation of Entry compliant with extended management.
+*
+* @author Pierre GRADIT
+*
+*/
+public class Entry extends JTextField implements XComponent, XChooser {
+
+    /** Universal identifier for serialization.
+     *
+     */
+    private static final long serialVersionUID = -7007541669965737408L;
+
+    /** Define the set of actuators.
+    *
+    * @return array of actuator names.
+    */
+    public final String [] actuators() {
+        String [] actuators = {"enable", "text", "columns"};
+        return actuators;
+    }
+
+    /** Constructor.
+    *
+    * @param peer : associated view DOM node.
+    */
+    public Entry(final Node peer) {
+        super();
+        refresh(peer);
+    }
+
+    /** Refresh the component by the use of actuators.
+    *
+    * @param peer the corresponding view DOM node
+    */
+    public final void refresh(final Node peer) {
+        String text = XCommonManager.getAttribute(peer , "text");
+        String columns = XCommonManager.getAttribute(peer , "columns");
+        if (!text.equals(text())) {
+            text(text);
+        }
+        if (!columns.equals(columns())) {
+               columns(columns);
+        }
+        String enable     = XConfigManager.getAttribute(peer , "enable", "true");
+        setEnabled(enable.equals("true"));
+    }
+
+    /** Sensor for 'text' attribute.
+    *
+    * @return the attribute value.
+    */
+    public final String text() {
+        return getText();
+    }
+
+    /** Actuator for 'text' attribute.
+    *
+    * @param text : the attribute value.
+    */
+    public final void columns(final String columns) {
+        if (! (columns.equals(XCommonManager.NAV))) {
+            int jColumns = Integer.parseInt(columns);
+            setColumns(jColumns);
+        }
+    }
+
+    /** Sensor for 'columns' attribute.
+    *
+    * @return the attribute value.
+    */
+    public final String columns() {
+        return "" + getColumns();
+    }
+
+    /** Actuator for 'text' attribute.
+    *
+    * @param text : the attribute value.
+    */
+    public final void text(final String text) {
+        setText(text);
+    }
+
+    
+    /** Actual response read by the listener.
+    *
+    * @return response read by the listener.
+    */
+    public final String choose() {
+        return text();
+    }
+
+    /** Developer serialization method.
+    *
+    * @return equivalent signature.
+    */
+    public final String toString() {
+        String signature = "Entry";
+        if (!text().equals(XCommonManager.NAV)) {
+            signature += " text='" + text() + "'";
+        }
+        return signature;
+    }
+}
+
diff --git a/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/File.java b/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/File.java
new file mode 100644 (file)
index 0000000..9e66b5f
--- /dev/null
@@ -0,0 +1,209 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - Pierre GRADIT
+ *
+ * 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-en.txt
+ *
+ */
+
+package org.scilab.modules.preferences.Component;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+
+import javax.swing.JTextField;
+
+import org.scilab.modules.preferences.XCommonManager;
+import org.scilab.modules.preferences.XComponent;
+import org.scilab.modules.preferences.XChooser;
+import org.scilab.modules.preferences.XConfigManager;
+import org.scilab.modules.gui.bridge.colorchooser.SwingScilabColorChooser;
+import org.scilab.modules.gui.filechooser.Juigetfile;
+
+import org.w3c.dom.Node;
+
+/** Implementation of Entry compliant with extended management.
+*
+* @author Pierre GRADIT
+*
+*/
+public class File extends JTextField implements XComponent, XChooser, MouseListener {
+
+    /** Universal identifier for serialization.
+     *
+     */
+    private static final long serialVersionUID = -7007541669965737408L;
+
+    /** Define the set of actuators.
+    *
+    * @return array of actuator names.
+    */
+    public final String [] actuators() {
+        String [] actuators = {"enable", "href", "desc", "mask"};
+        return actuators;
+    }
+
+    /** Constructor.
+    *
+    * @param peer : associated view DOM node.
+    */
+    public File(final Node peer) {
+        super();
+        refresh(peer);
+        addMouseListener(this);
+    }
+
+    /** Refresh the component by the use of actuators.
+    *
+    * @param peer the corresponding view DOM node
+    */
+    public final void refresh(final Node peer) {
+        String href   = XCommonManager.getAttribute(peer , "href");
+        String mask   = XCommonManager.getAttribute(peer , "mask");
+        String desc   = XCommonManager.getAttribute(peer , "desc");
+        
+        if (!href.equals(href())) {
+            href(href);
+        }
+        if (!mask.equals(mask())) {
+            mask(mask);
+        }
+        if (!desc.equals(desc())) {
+            desc(desc);
+        }
+        String enable     = XConfigManager.getAttribute(peer , "enable", "true");
+        setEnabled(enable.equals("true"));
+    }
+
+    String jMask, jDesc;
+    
+    /** Sensor for 'mask' attribute.
+    *
+    * @return the attribute value.
+    */
+    public final String mask() {
+        return jMask;
+    }
+
+    /** Actuator for 'mask' attribute.
+    *
+    * @param mask : the attribute value.
+    */
+    public final void mask(final String mask) {
+        jMask = mask;
+    }
+
+    /** Sensor for 'desc' attribute.
+    *
+    * @return the attribute value.
+    */
+    public final String desc() {
+        return jDesc;
+    }
+
+    /** Actuator for 'desc' attribute.
+    *
+    * @param text : the attribute value.
+    */
+    public final void desc(final String desc) {
+       jDesc = desc;
+    }
+
+    
+    /** Sensor for 'href' attribute.
+    *
+    * @return the attribute value.
+    */
+    public final String href() {
+        return getText();
+    }
+
+    /** Actuator for 'href' attribute.
+    *
+    * @param text : the attribute value.
+    */
+    public final void href(final String href) {
+        setText(href);
+    }
+
+    public void mouseClicked(final MouseEvent e) {
+        ActionEvent transmit  = new ActionEvent(
+             this, 
+             e.getID(), 
+             "File change", 
+             e.getWhen() + 1, 
+             e.getModifiers());
+        if (actionListener != null) {
+            actionListener.actionPerformed(transmit);
+        } else {
+            System.out.println("----> No registered listener!");
+        }
+    }
+
+    /** Mouse listener unused callback. @param e : event*/
+    public void mouseEntered(final MouseEvent e) {
+    }
+    /** Mouse listener unused callback. @param e : event*/
+    public void mouseExited(final MouseEvent e) {
+    }
+    /** Mouse listener unused callback. @param e : event*/
+    public void mousePressed(final MouseEvent e) {
+    }
+    /** Mouse listener unused callback. @param e : event*/
+    public void mouseReleased(final MouseEvent e) {
+    }
+
+    
+    /** Actual response read by the listener.
+    *
+    * @return response read by the listener.
+    */
+    public final String choose() {
+        String mask[] = {jMask};
+        String desc[] = {jDesc};
+        Juigetfile.uigetfile(mask, desc);
+        String selection[] = Juigetfile.getSelection();
+        if (selection.length > 0) {
+            return selection[0];
+        }
+        return href();
+    }
+
+    /** Developer serialization method.
+    *
+    * @return equivalent signature.
+    */
+    public final String toString() {
+        String signature = "File";
+        if (!href().equals(XCommonManager.NAV)) {
+            signature += " href='" + href() + "'";
+        }
+        if (!desc().equals(XCommonManager.NAV)) {
+            signature += " desc='" + desc() + "'";
+        }
+        if (!mask().equals(XCommonManager.NAV)) {
+            signature += " href='" + mask() + "'";
+        }
+        return signature;
+    }
+
+    /** Row selection management.
+    *
+    */
+    private ActionListener actionListener = null;
+
+    /** Registration of a single listener.
+     * @param listener for the unique actionListener.
+     */
+    public final void addActionListener(final ActionListener listener) {
+        actionListener = listener;
+    }
+
+}
+
diff --git a/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Grid.java b/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Grid.java
new file mode 100644 (file)
index 0000000..4022935
--- /dev/null
@@ -0,0 +1,142 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - Pierre GRADIT
+ *
+ * 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-en.txt
+ *
+ */
+
+package org.scilab.modules.preferences.Component;
+
+import org.scilab.modules.preferences.XCommonManager;
+import org.scilab.modules.preferences.XComponent;
+import javax.swing.JPanel;
+import org.w3c.dom.Node;
+import org.scilab.modules.preferences.XConfigManager;
+import java.awt.Component;
+import java.awt.GridBagLayout;
+import java.awt.GridBagConstraints;
+import java.awt.Insets;
+
+/** Implementation of Panel compliant with extended management.
+*
+* @author Pierre GRADIT
+*
+*/
+public class Grid extends JPanel implements XComponent {
+
+    /** Universal identifier for serialization.
+     *
+     */
+    private static final long serialVersionUID = 3462302313959678932L;
+
+    /** Define the set of actuators.
+     *
+     * @return array of actuator names.
+     */
+    public final String [] actuators() {
+        String [] actuators = {};
+        return actuators;
+    }
+
+    /** Constructor.
+    *
+    * @param peer : associated view DOM node.
+    */
+    public Grid(final Node peer) {
+        super();
+        setLayout(new GridBagLayout());
+        XCommonManager.setDimension(this, peer);
+        XCommonManager.drawConstructionBorders(this);
+    }
+
+    /** Translation of constraints.
+    *
+    */
+    void setConstraints(GridBagConstraints gbc, Object constraints) {
+        Node component = (Node) constraints;
+        gbc.gridx      = XCommonManager.getInt(component, "gridx",      1) - 1;
+        gbc.gridy      = XCommonManager.getInt(component, "gridy",      1) - 1;
+        gbc.gridwidth  = XCommonManager.getInt(component, "gridwidth",  1);
+        gbc.gridheight = XCommonManager.getInt(component, "gridheight", 1);
+        gbc.weightx    = XCommonManager.getInt(component, "weightx",    1);
+        gbc.weighty    = XCommonManager.getInt(component, "weighty"   , 1);
+        gbc.ipadx      = XCommonManager.getInt(component, "ipadx",      0);
+        gbc.ipady      = XCommonManager.getInt(component, "ipady"   ,   0);
+
+        if (XConfigManager.getAttribute(component, "anchor").equals("north")) {
+            gbc.anchor = GridBagConstraints.NORTH;
+        }
+        if (XConfigManager.getAttribute(component, "anchor").equals("west")) {
+            gbc.anchor = GridBagConstraints.WEST;
+        }
+        if (XConfigManager.getAttribute(component, "insets").equals("large")) {
+            gbc.insets = new Insets(5,5,5,5);
+        }
+        if (XConfigManager.getAttribute(component, "insets").equals("huge")) {
+            gbc.insets = new Insets(15,15,15,15);
+        }
+        if (XConfigManager.getAttribute(component, "fill").equals("none")) {
+            gbc.fill = GridBagConstraints.NONE;
+        }
+        if (XConfigManager.getAttribute(component, "fill").equals("horizontal")) {
+            gbc.fill = GridBagConstraints.HORIZONTAL;
+        }
+        if (XConfigManager.getAttribute(component, "fill").equals("vertical")) {
+            gbc.fill =  GridBagConstraints.VERTICAL;
+        }
+        if (XConfigManager.getAttribute(component, "fill").equals("both")) {
+            gbc.fill =  GridBagConstraints.BOTH;
+        }
+    }
+
+    /** Overloaded add method to embed grid layout.
+    *
+    */
+    public void add(Component child, Object constraints, int index) {
+        GridBagConstraints gbc = new GridBagConstraints();
+        gbc.fill = GridBagConstraints.HORIZONTAL;
+
+        setConstraints(gbc, constraints);
+        super.add(child, gbc);
+    }
+
+    /** Overloaded add method to embed grid layout.
+    *
+    */
+    public void add(Component child, Object constraints) {
+        int index = getComponentCount();
+        add(child, constraints, index);
+    }
+
+    //TODO:
+    public void remove(Component child) {
+        getLayout().removeLayoutComponent(child);
+        super.remove(child);
+        revalidate();
+        System.err.println("- - - - - REMOVE NOT IMPLEMENTABLE IN GRIDS!");
+    }
+
+    /** Refresh the component by the use of actuators.
+    *
+    * @param peer the corresponding view DOM node
+    */
+    public void refresh(final Node peer) {
+        revalidate();
+    }
+
+    /** Developer serialization method.
+    *
+    * @return equivalent signature.
+    */
+    public final String toString() {
+        String signature = "VBox";
+
+        return signature;
+    }
+}
+
diff --git a/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/HBox b/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/HBox
new file mode 100644 (file)
index 0000000..4202011
--- /dev/null
@@ -0,0 +1 @@
+to be deleted
diff --git a/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/HBox.java b/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/HBox.java
new file mode 100644 (file)
index 0000000..fc51c24
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - Pierre GRADIT
+ *
+ * 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-en.txt
+ *
+ */
+
+package org.scilab.modules.preferences.Component;
+
+import org.scilab.modules.preferences.XComponent;
+
+import javax.swing.BoxLayout;
+import javax.swing.JComponent;
+import javax.swing.JPanel;
+import org.w3c.dom.Node;
+import org.scilab.modules.preferences.XConfigManager;
+import java.awt.Component;
+
+/** Implementation of Panel compliant with extended management.
+*
+* @author Pierre GRADIT
+*
+*/
+public class HBox extends JPanel implements XComponent {
+
+    /** Universal identifier for serialization.
+     *
+     */
+    private static final long serialVersionUID = 3462302313959678932L;
+
+    /** Define the set of actuators.
+     *
+     * @return array of actuator names.
+     */
+    public final String [] actuators() {
+        String [] actuators = {};
+        return actuators;
+    }
+
+    /** Constructor.
+    *
+    * @param peer : associated view DOM node.
+    */
+    public HBox(final Node peer) {
+        super();
+        BoxLayout box = new BoxLayout(this, BoxLayout.LINE_AXIS);
+        setLayout(box);
+        XConfigManager.setDimension(this, peer);
+        XConfigManager.drawConstructionBorders(this);
+    }
+
+    /** Overloaded add method to embed grid layout.
+    *
+    */
+    public void add(Component child, Object constraints, int index) {
+        if (child instanceof JComponent) {
+             ((JComponent)child).setAlignmentX(LEFT_ALIGNMENT);
+        }
+        super.add(child, constraints, index);
+    }
+
+    /** Overloaded add method to embed grid layout.
+    *
+    */
+    public void add(Component child, Object constraints) {
+        if (child instanceof JComponent) {
+            ((JComponent)child).setAlignmentX(LEFT_ALIGNMENT);
+        }
+        super.add(child, constraints);
+    }
+
+    /** Refresh the component by the use of actuators.
+    *
+    * @param peer the corresponding view DOM node
+    */
+    public void refresh(final Node peer) {
+    }
+
+    /** Developer serialization method.
+    *
+    * @return equivalent signature.
+    */
+    public final String toString() {
+        String signature = "HBox";
+
+        return signature;
+    }
+}
+
diff --git a/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Icon.java b/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Icon.java
new file mode 100644 (file)
index 0000000..6f71daf
--- /dev/null
@@ -0,0 +1,109 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - Pierre GRADIT
+ *
+ * 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-en.txt
+ *
+ */
+
+package org.scilab.modules.preferences.Component;
+
+import org.scilab.modules.preferences.XComponent;
+import org.scilab.modules.preferences.XConfigManager;
+import javax.swing.JLabel;
+import javax.swing.ImageIcon;
+import org.w3c.dom.Node;
+
+//TODO import org.scilab.modules.gui.bridge.label.SwingScilabLabel;
+// - setIcon() and getIcon() not reachable...
+
+/** Implementation of Label compliant with extended management.
+*
+* @author Pierre GRADIT
+*
+*/
+public class Icon extends JLabel implements XComponent {
+
+    /** Universal identifier for serialization.
+     *
+     */
+    private static final long serialVersionUID = 3026097634733924562L;
+
+    /** Path for icons.
+    *
+    */
+    public static final   String   SCILAB_XICONS  = System.getenv("SCI")
+        + "/modules/gui/images/icons/16x16/actions/";
+
+    public static final   String   SCILAB_ICONS  = System.getenv("SCI")
+        + "/modules/gui/images/icons/";
+
+    /** Define the set of actuators.
+    *
+    * @return array of actuator names.
+    */
+    public final String [] actuators() {
+        String [] actuators = {"src"};
+        return actuators;
+    }
+
+    /** Constructor.
+    *
+    * @param peer : associated view DOM node.
+    */
+    public Icon(final Node peer) {
+        super();
+
+        String src = XConfigManager.getAttribute(peer , "src");
+        src(src);
+    }
+
+    /** Refresh the component by the use of actuators.
+    *
+    * @param peer the corresponding view DOM node
+    */
+    public final void refresh(final Node peer) {
+
+        String src = XConfigManager.getAttribute(peer , "src");
+        if (!src.equals(src())) {
+            src(src);
+        }
+    }
+
+    /** Sensor for 'src' attribute.
+    *
+    * @return the attribute value.
+    */
+    public final String src() {
+        ImageIcon icon = (ImageIcon) getIcon();
+        return icon.getDescription();
+    }
+
+    /** Actuator for 'src' attribute.
+    *
+    * @param src : the attribute value.
+    */
+    public final void src(final String src) {
+        ImageIcon icon = new ImageIcon(SCILAB_XICONS + src);
+        if (icon.getImageLoadStatus() == 4) {
+            icon = new ImageIcon(SCILAB_ICONS + src);
+        }
+        icon.setDescription(src);
+        setIcon(icon);
+    }
+
+    /** Developer serialization method.
+    *
+    * @return equivalent signature.
+    */
+    public final String toString() {
+        String signature = "Icon";
+
+        return signature;
+    }
+}
+
diff --git a/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Label.java b/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Label.java
new file mode 100644 (file)
index 0000000..32a6576
--- /dev/null
@@ -0,0 +1,331 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - Pierre GRADIT
+ *
+ * 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-en.txt
+ *
+ */
+
+package org.scilab.modules.preferences.Component;
+
+import org.scilab.modules.preferences.XCommonManager;
+import org.scilab.modules.preferences.XComponent;
+import org.scilab.modules.preferences.XConfigManager;
+import javax.swing.JLabel;
+import javax.swing.SwingConstants;
+import java.awt.Color;
+import java.awt.Font;
+
+import org.w3c.dom.Node;
+
+/** Implementation of Label compliant with extended management.
+*
+* @author Pierre GRADIT
+*
+*/
+public class Label extends JLabel implements XComponent {
+
+    /** Universal identifier for serialization.
+     *
+     */
+    private static final long serialVersionUID = -4842434795956015957L;
+
+    /** Define the set of actuators.
+    *
+    * @return array of actuator names.
+    */
+    public final String [] actuators() {
+        String [] actuators = {"text", "foreground", "background", 
+            "tooltip", "font-family", "font-face", "font-size"};//TODO
+        return actuators;
+    }
+
+    /** Constructor.
+    *
+    * @param peer : associated view DOM node.
+    */
+    public Label(final Node peer) {
+        super();
+
+        String text = XConfigManager.getAttribute(peer , "text");
+        text(text);
+
+        String tooltip = XConfigManager.getAttribute(peer , "tooltip");
+        tooltip(tooltip);
+
+        String background = XConfigManager.getAttribute(peer , "background");
+        background(background);
+
+        String foreground = XConfigManager.getAttribute(peer , "foreground");
+        foreground(foreground);
+
+        String fontFamily = XConfigManager.getAttribute(peer , "font-family", fontFamily());
+        fontFamily(fontFamily);
+
+        String fontFace = XConfigManager.getAttribute(peer , "font-face", fontFace());
+        fontFace(fontFace);
+
+        String fontSize = XConfigManager.getAttribute(peer , "font-size", fontSize());
+        fontSize(fontSize);
+
+    }
+
+    /** Refresh the component by the use of actuators.
+    *
+    * @param peer the corresponding view DOM node
+    */
+    public void refresh(final Node peer) {
+
+        String text = XConfigManager.getAttribute(peer , "text");
+        if (!text.equals(text())) {
+            text(text);
+        }
+
+        String tooltip = XConfigManager.getAttribute(peer , "tooltip");
+        if (!tooltip.equals(tooltip())) {
+            tooltip(tooltip);
+        }
+
+        String background = XConfigManager.getAttribute(peer , "background");
+        if (!background.equals(background())) {
+            background(background);
+        }
+
+        String foreground = XConfigManager.getAttribute(peer , "foreground");
+        if (!foreground.equals(foreground())) {
+            foreground(foreground);
+        }
+
+        String fontFamily = XConfigManager.getAttribute(peer , "font-family", fontFamily());
+        if (!fontFamily.equals(fontFamily())) {
+            fontFamily(fontFamily);
+        }
+
+        String fontFace = XConfigManager.getAttribute(peer , "font-face", fontFace());
+        if (!fontFace.equals(fontFace())) {
+            foreground(fontFace);
+        }
+
+        String fontSize = XConfigManager.getAttribute(peer , "font-size", fontSize());
+        if (!fontSize.equals(fontSize())) {
+               fontSize(fontSize);
+        }
+
+        String halign     = XConfigManager.getAttribute(peer , "halign", "left");
+        if (halign.equals("left")) {
+            setHorizontalAlignment(SwingConstants.LEFT);
+        }
+        if (halign.equals("right")) {
+            setHorizontalAlignment(SwingConstants.RIGHT);
+        }
+
+        setRequestFocusEnabled(true);
+        setFocusable(true);
+    }
+
+    /** Sensor for 'text' attribute.
+    *
+    * @return the attribute value.
+    */
+    public final String text() {
+        return getText();
+    }
+
+    /** Sensor for 'tooltip' attribute.
+    *
+    * @return the attribute value.
+    */
+    public final String tooltip() {
+        String tooltip = getToolTipText();
+        if (tooltip == null) {
+                return "";
+               }
+        return tooltip;
+    }
+
+    /** Sensor for 'foreground' attribute.
+    *
+    * @return the attribute value.
+    */
+    public final String foreground() {
+        if (getForeground().equals(getParent().getForeground())) {
+            return XConfigManager.NAV;
+        } else {
+            return XConfigManager.getColor(getForeground());
+        }
+    }
+
+    /** Sensor for 'background' attribute.
+    *
+    * @return the attribute value.
+    */
+    public final String background() {
+        if (getForeground().equals(getParent().getBackground())) {
+            return XConfigManager.NAV;
+        } else {
+            return XConfigManager.getColor(getBackground());
+        }
+    }
+
+    /** Sensor for 'font-family' attribute.
+    *
+    * @return the attribute value.
+    */
+    public final String fontFamily() {
+        return getFont().getFamily();
+    }
+
+    /** Sensor for 'font-size' attribute.
+    *
+    * @return the attribute value.
+    */
+    public final String fontSize() {
+        return "" + getFont().getSize();
+    }
+
+    /** Sensor for 'font-face' attribute.
+    *
+    * @return the attribute value.
+    */
+    public final String fontFace() {
+        switch (getFont().getStyle()) {
+        case Font.PLAIN :  return "plain";
+        case Font.ITALIC : return "italic";
+        case Font.BOLD :   return "bold";
+        case 3 :           return "bold italic";
+        }
+        return XCommonManager.NAV;
+    }
+
+    /** Actuator for 'font-family' attribute.
+    *
+    * @return the attribute value.
+    */
+    public final void fontFamily(String fontFamily) {
+        Font font = new Font(
+            fontFamily,
+            getFont().getStyle(),
+            getFont().getSize());
+        setFont(font);
+    }
+
+    /** Actuator for 'font-size' attribute.
+    *
+    * @return the attribute value.
+    */
+    public final void fontSize(String fontSize) {
+        Font font = new Font(
+            getFont().getFamily(), 
+            getFont().getStyle(), 
+            Integer.parseInt(fontSize));
+        setFont(font);
+    }
+
+    /** Accelerator for 'font-face' actuator.
+     * 
+     * @param xFace
+     * @return
+     */
+    private int getStyle(String xFace) {
+        if (xFace.equals("plain"))       return Font.PLAIN;
+        if (xFace.equals("italic"))      return Font.ITALIC;
+        if (xFace.equals("bold"))        return Font.BOLD;
+        if (xFace.equals("bold italic")) return Font.BOLD + Font.ITALIC;
+        return -1;
+    }
+    /** Actuator for 'font-face' attribute.
+    *
+    * @return the attribute value.
+    */
+    public final void fontFace(String fontFace) {
+        Font font = new Font(
+                getFont().getFamily(), 
+                getStyle(fontFace), 
+                getFont().getSize());
+        setFont(font);
+    }
+
+    /** Actuator for 'text' attribute.
+    *
+    * @param text : the attribute value.
+    */
+    public final void text(final String text) {
+        setText(text);
+    }
+
+    /** Actuator for 'tooltip' attribute.
+    *
+    * @param text : the attribute value.
+    */
+    public final void tooltip(String tooltip) {
+        if (tooltip.equals(XCommonManager.NAV)
+         || tooltip.equals("")
+         ) {
+            tooltip = null;
+        }
+        setToolTipText(tooltip);
+    }
+
+    /** Actuator for 'foreground' attribute.
+    *
+    * @param foreground : the attribute value.
+    */
+    public final void foreground(final String foreground) {
+        if (foreground.equals(XConfigManager.NAV)) {
+            setForeground(null);
+        } else {
+            Color color = XConfigManager.getColor(foreground);
+            //System.err.println("foreground:" + actuator + " = " + color);
+            setForeground(color);
+        }
+    }
+
+    /** Actuator for 'background' attribute.
+    *
+    * @param background : the attribute value.
+    */
+    public final void background(final String background) {
+        if (background.equals(XConfigManager.NAV)) {
+            setOpaque(false);
+            setBackground(null);
+        } else {
+            Color color = XConfigManager.getColor(background);
+            //System.err.println("background:" + actuator + " = " + color);
+            setOpaque(true);
+            setBackground(color);
+        }
+    }
+
+   /** Developer serialization method.
+    *
+    * @return equivalent signature.
+    */
+    public final String toString() {
+        String signature = "Label";
+
+        if (!text().equals(XConfigManager.NAV)) {
+            signature += " text='" + text() + "'";
+        }
+        if (!background().equals(XConfigManager.NAV)) {
+            signature += " background='" + background() + "'";
+        }
+        if (!foreground().equals(XConfigManager.NAV)) {
+            signature += " foreground='" + foreground() + "'";
+        }
+        if (!fontFamily().equals(XConfigManager.NAV)) {
+            signature += " font-family='" + fontFamily() + "'";
+        }
+        if (!fontFace().equals(XConfigManager.NAV)) {
+            signature += " font-face='" + fontFace() + "'";
+        }
+        if (!fontSize().equals(XConfigManager.NAV)) {
+            signature += " font-size='" + fontSize() + "'";
+        }
+        return signature;
+    }
+}
+
diff --git a/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Link.java b/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Link.java
new file mode 100644 (file)
index 0000000..0ee9997
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - DIGITEO - 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-en.txt
+ *
+ */
+
+package org.scilab.modules.preferences.Component;
+
+import java.awt.Cursor;
+
+import org.scilab.modules.preferences.XConfigManager;
+
+import org.w3c.dom.Node;
+
+/** 
+ * Implementation of Link compliant with extended management.
+ * @author Vincent COUVERT
+ */
+public class Link extends Label {
+
+       private static final long serialVersionUID = -8915028261763299611L;
+
+       /** 
+        * Constructor.
+        * @param peer : associated view DOM node.
+        */
+       public Link(final Node peer) {
+               super(peer);
+               setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
+       }
+
+       /**
+        * Refresh the component by the use of actuators.
+        * @param peer the corresponding view DOM node
+        */
+       public void refresh(final Node peer) {
+               super.refresh(peer);
+               /* Force text to be underlined */
+               String text = "<HTML><U>" + XConfigManager.getAttribute(peer , "text") + "</U></HTML>";
+               if (!text.equals(text())) {
+                       text(text);
+               }
+               /* Force text to be blue */
+               foreground("#0000FF");
+       }
+}
+
diff --git a/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Panel.java b/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Panel.java
new file mode 100644 (file)
index 0000000..fc2d604
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - Pierre GRADIT
+ *
+ * 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-en.txt
+ *
+ */
+
+package org.scilab.modules.preferences.Component;
+
+import org.scilab.modules.preferences.XComponent;
+import javax.swing.JPanel;
+import org.w3c.dom.Node;
+import org.scilab.modules.preferences.XConfigManager;
+import java.awt.BorderLayout;
+
+/** Implementation of Panel compliant with extended management.
+*
+* @author Pierre GRADIT
+*
+*/
+public class Panel extends JPanel implements XComponent {
+
+    /** Universal identifier for serialization.
+     *
+     */
+    private static final long serialVersionUID = 3462302313959678932L;
+
+    /** Define the set of actuators.
+     *
+     * @return array of actuator names.
+     */
+    public final String [] actuators() {
+        String [] actuators = {};
+        return actuators;
+    }
+
+    /** Constructor.
+    *
+    * @param peer : associated view DOM node.
+    */
+    public Panel(final Node peer) {
+        super();
+        setLayout(new BorderLayout());
+        XConfigManager.setDimension(this, peer);
+        XConfigManager.drawConstructionBorders(this);
+    }
+
+    /** Refresh the component by the use of actuators.
+    *
+    * @param peer the corresponding view DOM node
+    */
+    public void refresh(final Node peer) {
+    }
+
+    /** Developer serialization method.
+    *
+    * @return equivalent signature.
+    */
+    public final String toString() {
+        String signature = "Panel";
+
+        return signature;
+    }
+}
+
diff --git a/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/PreviewCode.java b/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/PreviewCode.java
new file mode 100644 (file)
index 0000000..d5d8864
--- /dev/null
@@ -0,0 +1,182 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - Pierre GRADIT
+ *
+ * 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-en.txt
+ *
+ */
+
+package org.scilab.modules.preferences.Component;
+
+import org.scilab.modules.preferences.XComponent;
+
+
+import java.awt.event.MouseEvent;
+import javax.swing.JPanel;
+import org.w3c.dom.Node;
+import org.scilab.modules.preferences.XConfigManager;
+import java.awt.BorderLayout;
+import org.scilab.modules.scinotes.ScilabEditorPane;
+import org.scilab.modules.scinotes.ScilabEditorKit;
+
+import javax.swing.text.DefaultCaret;
+import org.scilab.modules.scinotes.KeywordAdaptater;
+import org.scilab.modules.scinotes.utils.SciNotesMessages;
+import javax.swing.BorderFactory;
+import org.scilab.modules.scinotes.utils.ConfigSciNotesManager;
+import org.scilab.modules.scinotes.KeywordEvent;
+import org.scilab.modules.scinotes.ScilabLexerConstants;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import org.scilab.modules.preferences.XChooser;
+import java.awt.Color;
+import org.w3c.dom.NodeList;
+
+/** Implementation of Panel compliant with extended management.
+*
+* @author Pierre GRADIT
+*
+*/
+public class PreviewCode extends JPanel implements XComponent, XChooser {
+
+    /** Universal identifier for serialization.
+     *
+     */
+    private static final long serialVersionUID = 3462302313959678932L;
+
+    private static final int GAP = 5;
+
+    /** Define the set of actuators.
+     *
+     * @return array of actuator names.
+     */
+    public final String [] actuators() {
+        String [] actuators = {};
+        return actuators;
+    }
+
+
+    final ScilabEditorPane previewEditorPane;
+
+    /** Constructor.
+    *
+    * @param peer : associated view DOM node.
+    */
+    public PreviewCode(final Node peer) {
+        super();
+        setLayout(new BorderLayout());
+        XConfigManager.setDimension(this, peer);
+        XConfigManager.drawConstructionBorders(this);
+
+
+        JPanel previewPanel = new JPanel(new BorderLayout(GAP, GAP));
+        previewEditorPane   = new ScilabEditorPane(null);
+        previewPanel.setBorder(BorderFactory.createTitledBorder(SciNotesMessages.PREVIEW));
+        previewEditorPane.setEditorKit(new ScilabEditorKit());
+        String codeSample = "// A comment with whites    and tabulations \t\t\n"
+            + "// Email: <scilab.support@scilab.org>\n"
+            + "// Scilab editor: http://www.scilab.org/\n"
+            + "function [a, b] = myfunction(d, e, f)\n"
+            + "\ta = 2.71828 + %pi + f($, :);\n"
+            + "\tb = cos(a) + cosh(a);\n"
+            + "\tif d == e then\n"
+            + "\t\tb = 10 - e.field;\n"
+            + "\telse\n"
+            + "\t\tb = \"\t\ttest     \" + home\n"
+            + "\t\treturn\n"
+            + "\tend\n"
+            + "\tmyvar = 1.23e-45;\n"
+            + "endfunction";
+        previewEditorPane.setText(codeSample);
+        //previewEditorPane.setBackground(bgColorButton.getBackground());
+        //previewEditorPane.setFont(ConfigSciNotesManager.getFont());
+        previewEditorPane.setCaret(new DefaultCaret() {
+                public void mouseDragged(MouseEvent e) {
+                    e.consume();
+                }
+            });
+        previewEditorPane.getCaret().setBlinkRate(500);
+        //previewEditorPane.setCaretColor(fgColorButton.getBackground());
+        previewEditorPane.getCaret().setVisible(true);
+        previewEditorPane.setEditable(false);
+        previewEditorPane.addKeywordListener(new KeywordAdaptater.MouseOverAdaptater() {
+                public void caughtKeyword(KeywordEvent e) {
+                    previewEditorPane.setToolTipText(ScilabLexerConstants.getStringRep(e.getType()));
+                }
+            });
+        previewEditorPane.addKeywordListener(new KeywordAdaptater.MouseClickedAdaptater() {
+                public void caughtKeyword(KeywordEvent e) {
+                    PreviewCode.this.keywordClicked(e);
+                }
+            });
+        previewPanel.add(previewEditorPane, BorderLayout.CENTER);
+        add(previewPanel);
+    }
+
+    /** Refresh the component by the use of actuators.
+    *
+    * @param peer the corresponding view DOM node
+    */
+    public void refresh(final Node peer) {
+        System.out.println(" " + peer);
+        NodeList nodelist = peer.getChildNodes();
+        for (int i = 0; i < nodelist.getLength(); i++) {
+            Node node     = nodelist.item(i);
+            if (node.getNodeName().equals("tableRow")) {
+                String name   = XConfigManager.getAttribute(node , "name");
+                String xColor = XConfigManager.getAttribute(node , "color");
+                Color color   = XConfigManager.getColor(xColor);
+                previewEditorPane.resetColor(name, color);
+            }
+        }
+        previewEditorPane.repaint();
+    }
+
+    /** Row selection management.
+    *
+    */
+    private ActionListener actionListener = null;
+    String chosenItem;
+
+    /** Actual response read by the listener.
+    *
+    * @return index of the selected line.
+    */
+    public final String choose() {
+        return chosenItem;
+    }
+
+    public void keywordClicked(KeywordEvent e) {
+        if (actionListener != null) {
+            int choosedIndex = e.getType();
+            chosenItem = ScilabLexerConstants.getStringRep(choosedIndex);
+            ActionEvent transmit  = new ActionEvent(
+                 this, 0,"Keyword changed", choosedIndex, 0);
+            actionListener.actionPerformed(transmit);
+        }
+    }
+
+    /** Registration of a single listener.
+     * @param listener for the unique actionListener.
+     */
+    public final void addActionListener(final ActionListener listener) {
+        actionListener = listener;
+    }
+
+    /** Developer serialization method.
+    *
+    * @return equivalent signature.
+    */
+    public final String toString() {
+        String signature = "PreviewCode";
+
+        return signature;
+    }
+
+
+}
+
diff --git a/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Radiobutton.java b/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Radiobutton.java
new file mode 100644 (file)
index 0000000..7f60480
--- /dev/null
@@ -0,0 +1,145 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - Pierre GRADIT
+ *
+ * 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-en.txt
+ *
+ */
+
+package org.scilab.modules.preferences.Component;
+
+import org.scilab.modules.preferences.XComponent;
+import org.scilab.modules.preferences.XChooser;
+import org.scilab.modules.preferences.XConfigManager;
+import org.scilab.modules.gui.bridge.radiobutton.SwingScilabRadioButton;
+
+import org.w3c.dom.Node;
+
+/** Implementation of Radiobutton compliant with extended management.
+*
+* @author Pierre GRADIT
+*
+*/
+public class Radiobutton extends SwingScilabRadioButton implements XComponent, XChooser {
+
+    /** Universal identifier for serialization.
+     *
+     */
+    private static final long serialVersionUID = -7007541669965737408L;
+
+    /** Define the set of actuators.
+    *
+    * @return array of actuator names.
+    */
+    public final String [] actuators() {
+        String [] actuators = {"enable", "text", "checked"};
+        return actuators;
+    }
+
+    /** Constructor.
+    *
+    * @param peer : associated view DOM node.
+    */
+    public Radiobutton(final Node peer) {
+        super();
+        setOpaque(false);
+        refresh(peer);
+    }
+
+    /** Refresh the component by the use of actuators.
+    *
+    * @param peer the corresponding view DOM node
+    */
+    public final void refresh(final Node peer) {
+        String text = XConfigManager.getAttribute(peer , "text");
+        if (!text.equals(text())) {
+            text(text);
+        }
+
+        String checked = XConfigManager.getAttribute(peer , "checked");
+        if (!checked.equals(checked())) {
+            checked(checked);
+        }
+        String enable     = XConfigManager.getAttribute(peer , "enable", "true");
+        setEnabled(enable.equals("true"));
+
+    }
+
+    /** Sensor for 'text' attribute.
+    *
+    * @return the attribute value.
+    */
+    public final String text() {
+        String text = getText();
+        if (text != null) {
+            return text;
+        } else {
+            return XConfigManager.NAV;
+        }
+    }
+
+    /** Actuator for 'text' attribute.
+    *
+    * @param text : the attribute value.
+    */
+    public final void text(final String text) {
+       if (text!=XConfigManager.NAV) {
+            setText(text);
+        } else {
+            setText(null);
+        }
+    }
+
+    /** Sensor for 'checked' attribute.
+    *
+    * @return the attribute value.
+    */
+    public final String checked() {
+        boolean state = isSelected();
+        if (state) {
+            return "checked";
+        } else {
+            return "unchecked";
+        }
+    }
+
+    /** Actuator for 'checked' attribute.
+    *
+    * @param text : the attribute value.
+    */
+    public final void checked(final String checked) {
+        boolean state =  checked.equals("checked");
+        setSelected(state);
+    }
+
+    /** Actual response read by the listener.
+    *
+    * @return response read by the listener.
+    */
+    public final String choose() {
+        if (isSelected()) {
+            return "checked";
+        }
+        return "unchecked";
+    }
+
+    /** Developer serialization method.
+    *
+    * @return equivalent signature.
+    */
+    public final String toString() {
+        String signature = "RadioButton";
+        if (!text().equals(XConfigManager.NAV)) {
+            signature += " text='" + text() + "'";
+        }
+        if (!checked().equals(XConfigManager.NAV)) {
+            signature += " checked='" + checked() + "'";
+        }
+        return signature;
+    }
+}
+
diff --git a/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Scroll.java b/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Scroll.java
new file mode 100644 (file)
index 0000000..8cda386
--- /dev/null
@@ -0,0 +1,139 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - Pierre GRADIT
+ *
+ * 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-en.txt
+ *
+ */
+
+package org.scilab.modules.preferences.Component;
+
+import org.scilab.modules.preferences.XComponent;
+import javax.swing.JScrollPane;
+import org.w3c.dom.Node;
+import org.scilab.modules.preferences.XConfigManager;
+import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.Dimension;
+
+//import org.scilab.modules.gui.bridge.tab.SwingScilabScrollPane;
+// TODO how to set a container inside?
+
+/** Implementation of Scroll compliant with extended management.
+*
+* @author Pierre GRADIT
+*
+*/
+public class Scroll extends JScrollPane implements XComponent {
+
+    /** Universal identifier for serialization.
+     *
+     */
+    private static final long serialVersionUID = -6203963304355019727L;
+
+    /** Constructor.
+    *
+    * @param peer : associated view DOM node.
+    * @param component : parent component.
+    */
+    public Scroll(final Node peer, final Component component) {
+        super(component);
+        insideContainer = (Container) component;
+        insideContainer.setLayout(new BorderLayout());
+        setMinimumSize(new Dimension(200,200));
+        XConfigManager.setDimension(this, peer);
+        XConfigManager.drawConstructionBorders(this);
+    }
+
+   /** Define the set of actuators.
+     *
+     * @return array of actuator names.
+     */
+    public final String [] actuators() {
+        String [] actuators = {};
+        return actuators;
+    }
+
+    /** Inside panel.
+    *
+    */
+    private Container insideContainer;
+
+    /** Add to container except for system adds.
+     *
+    * @param component : associated view DOM node.
+    * @param constraints : associated view DOM node.
+     */
+    public final void add(final Component component, final Object constraints) {
+        if (component instanceof XComponent) {
+            insideContainer.add(component, constraints);
+            return;
+        }
+        super.add(component, constraints);
+    }
+
+    /** Add to container except for system adds.
+     *
+    * @param component : associated view DOM node.
+    * @param constraints : associated view DOM node.
+    * @param index : order number in layout.
+     */
+    public final void add(
+            final Component component,
+            final Object constraints,
+            final int index) {
+        if (component instanceof XComponent) {
+            insideContainer.add(component, constraints, index);
+            return;
+        }
+        super.add(component, constraints, index);
+    }
+
+    /** Remove from container.
+     *
+    * @param component : associated view DOM node.
+     */
+    public final void remove(final Component component) {
+        insideContainer.remove(component);
+    }
+
+    /** Children consultation.
+     *
+     * @return container component count
+     */
+    public final int getXComponentCount() {
+        return insideContainer.getComponentCount();
+    }
+
+    /** Children consultation.
+     *
+     * @param index : order number in layout.
+     * @return indexed component
+     */
+    public final Component getXComponent(final int index) {
+        return insideContainer.getComponent(index);
+    }
+
+    /** Refresh the component by the use of actuators.
+    *
+    * @param peer the corresponding view DOM node
+    */
+    public void refresh(final Node peer) {
+    }
+
+    /** Developer serialization method.
+    *
+    * @return equivalent signature.
+    */
+    public final String toString() {
+        String signature = "Scroll";
+
+        return signature;
+    }
+}
+
diff --git a/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Select.java b/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Select.java
new file mode 100644 (file)
index 0000000..68f447a
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - Pierre GRADIT
+ *
+ * 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-en.txt
+ *
+ */
+
+package org.scilab.modules.preferences.Component;
+
+import java.awt.Dimension;
+
+import org.scilab.modules.preferences.XComponent;
+import org.scilab.modules.preferences.XChooser;
+import org.scilab.modules.preferences.XConfigManager;
+import javax.swing.JComboBox;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+//TODO ScilabSwing class for this?
+
+/** Implementation of Select compliant with extended management.
+*
+* @author Pierre GRADIT
+*
+*/
+public class Select extends JComboBox implements XComponent, XChooser {
+
+    /** Universal identifier for serialization.
+     *
+     */
+    private static final long serialVersionUID = -6127289363733321914L;
+
+    /** Define the set of actuators.
+    *
+    * @return array of actuator names.
+    */
+    public final String [] actuators() {
+        String [] actuators = {"enable"};
+        return actuators;
+    }
+
+    /** Constructor.
+    *
+    * @param peer : associated view DOM node.
+    */
+    public Select(final Node peer) {
+        super();
+        //setMinimumSize(new Dimension(200,30));
+        //setPreferredSize(new Dimension(200,30));
+        NodeList nodelist = peer.getChildNodes();
+        int select = 0;
+        int index = 0;
+        for (int i = 0; i < nodelist.getLength(); i++) {
+            Node node = nodelist.item(i);
+            if (node.getNodeName().equals("option")) {
+                String value = XConfigManager.getAttribute(node , "value");
+                String selected = XConfigManager.getAttribute(
+                        node ,
+                        "selected");
+                addItem(value);
+                if (selected.equals("selected")) {
+                    select = index;
+                }
+                index += 1;
+            }
+        }
+        setSelectedIndex(select);
+    }
+    /** Refresh the component by the use of actuators.
+    *
+    * @param peer the corresponding view DOM node
+    */
+    public void refresh(final Node peer) {
+        NodeList nodelist = peer.getChildNodes();
+        int select = 0;
+        int index = 0;
+        for (int i = 0; i < nodelist.getLength(); i++) {
+            Node node = nodelist.item(i);
+            if (node.getNodeName().equals("option")) {
+                String selected = XConfigManager.getAttribute(node ,"selected");
+                if (selected.equals("selected")) {
+                    select = index;
+                }
+                index += 1;
+            }
+        }
+        if (select != getSelectedIndex()) {
+            setEnabled(false);
+            setSelectedIndex(select);
+        }
+        String enable     = XConfigManager.getAttribute(peer , "enable", "true");
+        setEnabled(enable.equals("true"));
+    }
+
+    /** Actual response read by the listener.
+    *
+    * @return response read by the listener.
+    */
+    public final String choose() {
+        if (isEnabled()) {
+            return (String) getSelectedItem();
+        }
+        return null;
+    }
+
+    /** Developer serialization method.
+    *
+    * @return equivalent signature.
+    */
+    public final String toString() {
+        String signature = "Select";
+        return signature;
+    }
+}
+
diff --git a/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Slider.java b/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Slider.java
new file mode 100644 (file)
index 0000000..b6b2f0e
--- /dev/null
@@ -0,0 +1,183 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - DIGITEO - 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-en.txt
+ *
+ */
+
+package org.scilab.modules.preferences.Component;
+
+import java.awt.Color;
+
+import org.scilab.modules.gui.bridge.slider.SwingScilabSlider;
+import org.scilab.modules.preferences.XCommonManager;
+import org.scilab.modules.preferences.XComponent;
+import org.scilab.modules.preferences.XComponentAttributes;
+import org.scilab.modules.preferences.XConfigManager;
+import org.w3c.dom.Node;
+
+/**
+ * Implementation of Label compliant with extended management.
+ * @author Vincent COUVERT
+ *
+ */
+public class Slider extends SwingScilabSlider implements XComponent {
+
+       /** Universal identifier for serialization.
+        *
+        */
+       private static final long serialVersionUID = -4842434795956015957L;
+
+       /** Constructor.
+        *
+        * @param peer : associated view DOM node.
+        */
+       public Slider(final Node peer) {
+               super();
+               setHorizontal();
+               
+               String tooltip = XConfigManager.getAttribute(peer , XComponentAttributes.TOOLTIP);
+               tooltip(tooltip);
+
+               String background = XConfigManager.getAttribute(peer , XComponentAttributes.BACKGROUND);
+               background(background);
+
+               String foreground = XConfigManager.getAttribute(peer , XComponentAttributes.FOREGROUND);
+               foreground(foreground);
+       }
+
+       /**
+        * Define the set of actuators.
+        * @return array of actuator names.
+        */
+       public final String [] actuators() {
+               String [] actuators = {XComponentAttributes.FOREGROUND, 
+                               XComponentAttributes.BACKGROUND, 
+                               XComponentAttributes.TOOLTIP};
+               return actuators;
+       }
+
+       /**
+        * Refresh the component by the use of actuators.
+        * @param peer the corresponding view DOM node
+        */
+       public void refresh(final Node peer) {
+
+               String tooltip = XConfigManager.getAttribute(peer , "tooltip");
+               if (!tooltip.equals(tooltip())) {
+                       tooltip(tooltip);
+               }
+
+               String background = XConfigManager.getAttribute(peer , "background");
+               if (!background.equals(background())) {
+                       background(background);
+               }
+
+               String foreground = XConfigManager.getAttribute(peer , "foreground");
+               if (!foreground.equals(foreground())) {
+                       foreground(foreground);
+               }
+
+               setRequestFocusEnabled(true);
+               setFocusable(true);
+       }
+
+       /** Sensor for 'tooltip' attribute.
+        *
+        * @return the attribute value.
+        */
+       public final String tooltip() {
+               String tooltip = getToolTipText();
+               if (tooltip == null) {
+                       return "";
+               }
+               return tooltip;
+       }
+
+       /** Sensor for 'foreground' attribute.
+        *
+        * @return the attribute value.
+        */
+       public final String foreground() {
+               if (getForeground().equals(getParent().getForeground())) {
+                       return XConfigManager.NAV;
+               } else {
+                       return XConfigManager.getColor(getForeground());
+               }
+       }
+
+       /** Sensor for 'background' attribute.
+        *
+        * @return the attribute value.
+        */
+       public final String background() {
+               if (getForeground().equals(getParent().getBackground())) {
+                       return XConfigManager.NAV;
+               } else {
+                       return XConfigManager.getColor(getBackground());
+               }
+       }
+
+
+       /**
+        * Actuator for 'tooltip' attribute.
+        * @param tooltip : the attribute value.
+        */
+       public final void tooltip(String tooltip) {
+               if (tooltip.equals(XCommonManager.NAV) || tooltip.equals("")) {
+                       setToolTipText(null);
+               } else {
+                       setToolTipText(tooltip);
+               }
+       }
+
+       /**
+        * Actuator for 'foreground' attribute.
+        * @param foreground : the attribute value.
+        */
+       public final void foreground(final String foreground) {
+               if (foreground.equals(XConfigManager.NAV)) {
+                       setForeground(null);
+               } else {
+                       Color color = XConfigManager.getColor(foreground);
+                       setForeground(color);
+               }
+       }
+
+       /**
+        * Actuator for 'background' attribute.
+        * @param background : the attribute value.
+        */
+       public final void background(final String background) {
+               if (background.equals(XConfigManager.NAV)) {
+                       setOpaque(false);
+                       setBackground(null);
+               } else {
+                       Color color = XConfigManager.getColor(background);
+                       setOpaque(true);
+                       setBackground(color);
+               }
+       }
+
+       /**
+        * Developer serialization method.
+        * @return equivalent signature.
+        */
+       public final String toString() {
+               String signature = "Label";
+
+               if (!background().equals(XConfigManager.NAV)) {
+                       signature += " background='" + background() + "'";
+               }
+               if (!foreground().equals(XConfigManager.NAV)) {
+                       signature += " foreground='" + foreground() + "'";
+               }
+               return signature;
+       }
+}
+
diff --git a/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Table.java b/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Table.java
new file mode 100644 (file)
index 0000000..97db5a5
--- /dev/null
@@ -0,0 +1,509 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - Pierre GRADIT
+ *
+ * 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-en.txt
+ *
+ */
+
+package org.scilab.modules.preferences.Component;
+
+import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.GridLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
+import javax.swing.ListSelectionModel;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+import javax.swing.event.TableModelEvent;
+import javax.swing.event.TableModelListener;
+import javax.swing.table.AbstractTableModel;
+import javax.swing.table.DefaultTableCellRenderer;
+
+import org.scilab.modules.preferences.XChooser;
+import org.scilab.modules.preferences.XCommonManager;
+import org.scilab.modules.preferences.XComponent;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/** Implementation of Select compliant with extended management.
+*
+* @author Pierre GRADIT
+*
+*/
+public class Table extends JPanel implements XComponent, XChooser, ListSelectionListener, ActionListener {
+
+    /** Universal identifier for serialization.
+     *
+     */
+    private static final long serialVersionUID = -6127289363733321914L;
+
+    private final CustomTableCellRenderer customTableCellRenderer = new CustomTableCellRenderer();
+    
+    /** Define the set of actuators.
+    *
+    * @return array of actuator names.
+    */
+    public final String [] actuators() {
+        String [] actuators = {"item"};
+        return actuators;
+    }
+    Model model;
+    JTable table;
+    JScrollPane scrollPane;
+
+    /** The attribute column indicates which column has to be chosen.
+    *    if this attribute is not set, the chosen value is the selected index (as a string).
+    */
+    String column;
+
+    //begin Dynamic_controller
+    // TODO separate class.
+    ImageIcon icons[] = {
+        new ImageIcon(Icon.SCILAB_XICONS + "list-add.png"),
+        new ImageIcon(Icon.SCILAB_XICONS + "go-up.png"),
+        new ImageIcon(Icon.SCILAB_XICONS + "media-playback-stop.png"),
+        new ImageIcon(Icon.SCILAB_XICONS + "go-down.png"),
+        new ImageIcon(Icon.SCILAB_XICONS + "list-remove.png")
+    };
+    JButton controls[] = {
+        new JButton(icons[0]),
+        new JButton(icons[1]),
+        new JButton(icons[2]),
+        new JButton(icons[3]),
+        new JButton(icons[4])
+    };
+    boolean openMask[] = {
+        true,
+        true,
+        true,
+        true,
+        true
+    };
+
+    public void setupOpenMask(Node peer) {
+        if (XCommonManager.getAttribute(peer , "location").equals("fixed")) {
+            openMask[1] = false;
+        } else {
+            openMask[1] = model.getRowCount() > 1;
+        }
+        if (XCommonManager.getAttribute(peer , "mode").equals("select")) {
+            openMask[2] = false;
+        }
+        if (XCommonManager.getAttribute(peer , "location").equals("fixed")) {
+            openMask[3] = false;
+        } else {
+            openMask[3] = model.getRowCount() > 1;
+        }
+        openMask[4] = model.getRowCount() != 0;
+    }
+
+    public void setupControls(Node peer) {
+        if (XCommonManager.getAttribute(peer , "size").equals("dynamic")) {
+            JPanel panel = new JPanel(new GridLayout(5,1));
+            for (int i=0; i<controls.length; i++) {
+                panel.add(controls[i]);
+                controls[i].addActionListener((ActionListener) this);
+                controls[i].setEnabled(false);
+            }
+            if (model.getRowCount()==0) {
+                controls[0].setEnabled(true);
+            }
+            this.add(panel, BorderLayout.EAST);
+        }
+    }
+
+    public void openControls() {
+        for (int i=0; i<controls.length; i++) {
+            controls[i].setEnabled(openMask[i]);
+        }
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent e) {
+        int id;
+        JButton src = (JButton) e.getSource();
+        for ( id = 0; id < controls.length; id++) {
+            if (controls[id] == src) {
+                break;
+            }
+        }
+        switch (id) {
+        case 0:
+            // Add new row
+            if (actionListener != null) {
+                ActionEvent transmit  = new ActionEvent(this, 0,"tableAdd", e.getWhen(), 0);
+                actionListener.actionPerformed(transmit);
+            }
+            break;
+        case 1: 
+            // Move row upper
+            break;
+        case 2:
+            table.getSelectionModel().clearSelection();
+            for (int i=0; i<controls.length; i++) {
+                controls[i].setEnabled(false);
+            }
+            break;
+        case 3: break;
+        case 4:
+            // Delete row
+                System.out.println("[DEBUG] calling actionPerformed(deleteRow)");
+            if (actionListener != null) {
+                ActionEvent transmit  = new ActionEvent(this, 0,"tableDel", e.getWhen(), 0);
+                actionListener.actionPerformed(transmit);
+            }
+        break;
+        }
+    }
+    //end Dynamic_controller
+    
+    private final class CustomTableCellRenderer extends DefaultTableCellRenderer{
+        public Component getTableCellRendererComponent (JTable table, 
+                Object obj, boolean isSelected, boolean hasFocus, int row, int column) {
+            Component cell = super.getTableCellRendererComponent(table, obj, isSelected, hasFocus, row, column);
+            if (obj instanceof java.awt.Color) {
+                    cell.setBackground((java.awt.Color) obj);
+                    cell.setForeground((java.awt.Color) obj);
+            } 
+       
+            return cell;
+        }
+    }
+
+    /** Constructor.
+    *
+    * @param peer : associated view DOM node.
+    */
+    public Table(final Node peer) {
+        super(new BorderLayout());
+        model        = new Model(peer);
+        table        = new JTable (model);
+        table.setFillsViewportHeight(true);
+       
+        table.getSelectionModel().addListSelectionListener(this);
+        table.getTableHeader().setReorderingAllowed(false);
+        setupOpenMask(peer);
+        setupControls(peer);
+
+        column = XCommonManager.getAttribute(peer , "column");
+
+        if (XCommonManager.getAttribute(peer , "mode").equals("select")) {
+            table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+        }
+
+        if (XCommonManager.getAttribute(peer , "mode").equals("cell")) {
+            table.setCellSelectionEnabled(true);
+            table.setColumnSelectionAllowed(false);
+            table.setRowSelectionAllowed(true);
+        }
+        //checkContent();
+        scrollPane = new JScrollPane(table);
+        this.add(scrollPane);
+    }
+    
+    public void addTableModelListener(TableModelListener listener) {
+        model.addTableModelListener(listener);
+        addActionListener((ActionListener) listener);
+    }
+    
+    @SuppressWarnings("unused")
+    private void checkContent() {
+        for (int j = 0; j < model.getColumnCount(); j++) {
+            System.out.print("  " + model.getColumnName(j));
+        }
+        System.out.print("\n");
+        if (model.getRowCount() == 0) {
+            System.out.println("-- no tableRow items!");
+        }
+        for (int i = 0; i < model.getRowCount(); i++) {
+            for (int j = 0; j < model.getColumnCount(); j++) {
+                System.out.print("  " + model.getValueAt(i, j));
+            }
+            System.out.print("\n");
+        }
+    }
+
+    /** Refresh the component by the use of actuators.
+    *
+    * @param peer the corresponding view DOM node
+    */
+    public final void refresh(final Node peer) {
+        model.setNodeList(peer.getChildNodes());
+        String item = XCommonManager.getAttribute(peer , "item", "-1");
+        setupOpenMask(peer);
+        if (!item.equals(item())) {
+            item(item);
+        }
+        for (int j = 0; j < model.getColumnCount(); j++) {
+            table.getColumnModel().getColumn(j).setCellRenderer(new CustomTableCellRenderer());
+        }
+        repaint();
+    }
+
+    /** Row selection management.
+    *
+    */
+    private ActionListener actionListener = null;
+
+    /** Actual response read by the listener.
+    *
+    * @return the chosen value.
+    */
+    public final String choose() {
+        if (! column.equals(XCommonManager.NAV)) {
+            int row      = table.getSelectedRow();
+            Node record  = model.getRowRecord(row);
+            String value = XCommonManager.getAttribute(record , column);
+            return value;
+        }
+        return item();
+    }
+
+    /** Registration of a single listener.
+     * @param listener for the unique actionListener.
+     */
+    public final void addActionListener(final ActionListener listener) {
+        actionListener = listener;
+    }
+
+    boolean externalChange;
+    
+    public void valueChanged(ListSelectionEvent e) {
+        //table.valueChanged(e);
+        if (externalChange) {
+            openControls();
+            if (actionListener != null) {
+                ActionEvent transmit  = new ActionEvent(this, 0,"tableSelect", table.getSelectedRow() + 1, 0);
+                actionListener.actionPerformed(transmit);
+            }
+        }
+    }
+    
+    /** Sensor for 'item' attribute.
+    *
+    * @return the attribute value.
+    */
+    public final String item() {
+        return "" + (table.getSelectedRow() + 1);
+    }
+
+    /** Actuator for 'item' attribute.
+    *
+    * @param text : the attribute value.
+    */
+    public final void item(final String item) {
+        int selectedRow = Integer.parseInt(item);
+        externalChange  = false;
+        if ((selectedRow != -1)&&(selectedRow != (table.getSelectedRow() + 1))) {
+            table.setRowSelectionInterval(selectedRow - 1, selectedRow - 1);
+            openControls();
+        }
+        externalChange  = true;
+    }
+
+    /** Developer serialization method.
+    *
+    * @return equivalent signature.
+    */
+    public final String toString() {
+        String signature = "Table ...";
+        return signature;
+    }
+
+    /** Enrich action description with event and model information.
+     * 
+     * @param event embeds the description of interaction in view
+     * @param action embeds the description of interaction in model
+     */
+    public static void processModelEvent(TableModelEvent event, Node [] actions) {
+        Model src = (Model) event.getSource();
+        for (int i = 0; i < actions.length; i++) {
+            Element element = (Element) actions[i];
+            int row = event.getFirstRow();
+            int col = event.getColumn();
+            String value    = src.getValueAt(row, col).toString();
+            String attr     = src.getColumnAttr(col);
+            String context  = element.getAttribute("context");
+            element.setAttribute("set", attr);
+            element.setAttribute("value", value);
+            // subtle reuse of the 'set' behavior!
+            element.setAttribute("context", context + (row + 1) + "/");
+        }
+    }
+
+}
+
+/** Scans DOM nodes and translate it into table model.
+ *
+ * @author gradit
+ *
+ */
+class Model extends AbstractTableModel {
+
+    /** Serialization ID.
+     *
+     */
+    private static final long serialVersionUID = -4786321481195930071L;
+    
+    /** Data source.
+     *
+     */
+    private NodeList nodelist;
+
+    public Model(Node peer) {
+        setNodeList(peer.getChildNodes());
+    }
+    
+    /** Set a new root for value scanning.
+     *
+     * @param input is the data source
+     */
+    public void setNodeList(final NodeList input) {
+        nodelist = input;
+    }
+
+    @Override
+    public int getColumnCount() {
+        int count = 0;
+        for (int i = 0; i < nodelist.getLength(); i++) {
+            Node node = nodelist.item(i);
+            if (node.getNodeName().equals("tableCol")) {
+                count++;
+            }
+        }
+        return count;
+    }
+
+    @Override
+    public int getRowCount() {
+        int count = 0;
+        for (int i = 0; i < nodelist.getLength(); i++) {
+            Node node = nodelist.item(i);
+            if (node.getNodeName().equals("tableRow")) {
+                count++;
+            }
+        }
+        return count;
+    }
+
+    /** browse DOM model.
+    *
+    * @return tablePrototype DOM node
+    */
+   public Node getPrototypeRecord() {
+       for (int i = 0; i < nodelist.getLength(); i++) {
+           Node node = nodelist.item(i);
+           if (node.getNodeName().equals("tablePrototype")) {
+               return node;
+           }
+       }
+       return null;
+    }
+
+    /** browse DOM model.
+     *
+     * @param col is the column identifier
+     * @return DOM for column
+     */
+    public Node getColumnRecord(final int col) {
+        int count = col;
+        for (int i = 0; i < nodelist.getLength(); i++) {
+            Node node = nodelist.item(i);
+            if (node.getNodeName().equals("tableCol")) {
+                if (count == 0) {
+                    return node;
+                }
+                count--;
+            }
+        }
+        return null;
+    }
+
+    /** browse DOM model.
+     *
+     * @param row is the row identifier
+     * @return DOM for row
+     */
+    public Node getRowRecord(final int row) {
+        int count = row;
+        for (int i = 0; i < nodelist.getLength(); i++) {
+            Node node = nodelist.item(i);
+            if (node.getNodeName().equals("tableRow")) {
+                if (count == 0) {
+                    return node;
+                }
+                count--;
+            }
+        }
+        return null;
+    }
+
+    /** browse DOM model.
+     *
+     * @param col is the column identifier
+     * @return attribute name for column.
+     */
+    public String getColumnAttr(final int col) {
+        Node record = getColumnRecord(col);
+        if (record != null) {
+            return XCommonManager.getAttribute(record , "attr");
+        }
+        return XCommonManager.NAV;
+    }
+
+    @Override
+    public String getColumnName(final int col) {
+        Node record = getColumnRecord(col);
+        if (record != null) {
+            return XCommonManager.getAttribute(record , "title");
+        }
+        return XCommonManager.NAV;
+    }
+
+    @Override
+    public Object getValueAt(final int row, final int col) {
+        String attr  = getColumnAttr(col);
+        Node record  = getRowRecord(row);
+        String value = XCommonManager.getAttribute(record , attr);
+        if (value.startsWith("#"))
+        {
+            return XCommonManager.getColor(value);
+        }
+        return value;
+    }
+
+    @Override
+    public void setValueAt(final Object value, final int row, final int col) {
+        // temporary storage of value
+        String attr     = getColumnAttr(col);
+        Element record  = (Element) getRowRecord(row);
+        record.setAttribute(attr, value.toString());
+        // event firing
+        TableModelEvent event = new TableModelEvent(this, row, row, col);
+        fireTableChanged(event);
+        return;
+    }
+
+    @Override
+    public boolean isCellEditable(final int row, final int col) {
+        Node record  = getColumnRecord(col);
+        String value = XCommonManager.getAttribute(
+                       record , "editable", "false");
+        return value == "true";
+    }
+
+}
diff --git a/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Title.java b/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Title.java
new file mode 100644 (file)
index 0000000..698e8b7
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - Pierre GRADIT
+ *
+ * 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-en.txt
+ *
+ */
+
+package org.scilab.modules.preferences.Component;
+
+import org.scilab.modules.preferences.XComponent;
+import org.scilab.modules.preferences.XConfigManager;
+import javax.swing.JPanel;
+import org.w3c.dom.Node;
+import javax.swing.BorderFactory;
+import javax.swing.border.TitledBorder;
+import java.awt.Color;
+import java.awt.BorderLayout;
+
+// TODO ScilabSwing class for this?
+
+/** Implementation of Title compliant with extended management.
+*
+* @author Pierre GRADIT
+*
+*/
+public class Title extends JPanel implements XComponent {
+
+    /** Universal identifier for serialization.
+     *
+     */
+    private static final long serialVersionUID = 6183280975436648612L;
+
+    /** Define the set of actuators.
+    *
+    * @return array of actuator names.
+    */
+    public final String [] actuators() {
+        String [] actuators = {};
+        return actuators;
+    }
+
+    /** Constructor.
+    *
+    * @param peer : associated view DOM node.
+    */
+    public Title(final Node peer) {
+        super();
+        String       text  = XConfigManager.getAttribute(peer , "text");
+        TitledBorder title = BorderFactory.createTitledBorder(text);
+        setBorder(title);
+        XConfigManager.setDimension(this, peer);
+        setLayout(new BorderLayout());
+
+        String background = XConfigManager.getAttribute(peer, "background");
+        if (!(background.equals(XConfigManager.NAV))) {
+            Color color = XConfigManager.getColor(background);
+            setOpaque(true);
+            setBackground(color);
+        }
+
+    }
+
+    /** Refresh the component by the use of actuators.
+    *
+    * @param peer the corresponding view DOM node
+    */
+    public void refresh(final Node peer) {
+    }
+
+    /** Developer serialization method.
+    *
+    * @return equivalent signature.
+    */
+    public final String toString() {
+        String signature = "Title";
+
+        return signature;
+    }
+}
+
diff --git a/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Tree.java b/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/Tree.java
new file mode 100644 (file)
index 0000000..999456f
--- /dev/null
@@ -0,0 +1,293 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - Pierre GRADIT
+ *
+ * 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-en.txt
+ *
+ */
+
+package org.scilab.modules.preferences.Component;
+
+import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.GridLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
+import javax.swing.JTree;
+import javax.swing.ListSelectionModel;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+import javax.swing.event.TableModelEvent;
+import javax.swing.event.TableModelListener;
+import javax.swing.event.TreeModelListener;
+import javax.swing.event.TreeSelectionEvent;
+import javax.swing.event.TreeSelectionListener;
+import javax.swing.table.AbstractTableModel;
+import javax.swing.table.DefaultTableCellRenderer;
+import javax.swing.tree.TreeModel;
+import javax.swing.tree.TreePath;
+import javax.swing.tree.TreeSelectionModel;
+
+import org.scilab.modules.preferences.XChooser;
+import org.scilab.modules.preferences.XCommonManager;
+import org.scilab.modules.preferences.XComponent;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/** Implementation of Select compliant with extended management.
+*
+* @author Pierre GRADIT
+*
+*/
+public class Tree extends JPanel implements XComponent, XChooser, TreeSelectionListener {
+
+    /** Universal identifier for serialization.
+     *
+     */
+    private static final long serialVersionUID = -6127289363733321914L;
+
+    
+    /** Define the set of actuators.
+    *
+    * @return array of actuator names.
+    */
+    public final String [] actuators() {
+        String [] actuators = {"item"};
+        return actuators;
+    }
+    XTreeModel model;
+    JTree tree;
+    JScrollPane scrollPane;
+
+    /** Constructor.
+    *
+    * @param peer : associated view DOM node.
+    */
+    public Tree(final Node peer) {
+        super(new BorderLayout());
+        model        = new XTreeModel(peer);
+        tree         = new JTree ();
+        tree.setModel(model);
+        tree.getSelectionModel().addTreeSelectionListener(this);
+        tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
+        tree.setRootVisible(false);
+        scrollPane = new JScrollPane(tree);
+        this.add(scrollPane);
+    }
+    /** Refresh the component by the use of actuators.
+    *
+    * @param peer the corresponding view DOM node
+    */
+    public final void refresh(final Node peer) {
+        model.setRoot(peer);
+        String path = XCommonManager.getAttribute(peer , "path", "-1");
+
+       // if (!path.equals(path())) {
+       //     path(path);
+       // }
+        //repaint();
+    }
+
+    /** Row selection management.
+    *
+    */
+    private ActionListener actionListener = null;
+
+    /** Actual response read by the listener.
+    *
+    * @return the chosen value.
+    */
+    public final String choose() {
+        return path();
+    }
+
+    /** Registration of a single listener.
+     * @param listener for the unique actionListener.
+     */
+    public final void addActionListener(final ActionListener listener) {
+        actionListener = listener;
+    }
+
+    boolean externalChange;
+    
+    public void valueChanged(TreeSelectionEvent e) {
+        if (actionListener != null) {
+            ActionEvent transmit  = new ActionEvent(this, 0,"actionPerformed", e.hashCode(), 0);
+            actionListener.actionPerformed(transmit);
+        }
+    }
+
+    /** Sensor for 'path' attribute.
+    *
+    * @return the attribute value.
+    */
+    public final String path() {
+        Object [] selection = tree.getSelectionPath().getPath();
+        String path = "";
+        XAdapterNode prev = (XAdapterNode) selection[0];
+        for (int i = 1; i < selection.length ; i++) {
+            XAdapterNode next = (XAdapterNode) selection[i];
+            int index = prev.getIndexOfChild(next) + 1;
+            if (i > 1) {
+                // case of bodies...
+                index ++;
+            }
+            path += index; 
+            path += "/";
+            prev  = next;
+        }
+        System.out.println("--->" + path);
+        return path;
+    }
+
+    /** Actuator for 'item' attribute.
+    *
+    * @param text : the attribute value.
+    */
+    public final void path(final String item) {
+        //not yet...
+    }
+
+    /** Developer serialization method.
+    *
+    * @return equivalent signature.
+    */
+    public final String toString() {
+        String signature = "Tree ...";
+        return signature;
+    }
+
+}
+
+class XAdapterNode {
+    
+    Node peer;
+    
+    public XAdapterNode(Node node) {
+        peer = node;
+    }
+    
+    public String toString() {
+        // renderer !
+        return XCommonManager.getAttribute(peer, "name", "");
+    }
+    
+    public String content() {
+        return peer.getNodeName();
+    }
+    
+    public XAdapterNode getChild(int index) {
+       NodeList nodelist = peer.getChildNodes();
+       int count = index;
+       for (int i = 0; i < nodelist.getLength(); i++) {
+           if (nodelist.item(i).getNodeName().startsWith("#")) {
+               continue;
+           }
+           if (count == 0) {
+               return new XAdapterNode(nodelist.item(i));
+           }
+           count -= 1;
+       }
+       return null; //unreachable statement
+   }
+
+    public int getChildCount() {
+        NodeList nodelist = peer.getChildNodes();
+        int count = 0;
+        for (int i = 0; i < nodelist.getLength(); i++) {
+            if (nodelist.item(i).getNodeName().startsWith("#")) {
+                continue;
+            }
+            count += 1;
+        }
+        return count;
+    }
+    
+    public int getIndexOfChild(XAdapterNode child) {
+        NodeList nodelist = peer.getChildNodes();
+        int count = 0;
+        for (int i = 0; i < nodelist.getLength(); i++) {
+            if (nodelist.item(i).getNodeName().startsWith("#")) {
+                continue;
+            }
+            if (child.peer==nodelist.item(i)) {
+                return count;
+            }
+            count += 1;
+        }
+        return -1; //unreachable statement
+    }
+}
+
+/** Scans DOM nodes and translate it into tree model.
+ *
+ * @author gradit
+ *
+ */
+class XTreeModel implements TreeModel {
+
+    /** Serialization ID.
+     *
+     */
+    private static final long serialVersionUID = -4786321481195930071L;
+
+    /** Data source.
+     *
+     */
+    private XAdapterNode root;
+
+    public XTreeModel(Node peer) {
+        setRoot(peer);
+    }
+
+    public void setRoot(final Node input) {
+        root = new XAdapterNode(input);
+    }
+
+    public Object getChild(Object node, int index) {
+        return ((XAdapterNode)node).getChild(index);
+    }
+
+    public int getChildCount(Object node) {
+        return ((XAdapterNode)node).getChildCount();
+    }
+
+    public int getIndexOfChild(Object node, Object other) {
+        return ((XAdapterNode)node).getIndexOfChild((XAdapterNode) other);
+    }
+
+    public Object getRoot() {
+        return root;
+    }
+
+    public boolean isLeaf(Object node) {
+        return ((XAdapterNode)node).getChildCount() == 0;
+    }
+
+    public void valueForPathChanged(TreePath arg0, Object arg1) {
+        // empty
+    }
+
+    public void addTreeModelListener(TreeModelListener arg0) {
+        // empty
+    }
+
+    public void removeTreeModelListener(TreeModelListener arg0) {
+        // empty
+    }
+
+
+}
diff --git a/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/VBox.java b/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/VBox.java
new file mode 100644 (file)
index 0000000..0d52849
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - Pierre GRADIT
+ *
+ * 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-en.txt
+ *
+ */
+
+package org.scilab.modules.preferences.Component;
+
+import org.scilab.modules.preferences.XComponent;
+
+import javax.swing.BoxLayout;
+import javax.swing.JComponent;
+import javax.swing.JPanel;
+import org.w3c.dom.Node;
+import org.scilab.modules.preferences.XConfigManager;
+
+import java.awt.Color;
+import java.awt.Component;
+
+/** Implementation of Panel compliant with extended management.
+*
+* @author Pierre GRADIT
+*
+*/
+public class VBox extends JPanel implements XComponent {
+
+    /** Universal identifier for serialization.
+     *
+     */
+    private static final long serialVersionUID = 3462302313959678932L;
+
+    /** Define the set of actuators.
+     *
+     * @return array of actuator names.
+     */
+    public final String [] actuators() {
+        String [] actuators = {};
+        return actuators;
+    }
+
+    /** Constructor.
+    *
+    * @param peer : associated view DOM node.
+    */
+    public VBox(final Node peer) {
+        super();
+        BoxLayout box = new BoxLayout(this, BoxLayout.PAGE_AXIS);
+        setLayout(box);
+        XConfigManager.setDimension(this, peer);
+        XConfigManager.drawConstructionBorders(this);
+        refresh(peer);
+    }
+
+    /** Overloaded add method to embed grid layout.
+    *
+    */
+    public void add(Component child, Object constraints, int index) {
+        if (child instanceof JComponent) {
+            ((JComponent)child).setAlignmentX(TOP_ALIGNMENT);
+        }
+        super.add(child, constraints, index);
+    }
+
+    /** Overloaded add method to embed grid layout.
+    *
+    */
+    public void add(Component child, Object constraints) {
+        if (child instanceof JComponent) {
+            ((JComponent)child).setAlignmentX(TOP_ALIGNMENT);
+        }
+        super.add(child, constraints);
+    }
+
+    /** Refresh the component by the use of actuators.
+    *
+    * @param peer the corresponding view DOM node
+    */
+    public void refresh(final Node peer) {
+        String background = XConfigManager.getAttribute(peer , "background");
+        if (background.equals(XConfigManager.NAV)) {
+            setOpaque(false);
+            setBackground(null);
+        } else {
+            Color color = XConfigManager.getColor(background);
+            setOpaque(true);
+            setBackground(color);
+        }
+    }
+
+    
+    /** Developer serialization method.
+    *
+    * @return equivalent signature.
+    */
+    public final String toString() {
+        String signature = "VBox";
+
+        return signature;
+    }
+}
+
diff --git a/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/XCosPreview.java b/scilab/modules/preferences/src/java/org/scilab/modules/preferences/Component/XCosPreview.java
new file mode 100644 (file)
index 0000000..201d512
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - Pierre GRADIT
+ *
+ * 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-en.txt
+ *
+ */
+package org.scilab.modules.preferences.Component;
+
+import javax.swing.JLabel;
+
+import org.scilab.modules.preferences.XComponent;
+
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public class XCosPreview extends JLabel implements XComponent {
+
+    /** Universal identifier for serialization.
+     *
+     */
+    private static final long serialVersionUID = 3462302313959678932L;
+
+    /** Define the set of actuators.
+     *
+     * @return array of actuator names.
+     */
+    public final String [] actuators() {
+        String [] actuators = {};
+        return actuators;
+    }
+
+    /** Constructor.
+    *
+    * @param peer : associated view DOM node.
+    */
+    public XCosPreview(final Node peer) {
+        super();
+        //setLayout(new BorderLayout());
+        //XConfigManager.setDimension(this, peer);
+        //XConfigManager.drawConstructionBorders(this);
+    }
+
+    /** Refresh the component by the use of actuators.
+    *
+    * @param peer the corresponding view DOM node
+    */
+    public void refresh(final Node peer) {
+        Node root = peer.getFirstChild().getFirstChild();
+        NodeList nodeList = root.getChildNodes();
+        String portSize = "[";
+        
+        for (int i = 0 ; i < nodeList.getLength() ; ++i) {
+            Node cur = nodeList.item(i);
+            portSize = portSize + cur.getNodeName();
+            portSize = portSize + "=";
+            portSize = portSize + cur.getNodeValue();
+            portSize = portSize + ";";
+
+        }
+        portSize = portSize + "]";
+        setText(portSize);
+    }
+
+    /** Developer serialization method.
+    *
+    * @return equivalent signature.
+    */
+    public final String toString() {
+        String signature = "BlockPreview";
+
+        return signature;
+    }
+}
\ No newline at end of file
diff --git a/scilab/modules/preferences/src/java/org/scilab/modules/preferences/ScilabPreferences.java b/scilab/modules/preferences/src/java/org/scilab/modules/preferences/ScilabPreferences.java
new file mode 100644 (file)
index 0000000..d02d864
--- /dev/null
@@ -0,0 +1,100 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - DIGITEO - Calixte DENIZET
+ *
+ * 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-en.txt
+ *
+ */
+
+package org.scilab.modules.preferences;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Class to get the toolboxes informations
+ * @author Calixte DENIZET
+ */
+public class ScilabPreferences {
+
+    private static Map<String, ToolboxInfos> tbxs = new HashMap<String, ToolboxInfos>();
+
+    /**
+     * @param name the toolbox name
+     * @param path the toolbox path
+     * @param prefFile the toolbox preference file path
+     */
+    public static void addToolboxInfos(String name, String path, String prefFile) {
+        tbxs.put(path, new ToolboxInfos(name, path, prefFile));
+    }
+
+    /**
+     * @return a list of the toolboxes infos
+     */
+    public static List<ToolboxInfos> getToolboxesInfos() {
+        return new ArrayList<ToolboxInfos>(tbxs.values());
+    }
+
+    /**
+     * @param path the toolbox to remove
+     */
+    public static void removeToolboxInfos(String path) {
+        tbxs.remove(path);
+    }
+
+    /**
+     * Toolbox infos
+     */
+    public static class ToolboxInfos {
+
+        private String name;
+        private String path;
+        private String prefFile;
+
+        /**
+         * Default constructor
+         * @param name the toolbox name
+         * @param path the toolbox path
+         * @param prefFile the toolbox preference file path
+         */
+        public ToolboxInfos(String name, String path, String prefFile) {
+            this.name = name;
+            this.path = path;
+            this.prefFile = prefFile;
+        }
+
+        /**
+         * @return the toolbox name
+         */
+        public String getName() {
+            return name;
+        }
+
+        /**
+         * @return the toolbox path
+         */
+        public String getPath() {
+            return path;
+        }
+
+        /**
+         * @return the toolbox preference file path
+         */
+        public String getPrefFile() {
+            return prefFile;
+        }
+
+        /**
+         * {@inheritDoc}
+         */
+        public String toString() {
+            return "Toolbox: " + name + "\nPath: "+ path + "\nPreference file: " + prefFile;
+        }
+    }
+}
diff --git a/scilab/modules/preferences/src/java/org/scilab/modules/preferences/XChooser.java b/scilab/modules/preferences/src/java/org/scilab/modules/preferences/XChooser.java
new file mode 100644 (file)
index 0000000..4632f3b
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - Pierre GRADIT
+ *
+ * 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-en.txt
+ *
+ */
+
+package org.scilab.modules.preferences;
+
+import java.awt.event.ActionListener;
+
+/** XChooser implements an XComponent giving a response.
+ *
+ * @author Pierre GRADIT
+ *
+ **/
+public interface XChooser {
+
+
+    /** Subscription for an action listener.
+     *
+     * @param actionListener : subscribing listener.
+     */
+    void addActionListener(ActionListener actionListener);
+
+    /** Actual response read by the listener.
+     *
+     * @return response read by the listener.
+     */
+    String choose();
+
+}
+
+
diff --git a/scilab/modules/preferences/src/java/org/scilab/modules/preferences/XCommonManager.java b/scilab/modules/preferences/src/java/org/scilab/modules/preferences/XCommonManager.java
new file mode 100644 (file)
index 0000000..bfda797
--- /dev/null
@@ -0,0 +1,696 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - INRIA - Vincent COUVERT
+ * Copyright (C) 2011 -         Pierre GRADIT
+ *
+ * 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-en.txt
+ *
+ */
+
+package org.scilab.modules.preferences;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.Dimension;
+import java.awt.Frame;
+import java.awt.GraphicsEnvironment;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.Hashtable;
+
+import javax.swing.BorderFactory;
+import javax.swing.JComponent;
+import javax.swing.JDialog;
+import javax.swing.SwingUtilities;
+import javax.swing.border.Border;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.TransformerFactoryConfigurationError;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.scilab.modules.localization.Messages;
+
+import org.scilab.modules.commons.ScilabCommons;
+import org.scilab.modules.commons.xml.ScilabDocumentBuilderFactory;
+import org.scilab.modules.commons.xml.ScilabTransformerFactory;
+
+import org.scilab.modules.gui.console.ScilabConsole;
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentFragment;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+/* This class is the common ancestor to both X_manager.
+ */
+public abstract class XCommonManager {
+
+    /** XConfiguration management verbosity.*/
+    public static final boolean performances = true;
+    /** XConfiguration management verbosity.*/
+    public static final boolean differential = true;
+
+    /** Message for read error.*/
+    protected static final String ERROR_READ = "Could not load file: ";
+    /** Message for write error.*/
+    protected static final String ERROR_WRITE = "Could not save file: ";
+    /** Buffer size.*/
+    protected static final int BUFSIZE = 1024;
+
+    /** Main dialog.*/
+    protected static       JDialog  dialog;
+    //private static SwingScilabTab dialog;
+    /** DOM Document.*/
+    protected static         Document document;
+    /** DOM Document.*/
+    protected static         String documentAddress;
+    /** Up-to-date flag.*/
+    protected static         boolean  updated = false;
+
+    /** Top level DOM Node.*/
+    protected static Node topDOM;
+    /** Top level Swing container.*/
+    protected static Container topSwing;
+    /** Container-Sentinel correspondence.*/
+    protected static Hashtable<Component, XSentinel> correspondance;
+    /** Last visitor.*/
+    protected static XUpdateVisitor visitor;
+
+    /** Last current time.
+     */
+    protected static long time = System.currentTimeMillis();
+    /** Monitor time between calls.
+     *
+     */
+    public static void printTimeStamp(final String msg) {
+        long nextTime  = System.currentTimeMillis();
+        long deltaTime = nextTime - time;
+        if (performances) {
+            System.out.println(
+                (msg.startsWith("*")?"":" |  ")
+                + msg + " in " + deltaTime + " ms."
+                );
+        }
+        time   = nextTime;
+    }
+
+    /** Launch swing hierarchy update.
+     *
+     * @return whether XSL return a node or not.
+     */
+    public static boolean refreshDisplay() {
+        // Generate new view DOM.
+        printTimeStamp("Context found");
+        topDOM = generateViewDOM().getNode().getFirstChild();
+        printTimeStamp("View XML generated");
+        if (topDOM == null) {
+            System.err.println("XSL does not give a node!");
+            return false;
+        }
+
+        // Refresh correspondence
+        //    TODO top layout changes
+        visitor = new XUpdateVisitor(correspondance);
+        visitor.visit(topSwing, topDOM, "\t");
+        printTimeStamp("SWING refreshed");
+        setDimension(dialog, topDOM);
+        dialog.pack();
+        printTimeStamp("Packing done");
+        /*
+         *     Control outputs
+         */
+//C       System.out.println(viewDOM());
+//C       System.out.println(swingComposite());
+        return true;
+    }
+
+    /** Horizontal space between parent and child in String representations.
+     *
+     */
+    public static final String INCREMENT = "    ";
+
+    /** Compute recursive string representation of DOM view tree.
+     *
+     * @param node : current node
+     * @param indent : current indentation
+     *   @return node representation
+     *
+     */
+    private static String viewDOM(final Node node, final String indent) {
+        String signature = indent;
+        if (node.hasAttributes()) {
+            signature += XSentinel.signature(node, new String[0]);
+        } else {
+            String single = node.getNodeName() + ": " + node.getNodeValue();
+            signature    += single.replaceAll("[ \t\n]+", " ");
+        }
+        signature += "\n";
+        NodeList nodelist = node.getChildNodes();
+        if (true) {
+            for (int i = 0; i < nodelist.getLength(); i++) {
+                Node item  = nodelist.item(i);
+                signature += viewDOM(item, indent + INCREMENT);
+            }
+        }
+        return signature;
+    }
+
+    /** Compute top-level string representation of DOM view tree.
+     *
+     * @return document representation
+     */
+    protected static String viewDOM() {
+        return viewDOM(topDOM, "");
+    }
+
+    /** Compute recursive string representation of Swing tree.
+     *
+     * @param component : current component
+     * @param indent : current indentation
+     * @return component representation
+     *
+     */
+    private static String swingComposite(
+        final Component component,
+        final String indent) {
+        String signature = indent;
+        if (true) {
+            signature       += component.toString();
+        }
+        signature       += "\n";
+        if (component instanceof Container) {
+            Container container = (Container) component;
+            Component [] components = container.getComponents();
+            for (int i = 0; i < components.length; i++) {
+                Component child = components[i];
+                signature += swingComposite(child, indent + INCREMENT);
+            }
+        }
+        return signature;
+    }
+
+    /** Compute top-level string representation of swing composite.
+     *
+     * @return Graphical interface representation
+     */
+    protected static String swingComposite() {
+        return swingComposite(topSwing, "");
+    }
+
+    /** XSL Transformer factory.
+     *
+     */
+    protected static TransformerFactory
+    factory  = ScilabTransformerFactory.newInstance();
+    /** XML Document builder factory.
+     *
+     */
+    protected static DocumentBuilderFactory
+    builder  = ScilabDocumentBuilderFactory.newInstance();
+
+    /** XSL Transformer.
+     *
+     */
+    protected static Transformer transformer = null;
+
+    /** Load XSL as XSL Transformer.
+     *
+     */
+    protected static void reloadTransformer(String address) {
+        try {
+            StreamSource source = new StreamSource(address);
+            transformer         = factory.newTransformer(source);
+        } catch (TransformerConfigurationException e1) {
+            System.out.println(ERROR_READ + address);
+        } catch (TransformerFactoryConfigurationError e1) {
+            System.out.println(ERROR_READ + address);
+        }
+    }
+
+    /** Generate view by application of XSL on XConfiguration file.
+     *
+     * @return View DOM.
+     */
+    private static DOMResult generateViewDOM() {
+        DOMResult result    = new DOMResult();
+        DOMSource source    = new DOMSource(document);
+        try {
+            if (false) {
+                //TODO transmit font family list to XSL
+                GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
+                String [] fonts = ge.getAvailableFontFamilyNames();
+                for (int i=0; i< fonts.length; i++) {
+                    System.out.println("                <option font-family='" + fonts[i] + "'/>");
+                }
+            }
+            transformer.transform(source, result);
+        } catch (TransformerException e) {
+            // Just highlight clear transformer output.
+            System.out.println("\n");
+        }
+        return result;
+    }
+
+    /** Identify an element with its context string.
+     *
+     * @see XConfiguration.xsl#context
+     * @param context : the context string used to catch the element.
+     * @return the corresponding node
+     */
+    public static Element getElementByContext(final String context) {
+        String [] ids    = context.split("/");
+        Element element = (Element) document.getDocumentElement();
+        for (int i = 0; i < ids.length; i++) {
+            Integer integer     = Integer.parseInt(ids[i]);
+            int index           = integer.intValue();
+            // get the element with corresponding index (filter text nodes)
+            NodeList childNodes = element.getChildNodes();
+            Node node           = null;
+            int j = 0;
+            while (index > 0 && j < childNodes.getLength()) {
+                node = childNodes.item(j);
+                if (node.getNodeName() != "#text"
+                    && node.getNodeName() != "#comment"
+                    ) {
+                    index--;
+                }
+                j++;
+            }
+            if (index == 0) {
+                element = (Element) node;
+            } else {
+                // j == childNodes.getLength()
+                System.err.println("'" + context + "' out of document!");
+                return null;
+            }
+            //System.err.println( i + " = " + element.getNodeName());
+        }
+        return element;
+    }
+
+
+    /** Interpret action.
+     *
+     * @param action : to be interpreted.
+     * @param source : component source of the action (only class is needed).
+     * @return if the event is handled here
+     */
+    protected static boolean generixEvent(
+        final Node [] actions,
+        final Component source
+        ) {
+        printTimeStamp("*** Event occured");
+
+        if (actions.length==0) {
+            return false;
+        }
+
+        Node action = actions[0];
+        // All actions must be of the same kind.
+
+        if (differential) {
+            System.out.print("*** " + action.getNodeName());
+        }
+        if (!getAttribute(action, "set").equals(NAV)) {
+            for (int i=0; i < actions.length; i++) {
+                action = actions[i];
+                String context   = getAttribute(action, "context");
+                if (differential) {
+                    System.out.println(" hits " + context);
+                }
+                Element element  = getElementByContext(context);
+                String value     = getAttribute(action, "value");
+                String attribute = getAttribute(action, "set");
+                if (!(element == null)) {
+                    element.setAttribute(attribute, value);
+                }
+            }
+            refreshDisplay();
+            updated = true;
+            return true;
+        }
+        if (!getAttribute(action, "insert").equals(NAV)) {
+            for (int i=0; i < actions.length; i++) {
+                action = actions[i];
+                String context   = getAttribute(action, "context");
+                if (differential) {
+                    System.out.println(" hits " + context);
+                }
+                Element element           = getElementByContext(context);
+                String insertValue        = XCommonManager.getAttribute(action, "insert");
+                int insert = 0;
+                try {
+                    insert = Integer.decode(insertValue);
+
+                }
+                catch (NumberFormatException e) {
+                    XChooser chooser   = (XChooser) source;
+                    insertValue        = chooser.choose();
+                    insert = Integer.decode(insertValue) + 1;
+                }
+                Node hook = null;
+                NodeList nodelist = element.getChildNodes();
+                for (int xi=0; xi < nodelist.getLength(); xi++) {
+                    Node node = nodelist.item(xi);
+                    if (node.getNodeName() != "#text"
+                        && node.getNodeName() != "#comment"
+                        ) {
+                        if (insert == 1) {
+                            hook = node;
+                            break;
+                        }
+                        insert --;
+                    }
+                }
+                DocumentFragment fragment = document.createDocumentFragment();
+                while (action.hasChildNodes()) {
+                    Node transferred = action.getFirstChild();
+                    action.removeChild(transferred);
+                    transferred = document.importNode(transferred, true);
+                    fragment.appendChild(transferred);
+                }
+                if (!(element == null)) {
+                    element.insertBefore(fragment, hook);
+                }
+            }
+            refreshDisplay();
+            updated = true;
+            return true;
+        }
+
+        if (!getAttribute(action, "delete").equals(NAV)) {
+            for (int i=0; i < actions.length; i++) {
+                action = actions[i];
+                String context   = getAttribute(action, "context");
+                if (differential) {
+                    System.out.println(" hits " + context);
+                }
+                Element element           = getElementByContext(context);
+                String xDelete            = XCommonManager.getAttribute(action, "delete");
+                int delete = 0;
+                try {
+                    delete = Integer.decode(xDelete);
+
+                }
+                catch (NumberFormatException e) {
+                    if (source==null) {
+                        System.out.println(" lost! ");
+                        return false;
+                    }
+                    XChooser chooser   = (XChooser) source;
+                    xDelete            = chooser.choose();
+                    delete = Integer.decode(xDelete);
+                }
+                Node deleted = null;
+                NodeList nodelist = element.getChildNodes();
+                for (int xi=0; xi < nodelist.getLength(); xi++) {
+                    Node node = nodelist.item(xi);
+                    if (node.getNodeName() != "#text"
+                        && node.getNodeName() != "#comment"
+                        ) {
+                        if (delete == 1) {
+                            deleted = node;
+                            break;
+                        }
+                        delete --;
+                    }
+                }
+                if (!(element == null) && !(deleted == null)) {
+                    element.removeChild(deleted);
+                } else {
+                    System.out.println(" lost! " + delete);
+                }
+            }
+            refreshDisplay();
+            updated = true;
+            return true;
+        }
+
+        if (!getAttribute(action, "choose").equals(NAV)) {
+            String context   = getAttribute(action, "context");
+            if (differential) {
+                System.out.println(" hits " + context);
+            }
+            Element element  = getElementByContext(context);
+            if (source==null) {
+                System.out.println(" lost! ");
+                return false;
+            }
+            if (source instanceof XChooser) {
+                XChooser chooser   = (XChooser) source;
+                String   value     = chooser.choose();
+                if (value != null) {
+                    String   attribute = getAttribute(action, "choose");
+                    if (!(element == null)) {
+                        element.setAttribute(attribute, value);
+                    }
+                    refreshDisplay();
+                    updated = true;
+                }
+            } else {
+                System.err.println("@choose attribute only valid on choosers "
+                                   + "(SELECT, COLOR, FILE, ENTRY,...)");
+            }
+            return true;
+        }
+        return false;
+    }
+
+    /** Sentinel string for attribute consulting.
+     *
+     */
+    public static final String NAV = "\"not an value'";
+
+    /** Attribute consulting with default.
+     *
+     * @param node : consulted node
+     * @param name : attribute key
+     * @param value : default value
+     * @return the consulted value
+     */
+    public static String getAttribute(
+        final Node node,
+        final String name,
+        final String value
+        ) {
+        String response = getAttribute(node, name);
+        if (response == NAV) {
+            return value;
+        }
+        return response;
+    }
+
+    /** Attribute consulting without default.
+     *
+     * @param node : consulted node.
+     * @param name : attribute key.
+     * @return the consulted value (or NAV if attribute key is absent)
+     */
+    public static String getAttribute(final Node node, final String name) {
+        NamedNodeMap attrs = node.getAttributes();
+        if (attrs == null) {
+            return NAV;
+        }
+        Node attr = attrs.getNamedItem(name);
+        if (attr == null) {
+            return NAV;
+        }
+        return attr.getNodeValue();
+    }
+
+    /** Typed attribute consulting with default.
+     *
+     * @param node : consulted node.
+     * @param name : attribute key.
+     * @param value : default value.
+     * @return the value.
+     */
+    public static int getInt(
+        final Node node,
+        final String name,
+        final int value
+        ) {
+        String response = getAttribute(node, name);
+        if (response.equals(NAV)) {
+            return value;
+        }
+        if (response.equals("")) {
+            return value;
+        }
+        Integer integer = Integer.parseInt(response);
+        return integer.intValue();
+    }
+
+
+    /** Manage color representation.
+     *
+     * @param source : the color.
+     * @return the string representation.
+     */
+    public static String getColor(final Color source) {
+        String hexStr = Integer.toHexString(source.getRGB());
+        return "#" + hexStr.substring(2);
+    }
+
+    /** Manage color representation.
+     *
+     * @param source : the string representation.
+     * @return the corresponding color
+     */
+    public static Color getColor(final String source) {
+        return Color.decode(source);
+    }
+
+    /** Get top level window for correct dialog opening.
+     *
+     * @return top-level frame.
+     */
+    protected static Frame getTopLevel() {
+        Container main = (Container) ScilabConsole.getConsole().getAsSimpleConsole();
+        return (Frame) SwingUtilities.getAncestorOfClass(Frame.class, main);
+    }
+
+    /** draw construction borders for layout debug.
+     *
+     * @param component : the marked component.
+     */
+    public static void drawConstructionBorders(final JComponent component) {
+        if (false) {
+            // hard-coded flag.
+            Border construction = BorderFactory.createLineBorder(Color.red);
+            component.setBorder(construction);
+        }
+    }
+
+    /** Set a dimension for a component.
+     *
+     * @param component : the resized component.
+     * @param peer : the node having the dimension information.
+     */
+    public static void setDimension(
+        final Component component,
+        final Node peer) {
+        int      height     = XConfigManager.getInt(peer , "height", 0);
+        int       width     = XConfigManager.getInt(peer , "width",  0);
+        if (height > 0 && width > 0) {
+            //System.err.println("Dimension: " + width + "x" + height);
+            Dimension dimension = new Dimension(width, height);
+            component.setPreferredSize(dimension);
+        }
+    }
+
+    /** Create a copy of Scilab configuration file in the user directory.
+     *
+     */
+    public static void createUserCopy(String original, String copy) {
+        File fileConfig = new File(copy);
+        if (!fileConfig.exists()
+            /*|| (fileConfig.length() == 0) || checkVersion()*/
+            ) {
+            refreshUserCopy(original, copy);
+        }
+    }
+
+    /** Refresh configuration file in the user directory with Scilab defaults.
+     *
+     */
+    public static void refreshUserCopy(String original, String copy) {
+        /* Create a local copy of the configuration file */
+        try {
+            copyFile(new File(original),
+                     new File(copy));
+        } catch (FileNotFoundException e) {
+            System.out.println(ERROR_READ + copy);
+        }
+    }
+
+    /**
+     * Copy a file
+     * @param in src file
+     * @param out dest file
+     * @throws FileNotFoundException
+     */
+    private static void copyFile(final File in, final File out) throws FileNotFoundException {
+        FileInputStream fis = new FileInputStream(in);
+        FileOutputStream fos = new FileOutputStream(out);
+
+        byte[] buf = new byte[BUFSIZE];
+        int i = 0;
+        try {
+            while ((i = fis.read(buf)) != -1) {
+                fos.write(buf, 0, i);
+            }
+            fis.close();
+            fos.close();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+
+    /**
+     * Read the file to modify
+     */
+    protected static Document readDocument(final String fileName) {
+        File xml = null;
+        DocumentBuilder docBuilder = null;
+
+        try {
+            DocumentBuilderFactory factory = ScilabDocumentBuilderFactory.newInstance();
+            docBuilder = factory.newDocumentBuilder();
+
+            // lecture du contenu d'un fichier XML avec DOM
+            xml = new File(fileName);
+            return docBuilder.parse(xml);
+        } catch (ParserConfigurationException pce) {
+            System.out.println(ERROR_READ + fileName);
+        } catch (SAXException se) {
+            System.out.println(ERROR_READ + fileName);
+        } catch (IOException ioe) {
+            System.out.println(ERROR_READ + fileName);
+        }
+        return null;
+    }
+
+    /**
+     * Save the modifications
+     */
+    protected static void writeDocument(String filename,  Node written) {
+        Transformer transformer = null;
+        try {
+            transformer = ScilabTransformerFactory.newInstance().newTransformer();
+        } catch (TransformerConfigurationException e1) {
+            System.out.println(ERROR_WRITE + filename);
+        } catch (TransformerFactoryConfigurationError e1) {
+            System.out.println(ERROR_WRITE + filename);
+        }
+        transformer.setOutputProperty(OutputKeys.INDENT, "yes");
+
+        StreamResult result = new StreamResult(new File(filename));
+        DOMSource source = new DOMSource(written);
+        try {
+            transformer.transform(source, result);
+        } catch (TransformerException e) {
+            System.out.println(ERROR_WRITE + filename);
+        }
+    }
+}
diff --git a/scilab/modules/preferences/src/java/org/scilab/modules/preferences/XComponent.java b/scilab/modules/preferences/src/java/org/scilab/modules/preferences/XComponent.java
new file mode 100644 (file)
index 0000000..70afb9b
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - Pierre GRADIT
+ *
+ * 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-en.txt
+ *
+ */
+
+package org.scilab.modules.preferences;
+
+import org.w3c.dom.Node;
+
+/** XComponent implements scilab components compliant with XManagement.
+ *
+ * @author Pierre GRADIT
+ */
+public interface XComponent {
+
+    // CAUTION : Layout information have to be set in constructor!
+
+    /** Define the set of actuators.
+     *
+     * @return array of actuator names.
+     */
+    String [] actuators();
+
+    /** Refresh the component by the use of actuators.
+     *
+     * @param peer the corresponding view DOM node
+     */
+    void refresh(Node peer);
+}
+
+
diff --git a/scilab/modules/preferences/src/java/org/scilab/modules/preferences/XComponentAttributes.java b/scilab/modules/preferences/src/java/org/scilab/modules/preferences/XComponentAttributes.java
new file mode 100644 (file)
index 0000000..a265156
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - DIGITEO - 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-en.txt
+ *
+ */
+
+package org.scilab.modules.preferences;
+
+/**
+ * XComponent attributes list
+ */
+public final class XComponentAttributes {
+       
+       public static final String BACKGROUND = "background";
+       public static final String FOREGROUND = "foreground";
+       public static final String TOOLTIP = "tooltip";
+       
+       /**
+        * Constructor
+        */
+       private XComponentAttributes() {
+       
+       }
+}
diff --git a/scilab/modules/preferences/src/java/org/scilab/modules/preferences/XConfigManager.java b/scilab/modules/preferences/src/java/org/scilab/modules/preferences/XConfigManager.java
new file mode 100644 (file)
index 0000000..e6be938
--- /dev/null
@@ -0,0 +1,912 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2011 - INRIA - Vincent COUVERT
+ * Copyright (C) 2011 -         Pierre GRADIT
+ *
+ * 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-en.txt
+ *
+ */
+
+package org.scilab.modules.preferences;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.Toolkit;
+import java.awt.event.ComponentAdapter;
+import java.awt.event.ComponentEvent;
+import java.awt.event.ComponentListener;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+
+import javax.swing.JDialog;
+import javax.swing.JTextArea;
+import javax.swing.JScrollPane;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentFragment;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import org.scilab.modules.commons.ScilabCommons;
+import org.scilab.modules.gui.utils.Position;
+import org.scilab.modules.gui.utils.Size;
+import org.scilab.modules.preferences.ScilabPreferences.ToolboxInfos;
+
+/**
+ * Extended management of the Console configuration file.
+ *
+ * @author Pierre GRADIT
+ * @author Vincent COUVERT *
+ */
+public final class XConfigManager extends XCommonManager {
+
+    /** Scilab configuration file.*/
+    private static final   String   SCILAB_CONFIG_FILE =
+        System.getenv("SCI") + "/modules/preferences/etc/XConfiguration.xml";
+    /** Scilab configuration stylesheet.*/
+    private static final   String   SCILAB_CONFIG_XSL  =
+        System.getenv("SCI") + "/modules/preferences/src/xslt/XConfiguration.xsl";
+    /** User configuration file.*/
+    private static final   String   USER_CONFIG_FILE   =
+        ScilabCommons.getSCIHOME() + "/XConfiguration.xml";
+
+    /**
+     * Constructor blocked, singleton pattern.
+     */
+    private XConfigManager() {
+        throw new UnsupportedOperationException();
+    }
+    
+    /** Exclusive activity flag between all XCommonManager descendants.*/
+    public static boolean active = false;
+
+    /** Display dialog and wait for events.
+     *
+     */
+    public static void displayAndWait() {
+       XConfigManager.active = true;
+        XWizardManager.active = false;
+        printTimeStamp("XConfigManager launched");
+        System.out.println(" |  No active manager (" + XConfigManager.active + ", " + XWizardManager.active + ").");
+
+        reloadTransformer(SCILAB_CONFIG_XSL);
+        printTimeStamp("XSL loaded");
+
+        // Set up Swing Side
+        dialog      = new JDialog(getTopLevel(), "Scilab Preferences", true);
+        topSwing    = dialog.getContentPane();
+
+        //dialog = new SwingScilabTab("Scilab Preferences");
+        //topSwing = new JPanel();
+        dialog.setContentPane(topSwing);
+        topSwing.setLayout(new BorderLayout());
+        // AWT implies to set layout at construction time.
+
+        // Set up DOM Side
+        readUserDocuments();
+        updated = false;
+        printTimeStamp("Model XML loaded");
+
+        // Plug in resize
+        //dialog.setResizable(false);
+        dialog.addComponentListener(new ComponentAdapter(){
+            public void componentResized(ComponentEvent e) {
+                Element element = (Element) document.getDocumentElement();
+                Dimension dimension = dialog.getSize();
+                int      height     = XConfigManager.getInt(element , "height", 0);
+                int       width     = XConfigManager.getInt(element , "width",  0);
+                if (Math.abs(height * 1.0 - dimension.getHeight()) > 0.1 
+                 && Math.abs( width * 1.0 - dimension.getWidth())  > 0.1 ) {
+                    element.setAttribute("height", "" + (int) dimension.getHeight());
+                    element.setAttribute("width" , "" + (int) dimension.getWidth());
+                 // System.err.println("RESIZE: " + dimension);
+                }
+            }
+        });
+
+        // Set up correspondence
+        correspondance = new Hashtable<Component, XSentinel>();
+
+        // Let the show begin!
+        if (refreshDisplay()) {
+            dialog.setVisible(true);
+        }
+
+    }
+
+    /**
+     * Opens a dialog to setup preferences.
+     */
+    public static void openPreferences() {
+        XConfigManager.displayAndWait();
+    }
+
+    /** Secondary dialog for help.*/
+    private static JDialog  help = null;
+    /** Help component.*/
+    private static JTextArea xml = null;
+    /** Help component text size.*/
+    private static final int TEXT_SIZE = 30;
+
+    /** Read files to modify (and possibly create it).
+     */
+    private static void readUserDocuments() {
+        // Main file
+        createUserCopy(SCILAB_CONFIG_FILE, USER_CONFIG_FILE);
+        document = readDocument(USER_CONFIG_FILE);
+        NodeList toolboxes = document.getElementsByTagName("toolboxes");
+        if (toolboxes.getLength() != 1) {
+             System.err.println("Can't hook toolboxes [1]");
+             return;
+        }
+        
+        // Toolboxes files
+        Element toolbox          = (Element) toolboxes.item(0);
+        toolboxes                = toolbox.getChildNodes();
+        
+        if (toolboxes.getLength()>0) {
+            System.err.println("Recover from inconsistent state...");
+            while (toolbox.hasChildNodes()) {
+                toolbox.removeChild(toolbox.getFirstChild());
+            }
+        }
+        
+        // Body (rendered as XConfiguration.xsl example)
+        Element body             = document.createElement("body");
+        Element toolboxInfo      = document.createElement("toolbox-info");
+        body.appendChild(tool