Mercurial > octave
changeset 21948:241d39c66e8f
Update graphics properties for figure object.
* NEWS: Announce addition of GraphicsSmoothing property.
* graphics.in.h: Deprecate, by making hidden, the following properties:
doublebuffer, mincolormap, wvisual, wvisualmode, xdisplay, xvisual,
xvisualmode. Replace hidden __enhanced__ property with GraphicsSmoothing.
* genpropdoc.m: Update documentation for figure properties.
* gl-render.cc (draw_figure, draw_uipanel, draw_uibuttongroup): Test
GraphicsSmoothing property, not __enhanced__, to decide about anti-aliasing.
author | Rik <rik@octave.org> |
---|---|
date | Fri, 17 Jun 2016 15:18:58 -0700 |
parents | 835d070ede9c |
children | baeffde5c87d |
files | NEWS doc/interpreter/genpropdoc.m libinterp/corefcn/gl-render.cc libinterp/corefcn/graphics.in.h libinterp/dldfcn/__init_gnuplot__.cc |
diffstat | 5 files changed, 38 insertions(+), 34 deletions(-) [+] |
line wrap: on
line diff
--- a/NEWS Fri Jun 17 14:41:49 2016 -0700 +++ b/NEWS Fri Jun 17 15:18:58 2016 -0700 @@ -82,6 +82,9 @@ eventually be removed. This property has also been removed from Matlab, and was never implemented in Octave. + ** The graphics property 'graphicssmothing' for figures now controls whether + anti-aliasing will be use for lines. The default is "on". + ** Other new functions added in 4.2: audioformats
--- a/doc/interpreter/genpropdoc.m Fri Jun 17 14:41:49 2016 -0700 +++ b/doc/interpreter/genpropdoc.m Fri Jun 17 15:18:58 2016 -0700 @@ -328,19 +328,19 @@ case "dockcontrols" s.doc = doc_unused; - case "doublebuffer" - case "filename" s.doc = "The filename used when saving the plot figure."; s.valid = valid_string; case "graphicssmoothing" - s.doc = doc_unused; + s.doc = "Use smoothing techniques to reduce the appearance of jagged lines."; case "integerhandle" s.doc = "Assign the next lowest unused integer as the Figure number."; case "inverthardcopy" + s.doc = "Replace the figure and axes background color with white when printing."; + case "keypressfcn" s.valid = valid_fcn; @@ -388,16 +388,17 @@ s.doc = "The value for the @code{papersize}, and @code{paperposition} \ properties depends upon __prop__. The horizontal and vertical values for \ @code{papersize} and @code{paperposition} reverse order \ -when __prop__ is switched between @code{\"portrait\"} and either \ -@code{\"landscape\"} or @code{\"rotated\"}." +when __prop__ is switched between @code{\"portrait\"} and \ +@code{\"landscape\"}." case "paperposition" s.doc = "Vector @code{[left bottom width height]} defining the \ position and size of the figure (in @code{paperunits} units) on the printed \ page. The position @code{[left bottom]} defines the lower left corner of the \ figure on the page, and the size is defined by @code{[width height]}. For \ -output formats not implicity rendered on paper, @code{width} and @code{height} \ -define the size of the image and the position information is ignored. \ +output formats not implicitly rendered on paper, @code{width} and \ +@code{height} define the size of the image and the position information is \ +ignored. \ __modemsg__."; s.valid = valid_4elvec; @@ -446,12 +447,14 @@ s.doc = doc_unused; case "resizefcn" + s.doc = "__prop__ is deprecated. Use @code{sizechangedfcn} instead." s.valid = valid_fcn; case "selectiontype" ## FIXME: docstring explaining what "{normal}|open|alt|extend" mean. case "sizechangedfcn" + s.doc = "Callback triggered when the figure window size is changed." s.valid = valid_fcn; case "toolbar" @@ -493,13 +496,6 @@ case "windowstyle" s.doc = doc_unused; - ## FIXME: Need to deprecate these for 4.2 - case "wvisual" - case "wvisualmode" - case "xdisplay" - case "xvisual" - case "xvisualmode" - endswitch ## Axes properties
--- a/libinterp/corefcn/gl-render.cc Fri Jun 17 14:41:49 2016 -0700 +++ b/libinterp/corefcn/gl-render.cc Fri Jun 17 15:18:58 2016 -0700 @@ -684,7 +684,7 @@ { // Initialize OpenGL context - init_gl_context (props.is___enhanced__ (), props.get_color_rgb ()); + init_gl_context (props.is_graphicssmoothing (), props.get_color_rgb ()); #if defined (HAVE_OPENGL) @@ -710,7 +710,7 @@ // Initialize OpenGL context - init_gl_context (figProps.is___enhanced__ (), + init_gl_context (figProps.is_graphicssmoothing (), props.get_backgroundcolor_rgb ()); // Draw children @@ -728,7 +728,7 @@ // Initialize OpenGL context - init_gl_context (figProps.is___enhanced__ (), + init_gl_context (figProps.is_graphicssmoothing (), props.get_backgroundcolor_rgb ()); // Draw children
--- a/libinterp/corefcn/graphics.in.h Fri Jun 17 14:41:49 2016 -0700 +++ b/libinterp/corefcn/graphics.in.h Fri Jun 17 15:18:58 2016 -0700 @@ -3382,23 +3382,22 @@ handle_property currentobject r , graphics_handle () array_property currentpoint r , Matrix (2, 1, 0) bool_property dockcontrols , "off" - bool_property doublebuffer , "on" string_property filename , "" bool_property graphicssmoothing , "on" bool_property integerhandle S , "on" bool_property inverthardcopy , "on" callback_property keypressfcn , Matrix () callback_property keyreleasefcn , Matrix () - radio_property menubar , "none|{figure}" - double_property mincolormap , 64 + radio_property menubar , "{figure}|none" string_property name , "" // FIXME: Need RO property which returns current figure number. // double_property number r , - radio_property nextplot , "new|{add}|replacechildren|replace" + radio_property nextplot , "{add}|new|replace|replacechildren" bool_property numbertitle , "on" array_property outerposition s , Matrix (1, 4, -1.0) - radio_property paperorientation U , "{portrait}|landscape|rotated" + radio_property paperorientation U , "{portrait}|landscape" array_property paperposition m , default_figure_paperposition () + // FIXME: Matlab default is "auto", but this messes up hgsave BIST test. radio_property paperpositionmode au , "auto|{manual}" array_property papersize U , default_figure_papersize () radio_property papertype SU , "{usletter}|uslegal|a0|a1|a2|a3|a4|a5|b0|b1|b2|b3|b4|b5|arch-a|arch-b|arch-c|arch-d|arch-e|a|b|c|d|e|tabloid|<custom>" @@ -3410,13 +3409,14 @@ radio_property renderer m , "{opengl}|painters" radio_property renderermode , "{auto}|manual" bool_property resize , "on" + // FIXME: resizefcn has been deprecated by Matlab, and + // replaced with sizechangedfcn + // Eventually this will need to be hidden, and then removed. callback_property resizefcn , Matrix () - radio_property selectiontype , "{normal}|open|alt|extend" - // FIXME: This is the new name for the resizefcn from Matlab. - // Need to try supporting both for some amount of time. + radio_property selectiontype , "{normal}|extend|alt|open" callback_property sizechangedfcn , Matrix () - radio_property toolbar , "none|{auto}|figure" - radio_property units Su , "inches|centimeters|normalized|points|{pixels}|characters" + radio_property toolbar , "{auto}|figure|none" + radio_property units Su , "{pixels}|normalized|inches|centimeters|points|characters" callback_property windowbuttondownfcn , Matrix () callback_property windowbuttonmotionfcn , Matrix () callback_property windowbuttonupfcn , Matrix () @@ -3424,13 +3424,7 @@ callback_property windowkeyreleasefcn , Matrix () callback_property windowscrollwheelfcn , Matrix () radio_property windowstyle , "{normal}|modal|docked" - string_property wvisual m , "" - radio_property wvisualmode , "{auto}|manual" - string_property xdisplay , "" - string_property xvisual m , "" - radio_property xvisualmode , "{auto}|manual" // Octave-specific properties - bool_property __enhanced__ h , "on" mutable string_property __gl_extensions__ hr , "" mutable string_property __gl_renderer__ hr , "" mutable string_property __gl_vendor__ hr , "" @@ -3442,6 +3436,17 @@ any_property __plot_stream__ h , Matrix () any_property __rotate_mode__ h , Matrix () any_property __zoom_mode__ h , Matrix () + + // Obsolete properties: doublebuffer, mincolormap, wvisual, wvisualmode, + // xdisplay, xvisual, xvisualmode + // FIXME: Remove in version 4.6 + bool_property doublebuffer h , "on" + double_property mincolormap h , 64 + string_property wvisual hm , "" + radio_property wvisualmode h , "{auto}|manual" + string_property xdisplay h , "" + string_property xvisual hm , "" + radio_property xvisualmode h , "{auto}|manual" END_PROPERTIES protected:
--- a/libinterp/dldfcn/__init_gnuplot__.cc Fri Jun 17 14:41:49 2016 -0700 +++ b/libinterp/dldfcn/__init_gnuplot__.cc Fri Jun 17 15:18:58 2016 -0700 @@ -90,7 +90,7 @@ { send_quit (props.get___plot_stream__ ()); props.set___plot_stream__ (Matrix ()); - props.set___enhanced__ (false); + props.set_graphicssmoothing (false); } break; }