diff scripts/plot/graphics_toolkit.m @ 11576:8ac9687dbe9f

rename backend to graphics_toolkit
author John W. Eaton <jwe@octave.org>
date Thu, 20 Jan 2011 02:29:57 -0500
parents scripts/plot/backend.m@fd0a3ac60b0e
children 68ac95d2460c
line wrap: on
line diff
copy from scripts/plot/backend.m
copy to scripts/plot/graphics_toolkit.m
--- a/scripts/plot/backend.m
+++ b/scripts/plot/graphics_toolkit.m
@@ -17,18 +17,18 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn  {Function File} {} backend (@var{name})
-## @deftypefnx {Function File} {} backend (@var{hlist}, @var{name})
-## Change the default graphics backend to @var{name}.  If the backend is
-## not already loaded, it is first initialized (initialization is done
-## through the execution of @code{__init_@var{name}__}).
+## @deftypefn  {Function File} {} graphics_toolkit (@var{name})
+## @deftypefnx {Function File} {} graphics_toolkit (@var{hlist}, @var{name})
+## Change the default graphics graphics toolkit to @var{name}.  If the
+## toolkit is not already loaded, it is first initialized by calling the
+## function @code{__init_@var{name}__}.
 ##
-## When called with a list of figure handles, @var{hlist}, the backend is
-## changed only for the listed figures.
-## @seealso{available_backends}
+## When called with a list of figure handles, @var{hlist}, the graphics
+## toolkit is changed only for the listed figures.
+## @seealso{available_graphics_toolkits}
 ## @end deftypefn
 
-function backend (varargin)
+function graphics_toolkit (varargin)
 
   name = "";
   hlist = [];
@@ -37,33 +37,34 @@
     if (ischar (varargin{1}))
       name = varargin{1};
     else
-      error ("backend: invalid backend NAME");
+      error ("graphics_toolkit: invalid graphics toolkit NAME");
     endif
   elseif (nargin == 2)
     if (isnumeric (varargin{1}) && ischar (varargin{2}))
       hlist = varargin{1};
       name = varargin{2};
     elseif (ischar (varargin{2}))
-      error ("backend: invalid handle list");
+      error ("graphics_toolkit: invalid handle list");
     else
-      error ("backend: invalid backend NAME");
+      error ("graphics_toolkit: invalid graphics toolkit NAME");
     endif
   else
     print_usage ();
   endif
 
-  if (! any (strcmp (available_backends (), name)))
+  if (! any (strcmp (available_graphics_toolkits (), name)))
     feval (["__init_", name, "__"]);
-    if (! any (strcmp (available_backends (), name)))
-      error ("backend: backend was not correctly registered");
+    if (! any (strcmp (available_graphics_toolkits (), name)))
+      error ("graphics_toolkit: %s toolkit was not correctly registered",
+             name);
     endif
   endif
 
   if (isempty (hlist))
-    set (0, "defaultfigure__backend__", name);
+    set (0, "defaultfigure__graphics_toolkit__", name);
   else
     for h = hlist(:)'
-      set (h, "__backend__", name);
+      set (h, "__graphics_toolkit__", name);
     endfor
   endif