* Bug 13739: xname() set obsolete 86/21486/3
Samuel GOUGEON [Thu, 4 Jun 2020 20:30:20 +0000 (22:30 +0200)]
  http://bugzilla.scilab.org/13739

Change-Id: I13ce7523441b8a8ae135e2fa55b66679239dbd54

13 files changed:
scilab/CHANGES.md
scilab/modules/graphics/help/en_US/Graphics.xml
scilab/modules/graphics/help/en_US/figure_operations/clf.xml
scilab/modules/graphics/help/en_US/figure_operations/xname.xml
scilab/modules/graphics/help/fr_FR/Graphics.xml
scilab/modules/graphics/help/fr_FR/figure_operations/xname.xml
scilab/modules/graphics/help/ja_JP/Graphics.xml
scilab/modules/graphics/help/ja_JP/figure_operations/xname.xml
scilab/modules/graphics/help/pt_BR/Graphics.xml
scilab/modules/graphics/help/pt_BR/figure_operations/xname.xml
scilab/modules/graphics/help/ru_RU/Graphics.xml
scilab/modules/graphics/sci_gateway/c/sci_xname.c
scilab/modules/slint/src/cpp/DeprecatedChecker.cpp

index 8cb2cd2..6974a44 100644 (file)
@@ -242,6 +242,7 @@ Obsolete functions or features
 * `hist3d` is renamed `bar3d`. The former `hist3d` function is declared obsolete and will be replaced by an actual 3D histogram function in Scilab 6.2.
 * `scatter3` is obsolete. Please use `scatter3d` instead.
 * `saveafterncommands` is canceled. It will be removed from Scilab 6.1.x
+* `xname` is obsolete. It will be removed from Scilab 6.2.x. Please use `gcf().figure_name` instead.
 
 Removed Functions
 -----------------
index 93d0db3..aee5285 100644 (file)
                     <para>Return the list of graphics windows</para>
                 </listitem>
             </varlistentry>
-            <varlistentry>
-                <term>
-                    <link linkend="xname">xname</link>
-                </term>
-                <listitem>
-                    <para>Change the name of the current graphics window</para>
-                </listitem>
-            </varlistentry>
         </variablelist>
     </refsection>
     <refsection>
index 8859db1..6974fe6 100644 (file)
             <title>Clearing specific parts of a figure</title>
             <itemizedlist>
                 <listitem>
-                    <literal>xname("")</literal> or <literal>gcf().name = ""</literal> clears the
+                    <literal>gcf().name = ""</literal> clears the
                     name of the window, displayed at its very top left corner.
                 </listitem>
                 <listitem>
                 <link linkend="console_properties">ShowHiddenHandles</link>
             </member>
             <member>
-                <link linkend="xname">xname</link>
-            </member>
-            <member>
                 <link linkend="uicontrol">frames</link>
             </member>
             <member>
index 47fd9d9..ecf6789 100644 (file)
 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"  xml:lang="en" xml:id="xname">
     <refnamediv>
         <refname>xname</refname>
-        <refpurpose>change the name of the current graphics window</refpurpose>
+        <refpurpose>
+            change the name of the current graphics window
+            <emphasis role="bold">(obsolete)</emphasis>)
+        </refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Syntax</title>
     </refsection>
     <refsection>
         <title>Description</title>
+        <warning>
+            <literal>xname()</literal> is obsolete. It will be removed in Scilab 6.2.x.
+            Please use <literal>gcf().figure_name = "New name"</literal> instead.
+        </warning>
         <para>
             <function>xname</function> changes the name of the current graphics window.
         </para>
@@ -48,4 +55,15 @@ plot(x,sin(x))
 xname("sin(x) with x between -%pi*2 and %pi*2")
  ]]></programlisting>
     </refsection>
+    <refsection role="history">
+        <title>History</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.1.1</revnumber>
+                <revdescription>
+                    xname() declared obsolete. Replaced with gcf().figure_name="New name".
+                </revdescription>
+            </revision>
+        </revhistory>
+    </refsection>
 </refentry>
