Index: src/graphics.h.in =================================================================== RCS file: /cvs/octave/src/graphics.h.in,v retrieving revision 1.41 diff -c -p -r1.41 graphics.h.in *** src/graphics.h.in 17 Jan 2008 19:07:51 -0000 1.41 --- src/graphics.h.in 18 Jan 2008 13:29:45 -0000 *************** public: *** 981,987 **** selectionhighlight ("selectionhighlight", mh, true), uicontextmenu ("uicontextmenu", mh, graphics_handle ()), userdata ("userdata", mh, Matrix ()), ! visible ("visible", mh, true) { } virtual ~base_properties (void) { } --- 981,988 ---- selectionhighlight ("selectionhighlight", mh, true), uicontextmenu ("uicontextmenu", mh, graphics_handle ()), userdata ("userdata", mh, Matrix ()), ! visible ("visible", mh, true), ! beingdeleted ("beingdeleted", mh, false) { } virtual ~base_properties (void) { } *************** public: *** 1054,1059 **** --- 1055,1063 ---- std::string get_visible (void) const { return visible.current_value (); } + bool is_beingdeleted (void) const { return beingdeleted.is_on (); } + std::string get_beingdeleted (void) const { return beingdeleted.current_value (); } + virtual void remove_child (const graphics_handle& h); virtual void adopt (const graphics_handle& h) *************** public: *** 1184,1189 **** --- 1188,1202 ---- } } + void set_beingdeleted (const octave_value& val) + { + if (! error_state) + { + beingdeleted = val; + mark_modified (); + } + } + void reparent (const graphics_handle& new_parent) { parent = new_parent; } *************** public: *** 1250,1275 **** } protected: ! string_property tag; ! string_property type; ! bool_property __modified__; ! graphics_handle __myhandle__; ! handle_property parent; ! // FIXME: use a property class for children ! Matrix children; radio_property busyaction; callback_property buttondownfcn; bool_property clipping; callback_property createfcn; callback_property deletefcn; radio_property handlevisibility; bool_property hittest; bool_property interruptible; bool_property selected; bool_property selectionhighlight; ! handle_property uicontextmenu; any_property userdata; bool_property visible; protected: std::map all_props; --- 1263,1292 ---- } protected: ! // properties common to all objects ! bool_property beingdeleted; radio_property busyaction; callback_property buttondownfcn; + // FIXME: use a property class for children + Matrix children; bool_property clipping; callback_property createfcn; callback_property deletefcn; radio_property handlevisibility; bool_property hittest; bool_property interruptible; + handle_property parent; bool_property selected; bool_property selectionhighlight; ! string_property tag; ! string_property type; any_property userdata; bool_property visible; + // additional (octave-specific) properties + bool_property __modified__; + graphics_handle __myhandle__; + // FIXME: should this really be here? + handle_property uicontextmenu; protected: std::map all_props; Index: src/graphics.cc =================================================================== RCS file: /cvs/octave/src/graphics.cc,v retrieving revision 1.75 diff -c -p -r1.75 graphics.cc *** src/graphics.cc 15 Jan 2008 18:42:30 -0000 1.75 --- src/graphics.cc 18 Jan 2008 13:29:45 -0000 *************** gh_manager::do_free (const graphics_hand *** 682,688 **** if (p != handle_map.end ()) { ! p->second.get_properties ().execute_deletefcn (); handle_map.erase (p); --- 682,689 ---- if (p != handle_map.end ()) { ! p->second.get_properties ().set_beingdeleted (true); ! p->second.get_properties ().execute_deletefcn (); handle_map.erase (p); *************** base_properties::get (const caseless_str *** 940,945 **** --- 941,948 ---- retval = get_userdata (); else if (name.compare ("visible")) retval = get_visible (); + else if (name.compare ("beingdeleted")) + retval = get_beingdeleted (); else { std::map::const_iterator it = all_props.find (name); *************** base_properties::get (bool all) const *** 982,987 **** --- 985,991 ---- m.assign ("uicontextmenu", get_uicontextmenu ()); m.assign ("userdata", get_userdata ()); m.assign ("visible", get_visible ()); + m.assign ("beingdeleted", get_beingdeleted ()); return m; } Index: src/genprops.awk =================================================================== RCS file: /cvs/octave/src/genprops.awk,v retrieving revision 1.12 diff -c -p -r1.12 genprops.awk *** src/genprops.awk 15 Jan 2008 18:42:30 -0000 1.12 --- src/genprops.awk 18 Jan 2008 13:29:45 -0000 *************** BEGIN { *** 439,445 **** { if (gather) { ! if (NF < 2) next; idx++; --- 439,445 ---- { if (gather) { ! if (NF < 2 || /^[ \t]*\/\//) next; idx++;