Mercurial > hg > octave-nkf
diff libinterp/corefcn/graphics.cc @ 18902:9fbb254c09e6
build: Fix compiling with new graphic root properties (cset 28eab2d84190).
* graphics.in.h: Remove #include "builtin-defun-decls.h". Use external, not
inline, get/set routines for format and formatspacing properties. Move get/set
routines to graphics.cc.
* graphics.cc (root_figure::properties::get_format,
root_figure::properties::set_format,
root_figure::properties::get_formatspacing,
root_figure::properties::set_format): New functions moved from graphics.in.h.
author | Rik <rik@octave.org> |
---|---|
date | Wed, 07 May 2014 08:54:19 -0700 |
parents | 868dcab453bd |
children | 89448a7523b2 |
line wrap: on
line diff
--- a/libinterp/corefcn/graphics.cc +++ b/libinterp/corefcn/graphics.cc @@ -3208,25 +3208,6 @@ // --------------------------------------------------------------------- void -root_figure::properties::set_currentfigure (const octave_value& v) -{ - graphics_handle val (v); - - if (error_state) - return; - - if (xisnan (val.value ()) || is_handle (val)) - { - currentfigure = val; - - if (val.ok ()) - gh_manager::push_figure (val); - } - else - gripe_set_invalid ("currentfigure"); -} - -void root_figure::properties::set_callbackobject (const octave_value& v) { graphics_handle val (v); @@ -3257,6 +3238,80 @@ } void +root_figure::properties::set_currentfigure (const octave_value& v) +{ + graphics_handle val (v); + + if (error_state) + return; + + if (xisnan (val.value ()) || is_handle (val)) + { + currentfigure = val; + + if (val.ok ()) + gh_manager::push_figure (val); + } + else + gripe_set_invalid ("currentfigure"); +} + +std::string +root_figure::properties::get_format (void) const +{ + return F__formatstring__ ()(0).string_value (); +} + +void +root_figure::properties::set_format (const octave_value& val) +{ + if (! error_state) + { + // Input checking and abrev. matching + format.set (val, false); + + if (! error_state) + { + Fformat (ovl (format.current_value ())); + + format.run_listeners (); + } + } +} + +std::string +root_figure::properties::get_formatspacing (void) const +{ + bool iscompact = F__compactformat__ ()(0).bool_value (); + if (iscompact) + return std::string ("compact"); + else + return std::string ("loose"); +} + +void +root_figure::properties::set_formatspacing (const octave_value& val) +{ + if (! error_state) + { + // Input checking and abrev. matching + formatspacing.set (val, false); + + if (! error_state) + { + std::string strval = formatspacing.current_value (); + + if (strval == "compact") + F__compactformat__ (ovl (true)); + else + F__compactformat__ (ovl (false)); + + formatspacing.run_listeners (); + } + } +} + +void figure::properties::set_integerhandle (const octave_value& val) { if (! error_state)