index a75f676..086478a 100644 (file)
                     <para>renvoie la liste des fenêtre graphiques</para>
                 </listitem>
             </varlistentry>
-            <varlistentry>
-                <term>
-                    <link linkend="xname">xname</link>
-                </term>
-                <listitem>
-                    <para>change le nom d'une fenêtre graphique</para>
-                </listitem>
-            </varlistentry>
         </variablelist>
     </refsection>
     <refsection>
index ee2b6c1..ce34ec2 100644 (file)
@@ -2,7 +2,9 @@
 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="fr" xml:id="xname">
     <refnamediv>
         <refname>xname</refname>
-        <refpurpose>change le nom de la fenêtre graphique courante  </refpurpose>
+        <refpurpose>change le nom de la fenêtre graphique courante
+            <emphasis role="bold">(obsolète)</emphasis>)
+        </refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Séquence d'appel</title>
     </refsection>
     <refsection>
         <title>Description</title>
+        <warning>
+            <literal>xname()</literal> est obsolète. Elle sera retirée de Scilab 6.2.x.
+            SVP utiliser <literal>gcf().figure_name = "New name"</literal> à la place
+        </warning>
         <para>
             <literal>xname</literal> change le nom de la fenêtre graphique courante.
         </para>
     </refsection>
+    <refsection role="history">
+        <title>Historique</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.1.1</revnumber>
+                <revdescription>
+                    xname() déclarée obsolète.  Remplacée par gcf().figure_name="Nouveau nom".
+                </revdescription>
+            </revision>
+        </revhistory>
+    </refsection>
 </refentry>
index 326cbbe..4416694 100644 (file)
                     <para>グラフィックウインドウのリストを返す</para>
                 </listitem>
             </varlistentry>
-            <varlistentry>
-                <term>
-                    <link linkend="xname">xname</link>
-                </term>
-                <listitem>
-                    <para>カレントのグラフィックウインドウの名前を変更</para>
-                </listitem>
-            </varlistentry>
         </variablelist>
     </refsection>
     <refsection>
index 9baf222..1c4a9df 100644 (file)
@@ -1,14 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-
 <!--
-
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-
  * Copyright (C) ENPC - Jean-Philippe Chancelier
-
  *
-
-
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
  *
  * This file is hereby licensed under the terms of the GNU GPL v2.0,
  * and continues to be available under such terms.
  * For more information, see the COPYING file which you should have received
  * along with this program.
-
  *
-
  -->
-
 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="ja" xml:id="xname">
-
     <refnamediv>
-
         <refname>xname</refname>
-
-        <refpurpose>カレントのグラフィックウインドウの名前を変更する</refpurpose>
-
+        <refpurpose>カレントのグラフィックウインドウの名前を変更する
+            <emphasis role="bold">(obsolete)</emphasis>)
+        </refpurpose>
     </refnamediv>
-
     <refsynopsisdiv>
-
         <title>呼び出し手順</title>
-
         <synopsis>xname(name)</synopsis>
-
     </refsynopsisdiv>
-
     <refsection>
-
         <title>引数</title>
-
         <variablelist>
-
             <varlistentry>
-
                 <term>name</term>
-
                 <listitem>
-
                     <para>文字列, 新しいグラフィックウインドウの名前.</para>
-
                 </listitem>
-
             </varlistentry>
-
         </variablelist>
-
     </refsection>
-
     <refsection>
-
         <title>説明</title>
-
+        <warning>
+            <literal>xname()</literal> is obsolete. It will be removed in Scilab 6.2.x.
+            Please use <literal>gcf().figure_name = "New name"</literal> instead.
+        </warning>
         <para>
-
             <literal>xname</literal>はカレントのグラフィックウインドウの
-
             名前を変更します.
-
         </para>
-
     </refsection>
-
     <refsection>
-
         <title>例</title>
-
         <programlisting role="example"><![CDATA[
-
 xname("Empty graphic")
-
 x=-%pi*2:0.1:%pi*2;
-
 plot(x,sin(x))
-
 xname("sin(x) with x between -%pi*2 and %pi*2")
-
  ]]></programlisting>
