# HG changeset patch # User John W. Eaton # Date 1295508597 18000 # Node ID 8ac9687dbe9f19f096a6b7c8e731383fc43ef49a # Parent d6619410e79c041784b1fb0ee4b0e0ccbac93cc5 rename backend to graphics_toolkit diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-01-20 John W. Eaton + + * configure.ac, NEWS: Update for backend -> graphics_toolkit change. + 2010-01-17 Rik * NEWS: Add quadcc to list of new functions added. diff --git a/NEWS b/NEWS --- a/NEWS +++ b/NEWS @@ -437,28 +437,28 @@ ** New graphics functions: - addlistener ezcontour gcbo refresh - addproperty ezcontourf ginput refreshdata - allchild ezmesh gtext specular - available_backends ezmeshc intwarning surfl - backend ezplot ishghandle trisurf - cla ezplot3 isocolors waitforbuttonpress - clabel ezpolar isonormals - comet ezsurf isosurface - dellistener findall linkprop - diffuse gcbf plotmatrix + addlistener ezcontour gcbo refresh + addproperty ezcontourf ginput refreshdata + allchild ezmesh gtext specular + available_graphics_toolkits ezmeshc intwarning surfl + graphics_toolkit ezplot ishghandle trisurf + cla ezplot3 isocolors waitforbuttonpress + clabel ezpolar isonormals + comet ezsurf isosurface + dellistener findall linkprop + diffuse gcbf plotmatrix ** New experimental OpenGL/FLTK based plotting system. An experimental plotting system based on OpenGL and the FLTK - toolkit is now part of Octave. This backend is disabled by + toolkit is now part of Octave. This graphics toolkit is disabled by default. You can switch to using it with the command - backend ("fltk") + graphics_toolkit ("fltk") for all future figures or for a particular figure with the command - backend (h, "fltk") + graphics_toolkit (h, "fltk") where "h" is a valid figure handle. diff --git a/configure.ac b/configure.ac --- a/configure.ac +++ b/configure.ac @@ -2393,7 +2393,7 @@ if $native_graphics; then AC_MSG_WARN([]) AC_MSG_WARN([I didn't find gnuplot. Plotting commands will use the]) - AC_MSG_WARN([native graphics backend.]) + AC_MSG_WARN([native graphics toolkit.]) else AC_MSG_WARN([I didn't find gnuplot. It isn't necessary to have gnuplot]) AC_MSG_WARN([installed, but you won't be able to use any of Octave's]) diff --git a/doc/ChangeLog b/doc/ChangeLog --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,13 @@ +2011-01-20 John W. Eaton + + * faq/OctaveFAQ.texi, interpreter/doccheck/aspell-octave.en.pws, + interpreter/octave.texi, interpreter/plot.txi: Update for + backend -> graphics_toolkit change. + + * interpreter/interpimages.m, interpreter/geometryimages.m, + interpreter/sparseimages.m, interpreter/plotimages.m: + Call graphics_toolkit, not backend. + 2011-01-19 Rik * interpreter/doccheck/aspell-octave.en.pws: Add new words to Octave diff --git a/doc/faq/OctaveFAQ.texi b/doc/faq/OctaveFAQ.texi --- a/doc/faq/OctaveFAQ.texi +++ b/doc/faq/OctaveFAQ.texi @@ -304,9 +304,9 @@ 3.2.N release in the future. This series brings the new features @itemize -@item OpenGL backend +@item OpenGL graphics toolkit -An experimental OpenGL graphics backend to replace the gnuplot +An experimental OpenGL graphics toolkit to replace the gnuplot. @item Object Orient Programming diff --git a/doc/interpreter/contrib.txi b/doc/interpreter/contrib.txi --- a/doc/interpreter/contrib.txi +++ b/doc/interpreter/contrib.txi @@ -147,10 +147,10 @@ @example @group -2008-04-02 David Bateman +2010-04-13 David Bateman - * graphics.cc (void gnuplot_backend::close_figure (const - octave_value&) const): Allow for an input and output stream. + * DLD-FUNCTIONS/regexp.cc (octregexp_list): Handle repeated matches + in the list of matches returned by pcre. @end group @end example diff --git a/doc/interpreter/doccheck/aspell-octave.en.pws b/doc/interpreter/doccheck/aspell-octave.en.pws --- a/doc/interpreter/doccheck/aspell-octave.en.pws +++ b/doc/interpreter/doccheck/aspell-octave.en.pws @@ -37,9 +37,6 @@ autoregressions autoscaled AWK -backend -Backends -backends bartlett Bateman BDF diff --git a/doc/interpreter/geometryimages.m b/doc/interpreter/geometryimages.m --- a/doc/interpreter/geometryimages.m +++ b/doc/interpreter/geometryimages.m @@ -17,7 +17,7 @@ ## . function geometryimages (nm, typ) - backend ("gnuplot"); + graphics_toolkit ("gnuplot"); set_print_size (); hide_output (); if (strcmp (typ, "png")) diff --git a/doc/interpreter/interpimages.m b/doc/interpreter/interpimages.m --- a/doc/interpreter/interpimages.m +++ b/doc/interpreter/interpimages.m @@ -17,7 +17,7 @@ ## . function interpimages (nm, typ) - backend ("gnuplot"); + graphics_toolkit ("gnuplot"); set_print_size (); hide_output (); if (strcmp (typ, "png")) diff --git a/doc/interpreter/octave.texi b/doc/interpreter/octave.texi --- a/doc/interpreter/octave.texi +++ b/doc/interpreter/octave.texi @@ -542,7 +542,7 @@ * Marker Styles:: * Callbacks:: * Object Groups:: -* Graphics Backends:: +* Graphics Toolkits:: Object Groups @@ -558,7 +558,7 @@ * Stem Series:: * Surface Group:: -Graphics Backends +Graphics Toolkits * Interaction with gnuplot:: diff --git a/doc/interpreter/plot.txi b/doc/interpreter/plot.txi --- a/doc/interpreter/plot.txi +++ b/doc/interpreter/plot.txi @@ -34,14 +34,14 @@ Earlier versions of Octave provided plotting through the use of gnuplot. This capability is still available. But, a newer plotting capability is provided by access to OpenGL@. Which plotting system -is used is controlled by the @code{backend} function. (See @ref{Graphics -Backends}.) - -The function call @code{backend ("fltk")} selects the fltk/OpenGL system, and -@code{backend ("gnuplot")} selects the gnuplot system. -The two systems may be used selectively through the use of the @code{backend} -property of the graphics handle for each figure. This is -explained in @ref{Graphics Data Structures}. +is used is controlled by the @code{graphics_toolkit} function. (See +@ref{Graphics Toolkits}.) + +The function call @code{graphics_toolkit ("fltk")} selects the +fltk/OpenGL system, and @code{graphics_toolkit ("gnuplot")} selects the +gnuplot system. The two systems may be used selectively through the use +of the @code{graphics_toolkit} property of the graphics handle for each +figure. This is explained in @ref{Graphics Data Structures}. @node High-Level Plotting @section High-Level Plotting @@ -929,24 +929,30 @@ get (h, ""); error: get: ambiguous figure property name ; possible matches: -__backend__ currentobject paperposition toolbar -__enhanced__ deletefcn paperpositionmode type -__modified__ dockcontrols papersize uicontextmenu -__myhandle__ doublebuffer papertype units -__plot_stream__ filename paperunits userdata -alphamap handlevisibility parent visible -beingdeleted hittest pointer windowbuttondownfcn -busyaction integerhandle pointershapecdata windowbuttonmotionfcn -buttondownfcn interruptible pointershapehotspot windowbuttonupfcn -children inverthardcopy position windowbuttonwheelfcn -clipping keypressfcn renderer windowstyle -closerequestfcn keyreleasefcn renderermode wvisual -color menubar resize wvisualmode -colormap mincolormap resizefcn xdisplay -createfcn name selected xvisual -currentpoint nextplot selectionhighlight xvisualmode -currentaxes numbertitle selectiontype -currentcharacter paperorientation tag +__graphics_toolkit__ hittest resize +__enhanced__ integerhandle resizefcn +__modified__ interruptible selected +__myhandle__ inverthardcopy selectionhighlight +__plot_stream__ keypressfcn selectiontype +alphamap keyreleasefcn tag +beingdeleted menubar toolbar +busyaction mincolormap type +buttondownfcn name uicontextmenu +children nextplot units +clipping numbertitle userdata +closerequestfcn paperorientation visible +color paperposition windowbuttondownfcn +colormap paperpositionmode windowbuttonmotionfcn +createfcn papersize windowbuttonupfcn +currentaxes papertype windowbuttonwheelfcn +currentcharacter paperunits windowstyle +currentobject parent wvisual +currentpoint pointer wvisualmode +deletefcn pointershapecdata xdisplay +dockcontrols pointershapehotspot xvisual +doublebuffer position xvisualmode +filename renderer +handlevisibility renderermode @end smallexample The root figure has index 0. Its properties may be displayed by: @@ -1200,8 +1206,8 @@ The @code{figure} properties are: @table @code -@item __backend__ ---- The backend currently in use. +@item __graphics_toolkit__ +--- The graphics toolkit currently in use. @item __enhanced__ @@ -2442,7 +2448,7 @@ * Marker Styles:: * Callbacks:: * Object Groups:: -* Graphics Backends:: +* Graphics Toolkits:: @end menu @@ -3204,14 +3210,14 @@ Data source variables. @end table -@node Graphics Backends -@subsection Graphics Backends -@cindex graphics backends -@cindex backends, graphics - -@DOCSTRING(backend) - -@DOCSTRING(available_backends) +@node Graphics Toolkits +@subsection Graphics Toolkits +@cindex graphics toolkits +@cindex toolkits, graphics + +@DOCSTRING(graphics_toolkit) + +@DOCSTRING(available_graphics_toolkits) @menu * Interaction with gnuplot:: diff --git a/doc/interpreter/plotimages.m b/doc/interpreter/plotimages.m --- a/doc/interpreter/plotimages.m +++ b/doc/interpreter/plotimages.m @@ -17,7 +17,7 @@ ## . function plotimages (nm, typ) - backend ("gnuplot"); + graphics_toolkit ("gnuplot"); set_print_size (); hide_output (); if (strcmp (typ, "png")) diff --git a/doc/interpreter/sparseimages.m b/doc/interpreter/sparseimages.m --- a/doc/interpreter/sparseimages.m +++ b/doc/interpreter/sparseimages.m @@ -17,7 +17,7 @@ ## . function sparseimages (nm, typ) - backend ("gnuplot"); + graphics_toolkit ("gnuplot"); set_print_size (); if (strcmp (typ, "png")) set (0, "defaulttextfontname", "*"); diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,15 @@ +2011-01-20 John W. Eaton + + * plot/ginput.m, plot/gnuplot_drawnow.m, plot/uiputfile.m, + plot/subplot.m, plot/axis.m, plot/colorbar.m, + plot/__print_parse_opts__.m, plot/uigetdir.m, + plot/__fltk_print__.m, plot/print.m, plot/__gnuplot_print__.m, + plot/uigetfile.m, plot/private/__actual_axis_position__.m: + Update for backend -> graphics_toolkit change. + + * plot/graphics_toolkit.m: Rename from backend.m. + * plot/module.mk (plot_FCN_FILES): Update list. + 2011-01-19 Rik diff --git a/scripts/plot/__fltk_print__.m b/scripts/plot/__fltk_print__.m --- a/scripts/plot/__fltk_print__.m +++ b/scripts/plot/__fltk_print__.m @@ -110,7 +110,7 @@ pipeline = {sprintf("%s > %s", cmd, opts.name)}; case {"corel", "gif"} error ("print:unsupporteddevice", - "print.m: %s output is not available for the FLTK backend.", + "print.m: %s output is not available for the FLTK graphics toolkit", upper (opts.devopt)) case opts.ghostscript.device opts.ghostscript.source = "-"; diff --git a/scripts/plot/__gnuplot_print__.m b/scripts/plot/__gnuplot_print__.m --- a/scripts/plot/__gnuplot_print__.m +++ b/scripts/plot/__gnuplot_print__.m @@ -138,7 +138,7 @@ endif otherwise error (sprintf ("print:no%soutput", opts.devopt), - "print.m: %s output is not available for the Gnuplot backend.", + "print.m: %s output is not available for the Gnuplot graphics toolkit", upper (opts.devopt)) endswitch diff --git a/scripts/plot/__print_parse_opts__.m b/scripts/plot/__print_parse_opts__.m --- a/scripts/plot/__print_parse_opts__.m +++ b/scripts/plot/__print_parse_opts__.m @@ -225,13 +225,13 @@ "eps", "ps", "ps", "pdf"}; if (isfigure (arg_st.figure)) - __backend__ = get (arg_st.figure, "__backend__"); + __graphics_toolkit__ = get (arg_st.figure, "__graphics_toolkit__"); else ## Allow tests when no figures are present. - __backend__ = get (0, "defaultfigure__backend__"); + __graphics_toolkit__ = get (0, "defaultfigure__graphics_toolkit__"); endif - if (strcmp (__backend__, "gnuplot") + if (strcmp (__graphics_toolkit__, "gnuplot") && __gnuplot_has_feature__ ("epslatex_implies_eps_filesuffix")) suffixes(strncmp (dev_list, "epslatex", 8)) = {"eps"}; endif @@ -322,7 +322,7 @@ paperposition = [0.25, 2.50, 8.00, 6.00] * 72; endif arg_st.canvas_size = paperposition(3:4); - if (strcmp (__backend__, "gnuplot") && ! arg_st.ghostscript.epscrop) + if (strcmp (__graphics_toolkit__, "gnuplot") && ! arg_st.ghostscript.epscrop) arg_st.ghostscript.pageoffset = paperposition(1:2) - 50; else arg_st.ghostscript.pageoffset = paperposition(1:2); @@ -594,7 +594,7 @@ ## "ps", "ps2", "psc", "psc2" ## ## eps, epsc, eps2, epsc2 are not included here because those are - ## are generated by the backend. + ## are generated by the graphics toolkit. aliases.bmp = "bmp32b"; aliases.pdf = "pdfwrite"; aliases.png = "png16m"; diff --git a/scripts/plot/axis.m b/scripts/plot/axis.m --- a/scripts/plot/axis.m +++ b/scripts/plot/axis.m @@ -181,7 +181,7 @@ elseif (strcmpi (ax, "square")) set (ca, "plotboxaspectratio", [1, 1, 1]); elseif (strcmp (ax, "equal")) - if (strcmp (get (get (ca, "parent"), "__backend__"), "gnuplot")) + if (strcmp (get (get (ca, "parent"), "__grahpics_toolkit__"), "gnuplot")) ## FIXME - gnuplot applies the aspect ratio activepostionproperty. set (ca, "activepositionproperty", "position"); ## The following line is a trick used to trigger the recalculation of diff --git a/scripts/plot/colorbar.m b/scripts/plot/colorbar.m --- a/scripts/plot/colorbar.m +++ b/scripts/plot/colorbar.m @@ -107,8 +107,8 @@ if (! deleting) ## FIXME - Matlab does not require the "position" property to be active. - ## Is there a way to determine the plotbox position for the gnuplot - ## backend with the outerposition is active? + ## Is there a way to determine the plotbox position for the + ## gnuplot graphics toolkit with the outerposition is active? set (ax, "activepositionproperty", "position"); obj = get (ax); obj.__my_handle__ = ax; @@ -274,7 +274,7 @@ else scale = [scale, 1]; endif - if (strcmp (get (cf, "__backend__"), "gnuplot") + if (strcmp (get (cf, "__graphics_toolkit__"), "gnuplot") && strcmp (obj.activepositionproperty, "outerposition")) obj.outerposition = obj.outerposition .* [1, 1, scale]; off = 0.5 * (obj.outerposition (3:4) - __actual_axis_position__ (obj)(3:4)); diff --git a/scripts/plot/ginput.m b/scripts/plot/ginput.m --- a/scripts/plot/ginput.m +++ b/scripts/plot/ginput.m @@ -32,13 +32,13 @@ f = gcf (); drawnow (); - backend = (get (f, "__backend__")); + toolkit = (get (f, "__graphics_toolkit__")); varargout = cell (1, nargout); if (nargin == 0) - [varargout{:}] = feval (strcat ("__", backend, "_ginput__"), f); + [varargout{:}] = feval (strcat ("__", toolkit, "_ginput__"), f); else - [varargout{:}] = feval (strcat ("__", backend, "_ginput__"), f, n); + [varargout{:}] = feval (strcat ("__", toolkit, "_ginput__"), f, n); endif endfunction diff --git a/scripts/plot/gnuplot_drawnow.m b/scripts/plot/gnuplot_drawnow.m --- a/scripts/plot/gnuplot_drawnow.m +++ b/scripts/plot/gnuplot_drawnow.m @@ -117,12 +117,13 @@ ## Generate the gnuplot "set terminal ..." command. ## When "term" originates from print.m, it may include other options. if (nargin < 4) - ## This supports the gnuplot backend. + ## This supports the gnuplot graphics toolkit. term = gnuplot_default_term (); opts_str = ""; else ## Get the one word terminal id and save the remaining as options to - ## be passed on to gnuplot. The terminal may respect the backend. + ## be passed on to gnuplot. The terminal may respect the graphics + ## toolkit. [term, opts_str] = gnuplot_trim_term (term); term = lower (term); if (strcmpi (term, "lua")) @@ -149,7 +150,7 @@ if (! isempty (h) && isfigure (h)) - ## Generate gnuplot title string for backend plot windows. + ## Generate gnuplot title string for plot windows. if (output_to_screen (term) && ~strcmp (term, "dumb")) fig.numbertitle = get (h, "numbertitle"); fig.name = get (h, "name"); diff --git a/scripts/plot/backend.m b/scripts/plot/graphics_toolkit.m rename from scripts/plot/backend.m rename to scripts/plot/graphics_toolkit.m --- a/scripts/plot/backend.m +++ b/scripts/plot/graphics_toolkit.m @@ -17,18 +17,18 @@ ## . ## -*- 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 diff --git a/scripts/plot/module.mk b/scripts/plot/module.mk --- a/scripts/plot/module.mk +++ b/scripts/plot/module.mk @@ -52,7 +52,7 @@ plot/area.m \ plot/axes.m \ plot/axis.m \ - plot/backend.m \ + plot/graphics_toolkit.m \ plot/bar.m \ plot/barh.m \ plot/box.m \ diff --git a/scripts/plot/print.m b/scripts/plot/print.m --- a/scripts/plot/print.m +++ b/scripts/plot/print.m @@ -69,15 +69,15 @@ ## @itemx ps2 ## @itemx psc ## @itemx psc2 -## Postscript (level 1 and 2, mono and color). The FLTK backend -## generates Postscript level 3.0. +## Postscript (level 1 and 2, mono and color). The FLTK graphics +## toolkit generates Postscript level 3.0. ## ## @item eps ## @itemx eps2 ## @itemx epsc ## @itemx epsc2 ## Encapsulated postscript (level 1 and 2, mono and color). The FLTK -## backend generates Postscript level 3.0. +## graphic toolkit generates Postscript level 3.0. ## ## @item tex ## @itemx epslatex @@ -90,7 +90,7 @@ ## processed directly by @LaTeX{}. The other formats are intended to ## be included in a @LaTeX{} (or @TeX{}) document. The @code{tex} device ## is the same as the @code{epslatex} device. The @code{pdflatex} device -## is only available for the FLTK backend. +## is only available for the FLTK graphics toolkit. ## ## @item tikz ## Generate a @LaTeX{} file using PGF/TikZ@. For the FLTK the result is @@ -112,7 +112,7 @@ ## Microsoft Enhanced Metafile ## ## @item fig -## XFig. For the Gnuplot backend, the additional options +## XFig. For the Gnuplot graphics toolkit, the additional options ## @option{-textspecial} or @option{-textnormal} can be used to control ## whether the special flag should be set for the text in ## the figure (default is @option{-textnormal}). @@ -131,7 +131,7 @@ ## JPEG image ## ## @item gif -## GIF image (only available for the Gnuplot backend) +## GIF image (only available for the Gnuplot graphics toolkit) ## ## @item pbm ## PBMplus @@ -283,7 +283,7 @@ ## Modify properties as specified by options props = []; - ## backend tranlates figure position to eps bbox in points + ## graphics toolkit tranlates figure position to eps bbox in points fpos = get (opts.figure, "position"); props(1).h = opts.figure; props(1).name = "position"; @@ -316,7 +316,7 @@ endif if (opts.use_color < 0 - && ! strcmp (get (opts.figure, "__backend__"), "gnuplot")) + && ! strcmp (get (opts.figure, "__graphics_toolkit__"), "gnuplot")) color_props = {"color", "facecolor", "edgecolor", "colormap"}; for c = 1:numel(color_props) h = findall (opts.figure, "-property", color_props{c}); @@ -374,8 +374,8 @@ endif endif - ## call the backend print script - switch (get (opts.figure, "__backend__")) + ## call the graphcis toolkit print script + switch (get (opts.figure, "__graphics_toolkit__")) case "gnuplot" opts = __gnuplot_print__ (opts); otherwise diff --git a/scripts/plot/private/__actual_axis_position__.m b/scripts/plot/private/__actual_axis_position__.m --- a/scripts/plot/private/__actual_axis_position__.m +++ b/scripts/plot/private/__actual_axis_position__.m @@ -44,7 +44,7 @@ set (axis_obj.parent, "position", orig_fig_position) end_unwind_protect ## Get axes size in pixels - if (strcmp (get (axis_obj.parent, "__backend__"), "gnuplot") + if (strcmp (get (axis_obj.parent, "__graphics_toolkit__"), "gnuplot") && strcmp (axis_obj.activepositionproperty, "outerposition")) pos_in_pixels = axis_obj.outerposition .* fig_position([3, 4, 3, 4]); else @@ -76,7 +76,7 @@ pos_in_pixels = pos_in_pixels + dy*[0.0, 0.5, 0.0, -1.0]; endif pos = pos_in_pixels ./ fig_position([3, 4, 3, 4]); - elseif (strcmp (get (axis_obj.parent, "__backend__"), "gnuplot") + elseif (strcmp (get (axis_obj.parent, "__graphics_toolkit__"), "gnuplot") && strcmp (axis_obj.activepositionproperty, "outerposition")) pos = axis_obj.outerposition; else diff --git a/scripts/plot/subplot.m b/scripts/plot/subplot.m --- a/scripts/plot/subplot.m +++ b/scripts/plot/subplot.m @@ -168,7 +168,7 @@ "activepositionproperty", "outerposition"); endif - if (align_axes && strcmp (get (cf, "__backend__"), "gnuplot")) + if (align_axes && strcmp (get (cf, "__graphics_toolkit__"), "gnuplot")) set (tmp, "activepositionproperty", "position"); endif diff --git a/scripts/plot/uigetdir.m b/scripts/plot/uigetdir.m --- a/scripts/plot/uigetdir.m +++ b/scripts/plot/uigetdir.m @@ -38,13 +38,13 @@ endif - if (any (strcmp (available_backends(), "fltk"))) + if (any (strcmp (available_graphics_toolkits (), "fltk"))) if (!isdir (init_path)) init_path = fileparts (init_path); endif dirname = __fltk_uigetfile__ ("", dialog_name, init_path, [240, 120], "dir"); else - error ("uigetdir: fltk backend required."); + error ("uigetdir: fltk graphics toolkit required"); endif endfunction diff --git a/scripts/plot/uigetfile.m b/scripts/plot/uigetfile.m --- a/scripts/plot/uigetfile.m +++ b/scripts/plot/uigetfile.m @@ -150,10 +150,10 @@ error ("uigetfile: number of input arguments must be less than eight"); endif - if (any (cellfun(@(x)strcmp (x, "fltk"), available_backends))) + if (any (cellfun(@(x)strcmp (x, "fltk"), available_graphics_toolkits ()))) [retfile, retpath, retindex] = __fltk_uigetfile__ (outargs{:}); else - error ("uigetfile: fltk backend required."); + error ("uigetfile: fltk graphics toolkit required."); endif diff --git a/scripts/plot/uiputfile.m b/scripts/plot/uiputfile.m --- a/scripts/plot/uiputfile.m +++ b/scripts/plot/uiputfile.m @@ -89,10 +89,10 @@ error ("uiputfile: number of input arguments must be less than four."); endif - if (any (cellfun(@(x)strcmp (x, "fltk"), available_backends))) + if (any (cellfun(@(x)strcmp (x, "fltk"), available_graphics_toolkits ()))) [retfile, retpath, retindex] = __fltk_uigetfile__ (outargs{:}); else - error ("uiputfile: fltk backend required."); + error ("uiputfile: fltk graphics toolkit required"); endif endfunction diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2011-01-20 John W. Eaton + + * gl-render.h, graphics.cc, gl-render.cc, graphics.h.in: + Update for backend -> graphics_toolkit change. + + * DLD-FUNCTIONS/__init_fltk__.cc: Rename from fltk_backend.cc + Update for backend -> graphics_toolkit change. + * DLD-FUNCTIONS/module-files, Makefile.am: Update for renamed file. + 2011-01-19 Rik * src/data.cc, src/input.cc, src/utils.cc: spellcheck docstrings. diff --git a/src/DLD-FUNCTIONS/fltk_backend.cc b/src/DLD-FUNCTIONS/__init_fltk__.cc rename from src/DLD-FUNCTIONS/fltk_backend.cc rename to src/DLD-FUNCTIONS/__init_fltk__.cc --- a/src/DLD-FUNCTIONS/fltk_backend.cc +++ b/src/DLD-FUNCTIONS/__init_fltk__.cc @@ -24,7 +24,7 @@ To initialize: - backend ("fltk"); + graphics_toolkit ("fltk"); plot (randn (1e3, 1)); */ @@ -66,7 +66,7 @@ #include "toplev.h" #include "variables.h" -#define FLTK_BACKEND_NAME "fltk" +#define FLTK_GRAPHICS_TOOLKIT_NAME "fltk" // Give FLTK no more than 0.01 sec to do its stuff. static double fltk_maxtime = 1e-2; @@ -1661,7 +1661,7 @@ if (istr >> ind) return ind; } - error ("fltk_backend: could not recognize fltk index"); + error ("figure_manager: could not recognize fltk index"); return -1; } @@ -1674,7 +1674,7 @@ static int figprops2idx (const figure::properties& fp) { - if (fp.get___backend__ () == FLTK_BACKEND_NAME) + if (fp.get___graphics_toolkit__ () == FLTK_GRAPHICS_TOOLKIT_NAME) { octave_value ps = fp.get___plot_stream__ (); if (ps.is_string ()) @@ -1682,7 +1682,7 @@ else return 0; } - error ("fltk_backend:: figure is not fltk"); + error ("figure_manager: figure is not fltk"); return -1; } @@ -1695,7 +1695,7 @@ dynamic_cast (fobj.get_properties ()); return figprops2idx (fp); } - error ("fltk_backend:: H is not a figure"); + error ("figure_manager: H is not a figure"); return -1; } @@ -1710,14 +1710,14 @@ std::string figure_manager::fltk_idx_header="fltk index="; int figure_manager::curr_index = 1; -static bool backend_registered = false; +static bool toolkit_registered = false; static int __fltk_redraw__ (void) { - if (backend_registered) + if (toolkit_registered) { - // we scan all figures and add those which use FLTK as a backend + // We scan all figures and add those which use FLTK. graphics_object obj = gh_manager::get_object (0); if (obj && obj.isa ("root")) { @@ -1731,7 +1731,8 @@ { figure::properties& fp = dynamic_cast (fobj.get_properties ()); - if (fp.get___backend__ () == FLTK_BACKEND_NAME) + if (fp.get___graphics_toolkit__ () + == FLTK_GRAPHICS_TOOLKIT_NAME) figure_manager::new_window (fp); } } @@ -1745,13 +1746,13 @@ return 0; } -class fltk_backend : public base_graphics_backend +class fltk_graphics_toolkit : public base_graphics_toolkit { public: - fltk_backend (void) - : base_graphics_backend (FLTK_BACKEND_NAME) { } + fltk_graphics_toolkit (void) + : base_graphics_toolkit (FLTK_GRAPHICS_TOOLKIT_NAME) { } - ~fltk_backend (void) { } + ~fltk_graphics_toolkit (void) { } bool is_valid (void) const { return true; } @@ -1846,7 +1847,7 @@ redraw_figure (go); } else - error ("fltk_backend: filename should be fid"); + error ("fltk_graphics_toolkit: filename should be fid"); } Matrix get_canvas_size (const graphics_handle& fh) const @@ -1869,25 +1870,18 @@ } }; -DEFUN_DLD (__fltk_redraw__, , , "") -{ - __fltk_redraw__ (); - - return octave_value (); -} - -// Initialize the fltk backend. +// Initialize the fltk graphics toolkit. DEFUN_DLD (__init_fltk__, , , "") { static bool remove_fltk_registered = false; - if (! backend_registered) + if (! toolkit_registered) { mlock (); - graphics_backend::register_backend (new fltk_backend); - backend_registered = true; + graphics_toolkit::register_toolkit (new fltk_graphics_toolkit); + toolkit_registered = true; octave_value_list args; args(0) = "__fltk_redraw__"; @@ -1905,18 +1899,24 @@ return retval; } +DEFUN_DLD (__fltk_redraw__, , , "") +{ + __fltk_redraw__ (); -// Delete the fltk backend. + return octave_value (); +} + +// Delete the fltk graphics toolkit. DEFUN_DLD (__remove_fltk__, , , "") { - if (backend_registered) + if (toolkit_registered) { munlock ("__init_fltk__"); figure_manager::close_all (); - graphics_backend::unregister_backend (FLTK_BACKEND_NAME); - backend_registered = false; + graphics_toolkit::unregister_toolkit (FLTK_GRAPHICS_TOOLKIT_NAME); + toolkit_registered = false; octave_value_list args; args(0) = "__fltk_redraw__"; @@ -1949,7 +1949,7 @@ "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{speed} =} fltk_mouse_wheel_zoom ()\n\ @deftypefnx {Built-in Function} {} fltk_mouse_wheel_zoom (@var{speed})\n\ -Query or set the mouse wheel zoom factor in the fltk backend.\n\ +Query or set the mouse wheel zoom factor in the fltk graphics toolkit.\n\ @end deftypefn") { octave_value retval = wheel_zoom_speed; @@ -1969,7 +1969,7 @@ "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{mode} =} fltk_gui_mode ()\n\ @deftypefnx {Built-in Function} {} fltk_gui_mode (@var{mode})\n\ -Query or set the GUI mode for the fltk backend.\n\ +Query or set the GUI mode for the fltk grahpics toolkit.\n\ The @var{mode} argument can be one of the following strings:\n\ @table @asis\n\ @item '2d'\n\ diff --git a/src/DLD-FUNCTIONS/module-files b/src/DLD-FUNCTIONS/module-files --- a/src/DLD-FUNCTIONS/module-files +++ b/src/DLD-FUNCTIONS/module-files @@ -3,6 +3,7 @@ __dispatch__.cc __dsearchn__.cc __glpk__.cc +__init_fltk__.cc __lin_interpn__.cc __magick_read__.cc __pchip_deriv__.cc @@ -24,9 +25,9 @@ dasrt.cc dassl.cc det.cc -dot.cc dlmread.cc dmperm.cc +dot.cc eig.cc eigs.cc fft.cc @@ -35,7 +36,6 @@ fftw.cc filter.cc find.cc -fltk_backend.cc gammainc.cc gcd.cc getgrent.cc diff --git a/src/Makefile.am b/src/Makefile.am --- a/src/Makefile.am +++ b/src/Makefile.am @@ -618,7 +618,7 @@ lex.lo lex.o oct-parse.lo oct-parse.o: \ AM_CXXFLAGS := $(filter-out -Wold-style-cast, $(AM_CXXFLAGS)) -fltk_backend.lo fltk_backend.o: \ +__init_fltk__.lo __init_fltk__.o: \ AM_CXXFLAGS := $(filter-out $(DLL_CXXDEFS), $(AM_CXXFLAGS) $(GRAPHICS_CFLAGS)) # XERBLA = ../libcruft/blas-xtra/xerbla.o @@ -818,9 +818,9 @@ DLD_FUNCTIONS___glpk___la_CPPFLAGS = $(AM_CPPFLAGS) $(GLPK_CPPFLAGS) DLD_FUNCTIONS___glpk___la_LIBADD += $(GLPK_LDFLAGS) $(GLPK_LIBS) -DLD-FUNCTIONS/fltk_backend.df: CPPFLAGS += $(GRAPHICS_CFLAGS) $(FT2_CPPFLAGS) -DLD_FUNCTIONS_fltk_backend_la_CPPFLAGS = $(AM_CPPFLAGS) $(GRAPHICS_CFLAGS) $(FT2_CPPFLAGS) -DLD_FUNCTIONS_fltk_backend_la_LIBADD += $(GRAPHICS_LDFLAGS) $(GRAPHICS_LIBS) $(FT2_LDFLAGS) $(FT2_LIBS) +DLD-FUNCTIONS/__init_fltk__.df: CPPFLAGS += $(GRAPHICS_CFLAGS) $(FT2_CPPFLAGS) +DLD_FUNCTIONS___init_fltk___la_CPPFLAGS = $(AM_CPPFLAGS) $(GRAPHICS_CFLAGS) $(FT2_CPPFLAGS) +DLD_FUNCTIONS___init_fltk___la_LIBADD += $(GRAPHICS_LDFLAGS) $(GRAPHICS_LIBS) $(FT2_LDFLAGS) $(FT2_LIBS) DLD-FUNCTIONS/amd.df: CPPFLAGS += $(SPARSE_XCPPFLAGS) DLD_FUNCTIONS_amd_la_CPPFLAGS = $(AM_CPPFLAGS) $(SPARSE_XCPPFLAGS) diff --git a/src/gl-render.cc b/src/gl-render.cc --- a/src/gl-render.cc +++ b/src/gl-render.cc @@ -564,7 +564,7 @@ void opengl_renderer::draw_figure (const figure::properties& props) { - backend = props.get_backend (); + toolkit = props.get_toolkit (); // Initialize OpenGL context @@ -3245,7 +3245,7 @@ return 0; unsigned int ID = glGenLists (1); - double sz = size * backend.get_screen_resolution () / 72.0; + double sz = size * toolkit.get_screen_resolution () / 72.0; // constants for the * marker const double sqrt2d4 = 0.35355339059327; diff --git a/src/gl-render.h b/src/gl-render.h --- a/src/gl-render.h +++ b/src/gl-render.h @@ -137,8 +137,8 @@ bool filled) const; private: - // the backend associated with the figure being rendered - graphics_backend backend; + // The graphics toolkit associated with the figure being rendered. + graphics_toolkit toolkit; // axes transformation data graphics_xform xform; diff --git a/src/graphics.cc b/src/graphics.cc --- a/src/graphics.cc +++ b/src/graphics.cc @@ -765,15 +765,15 @@ if (do_set (v)) { - // notify backend + // Notify graphics toolkit. if (id >= 0) { graphics_object go = gh_manager::get_object (parent); if (go) { - graphics_backend backend = go.get_backend(); - if (backend) - backend.update (go, id); + graphics_toolkit toolkit = go.get_toolkit (); + if (toolkit) + toolkit.update (go, id); } } @@ -1871,14 +1871,14 @@ bp.execute_deletefcn (); - // notify backend - graphics_backend backend = p->second.get_backend (); - if (backend) - backend.finalize (p->second); + // Notify graphics toolkit. + graphics_toolkit toolkit = p->second.get_toolkit (); + if (toolkit) + toolkit.finalize (p->second); // Note: this will be valid only for first explicitly // deleted object. All its children will then have an - // unknown backend. + // unknown graphics toolkit. // Graphics handles for non-figure objects are negative // integers plus some random fractional part. To avoid @@ -2051,7 +2051,7 @@ // --------------------------------------------------------------------- void -base_graphics_backend::update (const graphics_handle& h, int id) +base_graphics_toolkit::update (const graphics_handle& h, int id) { graphics_object go = gh_manager::get_object (h); @@ -2059,7 +2059,7 @@ } void -base_graphics_backend::initialize (const graphics_handle& h) +base_graphics_toolkit::initialize (const graphics_handle& h) { graphics_object go = gh_manager::get_object (h); @@ -2067,7 +2067,7 @@ } void -base_graphics_backend::finalize (const graphics_handle& h) +base_graphics_toolkit::finalize (const graphics_handle& h) { graphics_object go = gh_manager::get_object (h); @@ -2244,15 +2244,15 @@ obj.update_axis_limits (axis_type, h); } -graphics_backend -base_properties::get_backend (void) const +graphics_toolkit +base_properties::get_toolkit (void) const { graphics_object go = gh_manager::get_object (get_parent ()); if (go) - return go.get_backend (); + return go.get_toolkit (); else - return graphics_backend (); + return graphics_toolkit (); } void @@ -2291,13 +2291,13 @@ // --------------------------------------------------------------------- -class gnuplot_backend : public base_graphics_backend +class gnuplot_toolkit : public base_graphics_toolkit { public: - gnuplot_backend (void) - : base_graphics_backend ("gnuplot") { } - - ~gnuplot_backend (void) { } + gnuplot_toolkit (void) + : base_graphics_toolkit ("gnuplot") { } + + ~gnuplot_toolkit (void) { } bool is_valid (void) const { return true; } @@ -2402,16 +2402,16 @@ } }; -graphics_backend -graphics_backend::default_backend (void) -{ - if (available_backends.size () == 0) - register_backend (new gnuplot_backend ()); - - return available_backends["gnuplot"]; -} - -std::map graphics_backend::available_backends; +graphics_toolkit +graphics_toolkit::default_toolkit (void) +{ + if (available_toolkits.size () == 0) + register_toolkit (new gnuplot_toolkit ()); + + return available_toolkits["gnuplot"]; +} + +std::map graphics_toolkit::available_toolkits; // --------------------------------------------------------------------- @@ -3816,7 +3816,7 @@ // FIXME -- was this really needed? When compared to Matlab, it // does not seem to be required. Need investigation with concrete - // backend to see results visually. + // graphics toolkit to see results visually. if (false && dowarp) af = 1.0 / (xM > yM ? xM : yM); else @@ -5507,8 +5507,8 @@ { handle_map[0] = graphics_object (new root_figure ()); - // Make sure the default backend is registered. - graphics_backend::default_backend (); + // Make sure the default graphics toolkit is registered. + graphics_toolkit::default_toolkit (); } graphics_handle @@ -5529,10 +5529,10 @@ if (do_createfcn) go->get_properties ().execute_createfcn (); - // notify backend - graphics_backend backend = go->get_backend (); - if (backend) - backend.initialize (obj); + // Notify graphics toolkit. + graphics_toolkit toolkit = go->get_toolkit (); + if (toolkit) + toolkit.initialize (obj); } else error ("gh_manager::do_make_graphics_handle: invalid object type `%s'", @@ -5551,10 +5551,10 @@ handle_map[h] = obj; - // notify backend - graphics_backend backend = go->get_backend (); - if (backend) - backend.initialize (obj); + // Notify graphics toolkit. + graphics_toolkit toolkit = go->get_toolkit (); + if (toolkit) + toolkit.initialize (obj); return h; } @@ -6734,15 +6734,15 @@ return retval; } -DEFUN (available_backends, , , +DEFUN (available_graphics_toolkits, , , "-*- texinfo -*-\n\ -@deftypefn {Built-in Function} {} available_backends ()\n\ -Return a cell array of registered graphics backends.\n\ +@deftypefn {Built-in Function} {} available_graphiscs_toolkits ()\n\ +Return a cell array of registered graphics toolkits.\n\ @end deftypefn") { gh_manager::autolock guard; - return octave_value (graphics_backend::available_backends_list ()); + return octave_value (graphics_toolkit::available_toolkits_list ()); } DEFUN (drawnow, args, , @@ -6798,7 +6798,7 @@ { gh_manager::unlock (); - fprops.get_backend ().redraw_figure (go); + fprops.get_toolkit ().redraw_figure (go); gh_manager::lock (); } @@ -6879,7 +6879,7 @@ gh_manager::unlock (); - go.get_backend () + go.get_toolkit () .print_figure (go, term, file, mono, debug_file); gh_manager::lock (); diff --git a/src/graphics.h.in b/src/graphics.h.in --- a/src/graphics.h.in +++ b/src/graphics.h.in @@ -348,7 +348,7 @@ void set_id (int d) { id = d; } - // Sets property value, notifies backend. + // Sets property value, notifies graphics toolkit. // If do_run is true, runs associated listeners. bool set (const octave_value& v, bool do_run = true); @@ -1764,19 +1764,19 @@ // --------------------------------------------------------------------- -class graphics_backend; +class graphics_toolkit; class graphics_object; -class base_graphics_backend +class base_graphics_toolkit { public: - friend class graphics_backend; + friend class graphics_toolkit; public: - base_graphics_backend (const std::string& nm) + base_graphics_toolkit (const std::string& nm) : name (nm), count (0) { } - virtual ~base_graphics_backend (void) { } + virtual ~base_graphics_toolkit (void) { } std::string get_name (void) const { return name; } @@ -1809,26 +1809,26 @@ } // Callback function executed when the given graphics object - // changes. This allows the grahpics backend to act on property + // changes. This allows the grahpics toolkit to act on property // changes if needed. virtual void update (const graphics_object&, int) - { gripe_invalid ("base_graphics_backend::update"); } + { gripe_invalid ("base_graphics_toolkit::update"); } void update (const graphics_handle&, int); // Callback function executed when the given graphics object is - // created. This allows the graphics backend to do backend-specific + // created. This allows the graphics toolkit to do toolkit-specific // initializations for a newly created object. virtual void initialize (const graphics_object&) - { gripe_invalid ("base_graphics_backend::initialize"); } + { gripe_invalid ("base_graphics_toolkit::initialize"); } void initialize (const graphics_handle&); // Callback function executed just prior to deleting the given - // graphics object. This allows the graphics backend to perform - // backend-specific cleanup operations before an object is deleted. + // graphics object. This allows the graphics toolkit to perform + // toolkit-specific cleanup operations before an object is deleted. virtual void finalize (const graphics_object&) - { gripe_invalid ("base_graphics_backend::finalize"); } + { gripe_invalid ("base_graphics_toolkit::finalize"); } void finalize (const graphics_handle&); @@ -1840,38 +1840,38 @@ void gripe_invalid (const std::string& fname) const { if (! is_valid ()) - error ("%s: invalid graphics backend", fname.c_str ()); + error ("%s: invalid graphics toolkit", fname.c_str ()); } }; -class graphics_backend +class graphics_toolkit { public: - graphics_backend (void) - : rep (new base_graphics_backend ("unknown")) + graphics_toolkit (void) + : rep (new base_graphics_toolkit ("unknown")) { rep->count++; } - graphics_backend (base_graphics_backend* b) + graphics_toolkit (base_graphics_toolkit* b) : rep (b) { rep->count++; } - graphics_backend (const graphics_backend& b) + graphics_toolkit (const graphics_toolkit& b) : rep (b.rep) { rep->count++; } - ~graphics_backend (void) + ~graphics_toolkit (void) { if (--rep->count == 0) delete rep; } - graphics_backend& operator = (const graphics_backend& b) + graphics_toolkit& operator = (const graphics_toolkit& b) { if (rep != b.rep) { @@ -1906,66 +1906,71 @@ Matrix get_screen_size (void) const { return rep->get_screen_size (); } - // Notifies backend that object't property has changed. + // Notifies graphics toolkit that object't property has changed. void update (const graphics_object& go, int id) { rep->update (go, id); } void update (const graphics_handle& h, int id) { rep->update (h, id); } - // Notifies backend that new object was created. + // Notifies graphics toolkit that new object was created. void initialize (const graphics_object& go) { rep->initialize (go); } void initialize (const graphics_handle& h) { rep->initialize (h); } - // Notifies backend that object was destroyed. + // Notifies graphics toolkit that object was destroyed. // This is called only for explicitly deleted object. Children are - // deleted implicitly and backend isn't notified. + // deleted implicitly and graphics toolkit isn't notified. void finalize (const graphics_object& go) { rep->finalize (go); } void finalize (const graphics_handle& h) { rep->finalize (h); } - OCTINTERP_API static graphics_backend default_backend (void); - - static void register_backend (const graphics_backend& b) - { available_backends[b.get_name ()] = b; } - - static void unregister_backend (const std::string& name) - { available_backends.erase (name); } - - static graphics_backend find_backend (const std::string& name) + OCTINTERP_API static graphics_toolkit default_toolkit (void); + + static void register_toolkit (const graphics_toolkit& b) + { available_toolkits[b.get_name ()] = b; } + + static void unregister_toolkit (const std::string& name) + { available_toolkits.erase (name); } + + static graphics_toolkit find_toolkit (const std::string& name) { - const_available_backends_iterator p = available_backends.find (name); - - if (p != available_backends.end ()) + const_available_toolkits_iterator p = available_toolkits.find (name); + + if (p != available_toolkits.end ()) return p->second; else - return default_backend (); + return default_toolkit (); } - static Cell available_backends_list (void) + static Cell available_toolkits_list (void) { - Cell m (1 , available_backends.size ()); - const_available_backends_iterator p; + Cell m (1 , available_toolkits.size ()); + const_available_toolkits_iterator p; int i; - for (i = 0,p = available_backends.begin (); p != available_backends.end (); p++,i++) + for (i = 0, p = available_toolkits.begin (); + p != available_toolkits.end (); p++, i++) m(i) = p->first; return m; } private: - base_graphics_backend *rep; - - static OCTINTERP_API std::map available_backends; - - typedef std::map::iterator available_backends_iterator; - typedef std::map::const_iterator const_available_backends_iterator; + base_graphics_toolkit *rep; + + static OCTINTERP_API std::map + available_toolkits; + + typedef std::map::iterator + available_toolkits_iterator; + + typedef std::map::const_iterator + const_available_toolkits_iterator; }; // --------------------------------------------------------------------- @@ -2037,7 +2042,7 @@ mark_modified (); } - virtual graphics_backend get_backend (void) const; + virtual graphics_toolkit get_toolkit (void) const; virtual Matrix get_boundingbox (bool /*internal*/ = false) const { return Matrix (1, 4, 0.0); } @@ -2355,14 +2360,14 @@ return type () == go_name; } - virtual graphics_backend get_backend (void) const + virtual graphics_toolkit get_toolkit (void) const { if (valid_object ()) - return get_properties ().get_backend (); + return get_properties ().get_toolkit (); else { - error ("base_graphics_object::get_backend: invalid graphics object"); - return graphics_backend (); + error ("base_graphics_object::get_toolkit: invalid graphics object"); + return graphics_toolkit (); } } @@ -2579,7 +2584,7 @@ bool is_handle_visible (void) const { return get_properties ().is_handle_visible (); } - graphics_backend get_backend (void) const { return rep->get_backend (); } + graphics_toolkit get_toolkit (void) const { return rep->get_toolkit (); } void add_property_listener (const std::string& nm, const octave_value& v, listener_mode mode = POSTSET) @@ -2753,44 +2758,44 @@ void set_visible (const octave_value& val); - graphics_backend get_backend (void) const + graphics_toolkit get_toolkit (void) const { - if (! backend) - backend = graphics_backend::default_backend (); - - return backend; + if (! toolkit) + toolkit = graphics_toolkit::default_toolkit (); + + return toolkit; } - void set_backend (const graphics_backend& b) + void set_toolkit (const graphics_toolkit& b) { - if (backend) - backend.finalize (__myhandle__); - backend = b; - __backend__ = b.get_name (); + if (toolkit) + toolkit.finalize (__myhandle__); + toolkit = b; + __graphics_toolkit__ = b.get_name (); __plot_stream__ = Matrix (); mark_modified (); } - void set___backend__ (const octave_value& val) + void set___graphics_toolkit__ (const octave_value& val) { if (! error_state) { if (val.is_string ()) { std::string nm = val.string_value (); - graphics_backend b = graphics_backend::find_backend (nm); + graphics_toolkit b = graphics_toolkit::find_toolkit (nm); if (b.get_name () != nm) { - error ("set___backend__: invalid backend"); + error ("set___graphics_toolkit__: invalid graphics toolkit"); } else { - set_backend (b); + set_toolkit (b); mark_modified (); } } else - error ("set___backend__ must be a string"); + error ("set___graphics_toolkit__ must be a string"); } } @@ -2858,7 +2863,7 @@ string_property xvisual , "" radio_property xvisualmode , "{auto}|manual" callback_property buttondownfcn , Matrix () - string_property __backend__ s , "gnuplot" + string_property __graphics_toolkit__ s , "gnuplot" END_PROPERTIES protected: @@ -2873,7 +2878,7 @@ } private: - mutable graphics_backend backend; + mutable graphics_toolkit toolkit; }; private: @@ -4453,13 +4458,13 @@ // created. std::list figure_list; - // The lock for accessing the graphics sytsem + // The lock for accessing the graphics sytsem. octave_mutex graphics_lock; - // The list of event queued by backends + // The list of events queued by graphics toolkits. std::list event_queue; - // The stack of callback objects + // The stack of callback objects. std::list callback_objects; graphics_handle get_handle (const std::string& go_name);