Clean-up (debug features) 95/14295/5
Vincent COUVERT [Wed, 2 Apr 2014 09:35:55 +0000 (11:35 +0200)]
Change-Id: I92ee291084cd442b719c5dba3cb97dc4c2b71861

scilab/modules/gui/macros/oldfigure.sci [deleted file]
scilab/modules/gui/sci_gateway/c/sci_uicontrol.c
scilab/modules/gui/sci_gateway/cpp/sci_saveGui.cpp

diff --git a/scilab/modules/gui/macros/oldfigure.sci b/scilab/modules/gui/macros/oldfigure.sci
deleted file mode 100644 (file)
index f771bff..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2005 - INRIA - Allan CORNET
-// Copyright (C) 2008 - INRIA - Vincent COUVERT (Java version of uicontrols)
-//
-// 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.1-en.txt
-
-function h=oldfigure(varargin)
-    // -----------------------------------------------------------
-    function h = createOrSetFigure(numOrHandle)
-        // Vincent COUVERT - INRIA 2008
-        // This function create a figure or set if if already exists
-        // The figure background is set to default for new figures
-
-        if isempty(numOrHandle)
-            alreadyExists = %F;
-        elseif type(numOrHandle)==1 // Single value
-            alreadyExists = ~isempty(find(winsid()==numOrHandle));
-        else // Handle
-            alreadyExists = ~isempty(find(winsid()==get(numOrHandle,"figure_id")));
-        end
-
-        if isempty(numOrHandle)
-            h = scf();
-        else
-            h=scf(numOrHandle);
-        end
-
-        setFigDefaultProperties(alreadyExists);
-
-    endfunction
-    // -----------------------------------------------------------
-
-    // -----------------------------------------------------------
-    function sciFigProperty = getFigureProperty(tkFigProperty)
-        // Vincent COUVERT - INRIA 2008
-        // Get the Java figure property corresponding to the TK figure property
-
-        if strcmpi(tkFigProperty, "backgroundcolor") == 0 then
-            sciFigProperty = "background";
-        elseif strcmpi(tkFigProperty, "foregroundcolor") == 0 then
-            sciFigProperty = "foreground";
-        else
-            sciFigProperty = tkFigProperty;
-        end
-    endfunction
-    // -----------------------------------------------------------
-
-    // -----------------------------------------------------------
-    function sciPropertyValue = getPropertyValue(tkFigProperty, tkPropertyValue)
-        // Vincent COUVERT - INRIA 2008
-        // Get the Java property value corresponding to the TK property value
-
-        if strcmpi(tkFigProperty, "backgroundcolor") == 0 then
-            sciPropertyValue = addcolor(tkPropertyValue);
-        elseif strcmpi(tkFigProperty, "foregroundcolor") == 0 then
-            sciPropertyValue = addcolor(tkPropertyValue);
-        else
-            sciPropertyValue = tkPropertyValue;
-        end
-    endfunction
-    // -----------------------------------------------------------
-
-    // -----------------------------------------------------------
-    function setFigDefaultProperties(alreadyExists)
-        // Jean-Baptiste SILVY - Digiteo 2008
-        // Set default properties for the lastly created figure.
-        // These properties ensure that the 3D canvas won't be created
-        // argument already exists is false if the figure has just been created.
-
-        defaultColor = [0.8 0.8 0.8];
-        curFig = gcf();
-        axes = gca();
-
-        set(curFig, "immediate_drawing", "off"); // to avoid canvas creation
-
-        if ~alreadyExists
-            // Set the default background if figure has just been created (compatibility with versions < 5.0)
-            set(curFig,"background", addcolor(defaultColor));
-            set(axes, "background", addcolor(defaultColor)); // same as figure
-        end
-
-        set(axes, "filled", "off"); // transparent axes so no need to display them
-        set(axes, "axes_visible", "off");
-
-        set(curFig, "immediate_drawing", "on"); // we can draw now
-
-    endfunction
-    // -----------------------------------------------------------
-
-    Rhs=length(varargin);
-
-    if (Rhs == 0) then
-        // Create a new graphic window
-        h = scf();
-        setFigDefaultProperties(%f);
-    else
-        if (Rhs == 1) then
-
-            if size(varargin(1), "*")==1 then
-                // Create a new graphic window or set it (if already exists)
-                h = createOrSetFigure(varargin(1));
-            else
-                error(msprintf(gettext("%s: Wrong size for input argument #%d: A ''Figure'' handle or a real expected.\n")), "figure", 1);
-            end
-
-        else
-
-            if (modulo(Rhs,2)==0) then
-                // Even number of input arguments
-
-                // Create a new graphic window or set it (if already exists)
-                h = createOrSetFigure([]);
-
-                // Set all properties
-                for i=1:2:Rhs
-                    set(h, getFigureProperty(varargin(i)), getPropertyValue(varargin(i),varargin(i+1)));
-                end
-
-            else
-                // Odd number of input arguments
-                if size(varargin(1), "*")==1 then
-                    // Create a new graphic window or set it (if already exists)
-                    h = createOrSetFigure(varargin(1));
-
-                    // Set all properties
-                    for i=2:2:Rhs
-                        set(h, getFigureProperty(varargin(i)), getPropertyValue(varargin(i),varargin(i+1)));
-                    end
-                else
-                    error(msprintf(gettext("%s: Wrong size for input argument #%d: A ''Figure'' handle or a real expected.\n")), "figure", 1);
-                end
-            end
-        end
-    end
-
-endfunction
-// -----------------------------------------------------------
-
index e996324..f7fc083 100644 (file)
@@ -166,6 +166,7 @@ int sci_uicontrol(char *fname, unsigned long fname_len)
             OverLoad(1);
             return FALSE;
         }
+#if 0 // Allow XML loading
         else if (isStringType(pvApiCtx, piAddr))
         {
             char* pstXmlfile = NULL;
@@ -206,9 +207,8 @@ int sci_uicontrol(char *fname, unsigned long fname_len)
             AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1;
             ReturnArguments(pvApiCtx);
             return TRUE;
-
-
         }
+#endif // Allow XML loading
         else /* Get parent ID */
         {
             int* piAddr = NULL;
index fc8869a..5348208 100644 (file)
@@ -41,7 +41,7 @@ int sci_saveGui(char *fname, unsigned long fname_len)
 
     int iRhs = nbInputArgument(pvApiCtx);
 
-    CheckInputArgument(pvApiCtx, 2, 3);
+    CheckInputArgument(pvApiCtx, 2, 2);
     CheckOutputArgument(pvApiCtx, 1, 1);
 
     sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr1);