-
     </refsection>
-
-</refentry>
-
+    <refsection role="history">
+        <title>履歴</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.1.1</revnumber>
+                <revdescription>
+                    xname() declared obsolete. Replaced with gcf().figure_name="New name".
+                </revdescription>
+            </revision>
+        </revhistory>
+    </refsection>
+</refentry>
\ No newline at end of file
index a4d5047..08a5916 100644 (file)
                     <para>Return the list of graphics windows</para>
                 </listitem>
             </varlistentry>
-            <varlistentry>
-                <term>
-                    <link linkend="xname">xname</link>
-                </term>
-                <listitem>
-                    <para>Change the name of the current graphics window</para>
-                </listitem>
-            </varlistentry>
         </variablelist>
     </refsection>
     <refsection>
index 88423b5..3916f42 100644 (file)
@@ -16,7 +16,9 @@
 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="xname" xml:lang="pt">
     <refnamediv>
         <refname>xname</refname>
-        <refpurpose>muda o nome da janela de gráficos corrente</refpurpose>
+        <refpurpose>muda o nome da janela de gráficos corrente
+            <emphasis role="bold">(obsolete)</emphasis>)
+        </refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Seqüência de Chamamento</title>
     </refsection>
     <refsection>
         <title>Descrição</title>
+        <warning>
+            <literal>xname()</literal> is obsolete. It will be removed in Scilab 6.2.x.
+            Please use <literal>gcf().figure_name = "New name"</literal> instead.
+        </warning>
         <para>
             <literal>xname</literal> muda o nome da janela de gráficos
             corrente.
         </para>
     </refsection>
+    <refsection role="history">
+        <title>Histórico</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.1.1</revnumber>
+                <revdescription>
+                    xname() declared obsolete. Replaced with gcf().figure_name="New name".
+                </revdescription>
+            </revision>
+        </revhistory>
+    </refsection>
 </refentry>
index a00c73f..857f630 100644 (file)
                     </para>
                 </listitem>
             </varlistentry>
-            <varlistentry>
-                <term>
-                    <link linkend="xname">xname</link>
-                </term>
-                <listitem>
-                    <para>
-                        Изменение имени текущего графического окна
-                    </para>
-                </listitem>
-            </varlistentry>
         </variablelist>
     </refsection>
     <refsection>
index a7ac058..5954e57 100644 (file)
@@ -23,6 +23,7 @@
 #include "gw_graphics.h"
 #include "api_scilab.h"
 #include "Scierror.h"
+#include "sciprint.h"
 #include "localization.h"
 
 #include "BuildObjects.h"
@@ -45,6 +46,8 @@ int sci_xname(char *fname, void *pvApiCtx)
     CheckInputArgument(pvApiCtx, 1, 1);
     CheckOutputArgument(pvApiCtx, 0, 1);
 
+    sciprint(_("%s is obsolete. It will be removed from Scilab %s.\nPlease use %s instead.\n"), "xname()", "6.2.x", "gcf().figure_name");
+
     sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddrl1);
     if (sciErr.iErr)
     {
index 7f64ed7..dc12dfd 100644 (file)
@@ -2,7 +2,7 @@
  *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  *  Copyright (C) 2015 - Scilab Enterprises - Calixte DENIZET
  *  Copyright (C) 2012 - 2016 - Scilab Enterprises
- *  Copyright (C) 2017, 2018 - Samuel GOUGEON
+ *  Copyright (C) 2017 - 2020 - Samuel GOUGEON
  *
  * This file is hereby licensed under the terms of the GNU GPL v2.0,
  * pursuant to article 5.3.4 of the CeCILL v.2.1.
@@ -93,6 +93,7 @@ std::unordered_map<std::wstring, std::wstring> DeprecatedChecker::initDep()
     std::unordered_map<std::wstring, std::wstring> map;
 
     // Scilab 6.1.0 => 6.1.x
+    map.emplace(L"xname", L"gcf().figure_name");
 
     // Scilab 6.0.x => 6.1.0
     map.emplace(L"%sn", L"ellipj");