Mercurial > octave
changeset 21699:21fdab18f857
Remove reference to drawnow 'mono' throughout scripts and code, update args test
* Backend.cc (Backend::print_figure): Remove Boolean 'mono' from argument list.
* Backend.h (Backend::print_figure): Ditto.
* graphics.cc (drawnow): Remove 'mono' from argument list. Change args length
test from 4 to 3. Remove computation of unused stack variable 'mono' and
variable type check on MONO. Change DEBUG_FILE argument test from 3 to 2.
Remove 'mono' from argument list of toolkit print_figure() call.
* graphics.in.h (graphics_toolkit::print_figure): Remove 'mono' from list of
input arguments for both definition and call to represented toolkit.
* __init_fltk__.cc (fltk_graphics_toolkit::print_figure): Remove unused 'mono'
variable from list of input arguments.
* __init_gnuplot__.cc (gnuplot_graphics_toolkit::print_figure): Remove 'mono'
variable from list of input arguments. Remove args(4) and set args(3) to
debug_file.
* __gnuplot_drawnow__.m (__gnuplot_drawnow__): Change max number of input
arguments from 5 to 4. Change test for debug_file option from 5 to 4.
* __gnuplot_print__.m (local_drawnow): Remove construction of 'mono' variable.
Remove 'mono' from drawnow() calls.
author | Daniel J Sebald <daniel.sebald@ieee.org> |
---|---|
date | Fri, 13 May 2016 18:59:29 -0500 |
parents | b766928062f5 |
children | e6fcaea7d433 |
files | libgui/graphics/Backend.cc libgui/graphics/Backend.h libinterp/corefcn/graphics.cc libinterp/corefcn/graphics.in.h libinterp/dldfcn/__init_fltk__.cc libinterp/dldfcn/__init_gnuplot__.cc scripts/plot/util/__gnuplot_drawnow__.m scripts/plot/util/private/__gnuplot_print__.m |
diffstat | 8 files changed, 18 insertions(+), 28 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/graphics/Backend.cc Sat May 14 10:50:33 2016 +1000 +++ b/libgui/graphics/Backend.cc Fri May 13 18:59:29 2016 -0500 @@ -180,7 +180,7 @@ void Backend::print_figure (const graphics_object& go, const std::string& term, - const std::string& file_cmd, bool /*mono*/, + const std::string& file_cmd, const std::string& /*debug_file*/) const { if (go.get_properties ().is_visible ())
--- a/libgui/graphics/Backend.h Sat May 14 10:50:33 2016 +1000 +++ b/libgui/graphics/Backend.h Fri May 13 18:59:29 2016 -0500 @@ -56,7 +56,7 @@ void print_figure (const graphics_object& go, const std::string& term, - const std::string& file_cmd, bool /*mono*/, + const std::string& file_cmd, const std::string& /*debug_file*/) const; static Object* toolkitObject (const graphics_object& go);
--- a/libinterp/corefcn/graphics.cc Sat May 14 10:50:33 2016 +1000 +++ b/libinterp/corefcn/graphics.cc Fri May 13 18:59:29 2016 -0500 @@ -10706,7 +10706,7 @@ "-*- texinfo -*-\n\ @deftypefn {} {} drawnow ()\n\ @deftypefnx {} {} drawnow (\"expose\")\n\ -@deftypefnx {} {} drawnow (@var{term}, @var{file}, @var{mono}, @var{debug_file})\n\ +@deftypefnx {} {} drawnow (@var{term}, @var{file}, @var{debug_file})\n\ Update figure windows and their children.\n\ \n\ The event queue is flushed and any callbacks generated are executed.\n\ @@ -10721,7 +10721,7 @@ { static int drawnow_executing = 0; - if (args.length () > 4) + if (args.length () > 3) print_usage (); unwind_protect frame; @@ -10785,10 +10785,9 @@ gh_manager::lock (); } } - else if (args.length () >= 2 && args.length () <= 4) + else if (args.length () >= 2 && args.length () <= 3) { std::string term, file, debug_file; - bool mono; term = args(0).xstring_value ("drawnow: TERM must be a string"); @@ -10815,9 +10814,7 @@ } } - mono = (args.length () >= 3 ? args(2).xbool_value ("drawnow: MONO colormode must be a boolean value") : false); - - debug_file = (args.length () > 3 ? args(3).xstring_value ("drawnow: DEBUG_FILE must be a string") : ""); + debug_file = (args.length () > 2 ? args(2).xstring_value ("drawnow: DEBUG_FILE must be a string") : ""); graphics_handle h = gcf (); @@ -10834,8 +10831,7 @@ gh_manager::unlock (); - go.get_toolkit ().print_figure (go, term, file, mono, - debug_file); + go.get_toolkit ().print_figure (go, term, file, debug_file); octave_sleep (0.05); // FIXME: really needed?
--- a/libinterp/corefcn/graphics.in.h Sat May 14 10:50:33 2016 +1000 +++ b/libinterp/corefcn/graphics.in.h Fri May 13 18:59:29 2016 -0500 @@ -2091,7 +2091,7 @@ { gripe_if_tkit_invalid ("redraw_figure"); } virtual void print_figure (const graphics_object&, const std::string&, - const std::string&, bool, + const std::string&, const std::string& = "") const { gripe_if_tkit_invalid ("print_figure"); } @@ -2205,9 +2205,9 @@ { rep->redraw_figure (go); } void print_figure (const graphics_object& go, const std::string& term, - const std::string& file, bool mono, + const std::string& file, const std::string& debug_file = "") const - { rep->print_figure (go, term, file, mono, debug_file); } + { rep->print_figure (go, term, file, debug_file); } Matrix get_canvas_size (const graphics_handle& fh) const { return rep->get_canvas_size (fh); }
--- a/libinterp/dldfcn/__init_fltk__.cc Sat May 14 10:50:33 2016 +1000 +++ b/libinterp/dldfcn/__init_fltk__.cc Fri May 13 18:59:29 2016 -0500 @@ -2334,7 +2334,7 @@ void print_figure (const graphics_object& go, const std::string& term, - const std::string& file_cmd, bool /*mono*/, + const std::string& file_cmd, const std::string& /*debug_file*/) const { figure_manager::print (go.get_handle (), file_cmd, term);
--- a/libinterp/dldfcn/__init_gnuplot__.cc Sat May 14 10:50:33 2016 +1000 +++ b/libinterp/dldfcn/__init_gnuplot__.cc Fri May 13 18:59:29 2016 -0500 @@ -105,13 +105,12 @@ } void print_figure (const graphics_object& go, const std::string& term, - const std::string& file, bool mono, + const std::string& file, const std::string& debug_file) const { octave_value_list args; if (! debug_file.empty ()) - args(4) = debug_file; - args(3) = mono; + args(3) = debug_file; args(2) = file; args(1) = term; args(0) = go.get_handle ().as_octave_value ();
--- a/scripts/plot/util/__gnuplot_drawnow__.m Sat May 14 10:50:33 2016 +1000 +++ b/scripts/plot/util/__gnuplot_drawnow__.m Fri May 13 18:59:29 2016 -0500 @@ -25,11 +25,11 @@ function __gnuplot_drawnow__ (h, term, file, debug_file) - if (nargin < 1 || nargin > 5 || nargin == 2) + if (nargin < 1 || nargin > 4 || nargin == 2) print_usage (); endif - if (nargin >= 3 && nargin <= 5) + if (nargin >= 3 && nargin <= 4) ## Produce various output formats, or redirect gnuplot stream to a ## debug file. plot_stream = []; @@ -41,7 +41,7 @@ if (gnuplot_supports_term) enhanced = gnuplot_set_term (plot_stream(1), true, h, term, file); __gnuplot_draw_figure__ (h, plot_stream(1), enhanced); - if (nargin == 5) + if (nargin == 4) fid = fopen (debug_file, "wb"); enhanced = gnuplot_set_term (fid, true, h, term, file); __gnuplot_draw_figure__ (h, fid, enhanced);
--- a/scripts/plot/util/private/__gnuplot_print__.m Sat May 14 10:50:33 2016 +1000 +++ b/scripts/plot/util/private/__gnuplot_print__.m Fri May 13 18:59:29 2016 -0500 @@ -210,16 +210,11 @@ endfunction function local_drawnow (term, file, opts) - if (opts.use_color < 0) - mono = true; - else - mono = false; - endif set (0, "currentfigure", opts.figure); if (isempty (opts.debug_file) || ! opts.debug) - drawnow (term, file, mono); + drawnow (term, file); else - drawnow (term, file, mono, opts.debug_file); + drawnow (term, file, opts.debug_file); endif if (opts.debug) fprintf ("Expanded gnuplot terminal = '%s'\n", term);