Index: src/graphics.h.in =================================================================== RCS file: /cvs/octave/src/graphics.h.in,v retrieving revision 1.39 diff -c -r1.39 graphics.h.in *** src/graphics.h.in 15 Jan 2008 20:27:02 -0000 1.39 --- src/graphics.h.in 15 Jan 2008 21:07:40 -0000 *************** *** 1051,1059 **** std::string get_visible (void) const { return visible.current_value (); } ! void remove_child (const graphics_handle& h); ! void adopt (const graphics_handle& h) { octave_idx_type n = children.numel (); children.resize (1, n+1); --- 1051,1059 ---- std::string get_visible (void) const { return visible.current_value (); } ! virtual void remove_child (const graphics_handle& h); ! virtual void adopt (const graphics_handle& h) { octave_idx_type n = children.numel (); children.resize (1, n+1); *************** *** 1188,1194 **** // Update data limits for AXIS_TYPE (xdata, ydata, etc.) in the parent // axes object. ! void update_axis_limits (const std::string& axis_type) const; virtual void delete_children (void); --- 1188,1194 ---- // Update data limits for AXIS_TYPE (xdata, ydata, etc.) in the parent // axes object. ! virtual void update_axis_limits (const std::string& axis_type) const; virtual void delete_children (void); *************** *** 1291,1312 **** virtual void mark_modified (void) { ! error ("base_graphics_object::mark_modified: invalid graphics object"); } ! virtual void override_defaults (base_graphics_object&) { ! error ("base_graphics_object::override_defaults: invalid graphics object"); } ! virtual void set_from_list (property_list&) { ! error ("base_graphics_object::set_from_list: invalid graphics object"); } ! virtual void set (const caseless_str&, const octave_value&) { ! error ("base_graphics_object::set: invalid graphics object"); } virtual void set_defaults (const std::string&) --- 1291,1324 ---- virtual void mark_modified (void) { ! if (valid_object ()) ! get_properties ().mark_modified (); ! else ! error ("base_graphics_object::mark_modified: invalid graphics object"); } ! virtual void override_defaults (base_graphics_object& obj) { ! if (valid_object ()) ! get_properties ().override_defaults (obj); ! else ! error ("base_graphics_object::override_defaults: invalid graphics object"); } ! virtual void set_from_list (property_list& plist) { ! if (valid_object ()) ! get_properties ().set_from_list (*this, plist); ! else ! error ("base_graphics_object::set_from_list: invalid graphics object"); } ! virtual void set (const caseless_str& pname, const octave_value& pval) { ! if (valid_object ()) ! get_properties ().set (pname, pval); ! else ! error ("base_graphics_object::set: invalid graphics object"); } virtual void set_defaults (const std::string&) *************** *** 1316,1329 **** virtual octave_value get (bool all = false) const { ! error ("base_graphics_object::get: invalid graphics object"); ! return octave_value (); } ! virtual octave_value get (const caseless_str&) const { ! error ("base_graphics_object::get: invalid graphics object"); ! return octave_value (); } virtual octave_value get_default (const caseless_str&) const; --- 1328,1351 ---- virtual octave_value get (bool all = false) const { ! if (valid_object ()) ! return get_properties ().get (all); ! else ! { ! error ("base_graphics_object::get: invalid graphics object"); ! return octave_value (); ! } } ! virtual octave_value get (const caseless_str& pname) const { ! if (valid_object ()) ! return get_properties ().get (pname); ! else ! { ! error ("base_graphics_object::get: invalid graphics object"); ! return octave_value (); ! } } virtual octave_value get_default (const caseless_str&) const; *************** *** 1344,1371 **** virtual graphics_handle get_parent (void) const { ! error ("base_graphics_object::get_parent: invalid graphics object"); ! return graphics_handle (); } ! virtual void remove_child (const graphics_handle&) { ! error ("base_graphics_object::remove_child: invalid graphics object"); } ! virtual void adopt (const graphics_handle&) { ! error ("base_graphics_object::adopt: invalid graphics object"); } ! virtual void reparent (const graphics_handle&) { ! error ("base_graphics_object::reparent: invalid graphics object"); } virtual void defaults (void) const { ! error ("base_graphics_object::default: invalid graphics object"); } virtual base_properties& get_properties (void) --- 1366,1413 ---- virtual graphics_handle get_parent (void) const { ! if (valid_object ()) ! return get_properties ().get_parent (); ! else ! { ! error ("base_graphics_object::get_parent: invalid graphics object"); ! return graphics_handle (); ! } } ! virtual void remove_child (const graphics_handle& h) { ! if (valid_object ()) ! get_properties ().remove_child (h); ! else ! error ("base_graphics_object::remove_child: invalid graphics object"); } ! virtual void adopt (const graphics_handle& h) { ! if (valid_object ()) ! get_properties ().adopt (h); ! else ! error ("base_graphics_object::adopt: invalid graphics object"); } ! virtual void reparent (const graphics_handle& np) { ! if (valid_object ()) ! get_properties ().reparent (np); ! else ! error ("base_graphics_object::reparent: invalid graphics object"); } virtual void defaults (void) const { ! if (valid_object ()) ! { ! std::string msg = (type () + "::defaults"); ! gripe_not_implemented (msg.c_str ()); ! } ! else ! error ("base_graphics_object::default: invalid graphics object"); } virtual base_properties& get_properties (void) *************** *** 1389,1395 **** virtual bool valid_object (void) const { return false; } ! virtual std::string type (void) const { return "unknown"; } bool isa (const std::string& go_name) const { --- 1431,1441 ---- virtual bool valid_object (void) const { return false; } ! virtual std::string type (void) const ! { ! return (valid_object () ? get_properties ().graphics_object_name () ! : "unknown"); ! } bool isa (const std::string& go_name) const { *************** *** 1589,1596 **** ~root_figure (void) { xproperties.delete_children (); } - std::string type (void) const { return xproperties.graphics_object_name (); } - void mark_modified (void) { } void override_defaults (base_graphics_object& obj) --- 1635,1640 ---- *************** *** 1603,1613 **** obj.set_from_list (default_properties); } - void set_from_list (property_list& plist) - { - xproperties.set_from_list (*this, plist); - } - void set (const caseless_str& name, const octave_value& value) { if (name.compare ("default", 7)) --- 1647,1652 ---- *************** *** 1619,1629 **** xproperties.set (name, value); } - octave_value get (bool all = false) const - { - return xproperties.get (all); - } - octave_value get (const caseless_str& name) const { octave_value retval; --- 1658,1663 ---- *************** *** 1668,1690 **** return factory_properties.as_struct ("factory"); } - graphics_handle get_parent (void) const { return xproperties.get_parent (); } - - void remove_child (const graphics_handle& h) { xproperties.remove_child (h); } - - void adopt (const graphics_handle& h) { xproperties.adopt (h); } - - void reparent (const graphics_handle& np) { xproperties.reparent (np); } - base_properties& get_properties (void) { return xproperties; } const base_properties& get_properties (void) const { return xproperties; } - void defaults (void) const - { - gripe_not_implemented ("root_figure::defaults"); - } - bool valid_object (void) const { return true; } private: --- 1702,1711 ---- *************** *** 1739,1752 **** ~figure (void) { ! xproperties.delete_children (); xproperties.close (); } - std::string type (void) const { return xproperties.graphics_object_name (); } - - void mark_modified (void) { xproperties.mark_modified (); } - void override_defaults (base_graphics_object& obj) { // Allow parent (root figure) to override first (properties knows how --- 1760,1769 ---- ~figure (void) { ! xproperties.delete_children (); xproperties.close (); } void override_defaults (base_graphics_object& obj) { // Allow parent (root figure) to override first (properties knows how *************** *** 1761,1771 **** obj.set_from_list (default_properties); } - void set_from_list (property_list& plist) - { - xproperties.set_from_list (*this, plist); - } - void set (const caseless_str& name, const octave_value& value) { if (name.compare ("default", 7)) --- 1778,1783 ---- *************** *** 1777,1787 **** xproperties.set (name, value); } - octave_value get (bool all = false) const - { - return xproperties.get (all); - } - octave_value get (const caseless_str& name) const { octave_value retval; --- 1789,1794 ---- *************** *** 1801,1820 **** return default_properties.as_struct ("default"); } - graphics_handle get_parent (void) const { return xproperties.get_parent (); } - - void remove_child (const graphics_handle& h) { xproperties.remove_child (h); } - - void adopt (const graphics_handle& h) { xproperties.adopt (h); } - - void reparent (const graphics_handle& np) { xproperties.reparent (np); } - base_properties& get_properties (void) { return xproperties; } const base_properties& get_properties (void) const { return xproperties; } - void defaults (void) const { gripe_not_implemented ("figure::defaults"); } - bool valid_object (void) const { return true; } private: --- 1808,1817 ---- *************** *** 1931,1940 **** ~axes (void) { xproperties.delete_children (); } - std::string type (void) const { return xproperties.graphics_object_name (); } - - void mark_modified (void) { xproperties.mark_modified (); } - void override_defaults (base_graphics_object& obj) { // Allow parent (figure) to override first (properties knows how --- 1928,1933 ---- *************** *** 1949,1959 **** obj.set_from_list (default_properties); } - void set_from_list (property_list& plist) - { - xproperties.set_from_list (*this, plist); - } - void set (const caseless_str& name, const octave_value& value) { if (name.compare ("default", 7)) --- 1942,1947 ---- *************** *** 1970,1980 **** xproperties.set_defaults (*this, mode); } - octave_value get (bool all = false) const - { - return xproperties.get (all); - } - octave_value get (const caseless_str& name) const { octave_value retval; --- 1958,1963 ---- *************** *** 1995,2014 **** return default_properties.as_struct ("default"); } - graphics_handle get_parent (void) const { return xproperties.get_parent (); } - - void remove_child (const graphics_handle& h) { xproperties.remove_child (h); } - - void adopt (const graphics_handle& h) { xproperties.adopt (h); } - - void reparent (const graphics_handle& np) { xproperties.reparent (np); } - base_properties& get_properties (void) { return xproperties; } const base_properties& get_properties (void) const { return xproperties; } - void defaults (void) const { gripe_not_implemented ("axes::defaults"); } - void update_axis_limits (const std::string& axis_type); bool valid_object (void) const { return true; } --- 1978,1987 ---- *************** *** 2065,2115 **** ~line (void) { xproperties.delete_children (); } - std::string type (void) const { return xproperties.graphics_object_name (); } - - void mark_modified (void) { xproperties.mark_modified (); } - - void override_defaults (base_graphics_object& obj) - { - // Allow parent (figure) to override first (properties knows how - // to find the parent object). - xproperties.override_defaults (obj); - } - - void set_from_list (property_list& plist) - { - xproperties.set_from_list (*this, plist); - } - - void set (const caseless_str& name, const octave_value& val) - { - xproperties.set (name, val); - } - - octave_value get (bool all = false) const - { - return xproperties.get (all); - } - - octave_value get (const caseless_str& name) const - { - return xproperties.get (name); - } - - graphics_handle get_parent (void) const { return xproperties.get_parent (); } - - void remove_child (const graphics_handle& h) { xproperties.remove_child (h); } - - void adopt (const graphics_handle& h) { xproperties.adopt (h); } - - void reparent (const graphics_handle& h) { xproperties.reparent (h); } - base_properties& get_properties (void) { return xproperties; } const base_properties& get_properties (void) const { return xproperties; } - void defaults (void) const { gripe_not_implemented ("line::defaults"); } - bool valid_object (void) const { return true; } }; --- 2038,2047 ---- *************** *** 2167,2217 **** ~text (void) { xproperties.delete_children (); } - std::string type (void) const { return xproperties.graphics_object_name (); } - - void mark_modified (void) { xproperties.mark_modified (); } - - void override_defaults (base_graphics_object& obj) - { - // Allow parent (figure) to override first (properties knows how - // to find the parent object). - xproperties.override_defaults (obj); - } - - void set_from_list (property_list& plist) - { - xproperties.set_from_list (*this, plist); - } - - void set (const caseless_str& name, const octave_value& val) - { - xproperties.set (name, val); - } - - octave_value get (bool all = false) const - { - return xproperties.get (all); - } - - octave_value get (const caseless_str& name) const - { - return xproperties.get (name); - } - - graphics_handle get_parent (void) const { return xproperties.get_parent (); } - - void remove_child (const graphics_handle& h) { xproperties.remove_child (h); } - - void adopt (const graphics_handle& h) { xproperties.adopt (h); } - - void reparent (const graphics_handle& h) { xproperties.reparent (h); } - base_properties& get_properties (void) { return xproperties; } const base_properties& get_properties (void) const { return xproperties; } - void defaults (void) const { gripe_not_implemented ("text::defaults"); } - bool valid_object (void) const { return true; } }; --- 2099,2108 ---- *************** *** 2250,2300 **** ~image (void) { xproperties.delete_children (); } - std::string type (void) const { return xproperties.graphics_object_name (); } - - void mark_modified (void) { xproperties.mark_modified (); } - - void override_defaults (base_graphics_object& obj) - { - // Allow parent (figure) to override first (properties knows how - // to find the parent object). - xproperties.override_defaults (obj); - } - - void set_from_list (property_list& plist) - { - xproperties.set_from_list (*this, plist); - } - - void set (const caseless_str& name, const octave_value& val) - { - xproperties.set (name, val); - } - - octave_value get (bool all = false) const - { - return xproperties.get (all); - } - - octave_value get (const caseless_str& name) const - { - return xproperties.get (name); - } - - graphics_handle get_parent (void) const { return xproperties.get_parent (); } - - void remove_child (const graphics_handle& h) { xproperties.remove_child (h); } - - void adopt (const graphics_handle& h) { xproperties.adopt (h); } - - void reparent (const graphics_handle& h) { xproperties.reparent (h); } - base_properties& get_properties (void) { return xproperties; } const base_properties& get_properties (void) const { return xproperties; } - void defaults (void) const { gripe_not_implemented ("image::defaults"); } - bool valid_object (void) const { return true; } }; --- 2141,2150 ---- *************** *** 2364,2414 **** ~patch (void) { xproperties.delete_children (); } - std::string type (void) const { return xproperties.graphics_object_name (); } - - void mark_modified (void) { xproperties.mark_modified (); } - - void override_defaults (base_graphics_object& obj) - { - // Allow parent (figure) to override first (properties knows how - // to find the parent object). - xproperties.override_defaults (obj); - } - - void set_from_list (property_list& plist) - { - xproperties.set_from_list (*this, plist); - } - - void set (const caseless_str& name, const octave_value& val) - { - xproperties.set (name, val); - } - - octave_value get (bool all = false) const - { - return xproperties.get (all); - } - - octave_value get (const caseless_str& name) const - { - return xproperties.get (name); - } - - graphics_handle get_parent (void) const { return xproperties.get_parent (); } - - void remove_child (const graphics_handle& h) { xproperties.remove_child (h); } - - void adopt (const graphics_handle& h) { xproperties.adopt (h); } - - void reparent (const graphics_handle& h) { xproperties.reparent (h); } - base_properties& get_properties (void) { return xproperties; } const base_properties& get_properties (void) const { return xproperties; } - void defaults (void) const { gripe_not_implemented ("patch::defaults"); } - bool valid_object (void) const { return true; } }; --- 2214,2223 ---- *************** *** 2459,2509 **** ~surface (void) { xproperties.delete_children (); } - std::string type (void) const { return xproperties.graphics_object_name (); } - - void mark_modified (void) { xproperties.mark_modified (); } - - void override_defaults (base_graphics_object& obj) - { - // Allow parent (figure) to override first (properties knows how - // to find the parent object). - xproperties.override_defaults (obj); - } - - void set_from_list (property_list& plist) - { - xproperties.set_from_list (*this, plist); - } - - void set (const caseless_str& name, const octave_value& val) - { - xproperties.set (name, val); - } - - octave_value get (bool all = false) const - { - return xproperties.get (all); - } - - octave_value get (const caseless_str& name) const - { - return xproperties.get (name); - } - - graphics_handle get_parent (void) const { return xproperties.get_parent (); } - - void remove_child (const graphics_handle& h) { xproperties.remove_child (h); } - - void adopt (const graphics_handle& h) { xproperties.adopt (h); } - - void reparent (const graphics_handle& h) { xproperties.reparent (h); } - base_properties& get_properties (void) { return xproperties; } const base_properties& get_properties (void) const { return xproperties; } - void defaults (void) const { gripe_not_implemented ("surface::defaults"); } - bool valid_object (void) const { return true; } }; --- 2268,2277 ----