# HG changeset patch # User John W. Eaton # Date 1284446117 14400 # Node ID a8235d26b57a5ca72b17b03178683ce6dc2eaa94 # Parent 14d16530ad5975768f936bbe69eef3aff10a4f15 improve names of base_graphics_backend methods diff -r 14d16530ad59 -r a8235d26b57a src/ChangeLog --- a/src/ChangeLog Tue Sep 14 02:21:13 2010 -0400 +++ b/src/ChangeLog Tue Sep 14 02:35:17 2010 -0400 @@ -1,3 +1,12 @@ +2010-09-14 John W. Eaton + + * graphics.h.in (base_graphics_backend::initialize): Rename + from base_graphics_backend::object_created. Change all uses. + (base_graphics_backend::finalize): Rename from + base_graphics_backend::object_destoyed. Change all uses. + (base_graphics_backend::update): Rename from + base_graphics_backend::property_changed. Change all uses. + 2010-09-14 John W. Eaton * DLD-FUNCTIONS/fltk_backend.cc (fltk_backend::object_destroyed): diff -r 14d16530ad59 -r a8235d26b57a src/DLD-FUNCTIONS/fltk_backend.cc --- a/src/DLD-FUNCTIONS/fltk_backend.cc Tue Sep 14 02:21:13 2010 -0400 +++ b/src/DLD-FUNCTIONS/fltk_backend.cc Tue Sep 14 02:35:17 2010 -0400 @@ -1181,7 +1181,7 @@ bool is_valid (void) const { return true; } - void object_destroyed (const graphics_object& go) + void finalize (const graphics_object& go) { if (go.isa ("figure")) { @@ -1192,7 +1192,7 @@ } } - void property_changed (const graphics_object& go, int id) + void update (const graphics_object& go, int id) { if (go.isa ("figure")) { diff -r 14d16530ad59 -r a8235d26b57a src/graphics.cc --- a/src/graphics.cc Tue Sep 14 02:21:13 2010 -0400 +++ b/src/graphics.cc Tue Sep 14 02:35:17 2010 -0400 @@ -784,7 +784,7 @@ { graphics_backend backend = go.get_backend(); if (backend) - backend.property_changed (go, id); + backend.update (go, id); } } @@ -1827,7 +1827,7 @@ // notify backend graphics_backend backend = p->second.get_backend (); if (backend) - backend.object_destroyed (p->second); + backend.finalize (p->second); // Note: this will be valid only for first explicitly // deleted object. All its children will then have an @@ -2006,27 +2006,27 @@ // --------------------------------------------------------------------- void -base_graphics_backend::property_changed (const graphics_handle& h, int id) +base_graphics_backend::update (const graphics_handle& h, int id) { graphics_object go = gh_manager::get_object (h); - property_changed (go, id); + update (go, id); } void -base_graphics_backend::object_created (const graphics_handle& h) +base_graphics_backend::initialize (const graphics_handle& h) { graphics_object go = gh_manager::get_object (h); - object_created (go); + initialize (go); } void -base_graphics_backend::object_destroyed (const graphics_handle& h) +base_graphics_backend::finalize (const graphics_handle& h) { graphics_object go = gh_manager::get_object (h); - object_destroyed (go); + finalize (go); } // --------------------------------------------------------------------- @@ -2329,7 +2329,7 @@ bool is_valid (void) const { return true; } - void object_destroyed (const graphics_object& go) + void finalize (const graphics_object& go) { if (go.isa ("figure")) { @@ -2340,7 +2340,7 @@ } } - void property_changed (const graphics_object& go, int id) + void update (const graphics_object& go, int id) { if (go.isa ("figure")) { @@ -4717,7 +4717,7 @@ // notify backend graphics_backend backend = go->get_backend (); if (backend) - backend.object_created (obj); + backend.initialize (obj); } else error ("gh_manager::do_make_graphics_handle: invalid object type `%s'", @@ -4739,7 +4739,7 @@ // notify backend graphics_backend backend = go->get_backend (); if (backend) - backend.object_created (obj); + backend.initialize (obj); return h; } diff -r 14d16530ad59 -r a8235d26b57a src/graphics.h.in --- a/src/graphics.h.in Tue Sep 14 02:21:13 2010 -0400 +++ b/src/graphics.h.in Tue Sep 14 02:35:17 2010 -0400 @@ -1672,22 +1672,22 @@ } // Called when graphics object using this backend changes it's property. - virtual void property_changed (const graphics_object&, int) - { gripe_invalid ("property_changed"); } - - void property_changed (const graphics_handle&, int); + virtual void update (const graphics_object&, int) + { gripe_invalid ("base_graphics_backend::update"); } + + void update (const graphics_handle&, int); // Called when new object using this backend is created. - virtual void object_created (const graphics_object&) - { gripe_invalid ("object_created"); } - - void object_created (const graphics_handle&); + virtual void initialize (const graphics_object&) + { gripe_invalid ("base_graphics_backend::initialize"); } + + void initialize (const graphics_handle&); // Called when object using this backend is destroyed. - virtual void object_destroyed (const graphics_object&) - { gripe_invalid ("object_destroyed"); } - - void object_destroyed (const graphics_handle&); + virtual void finalize (const graphics_object&) + { gripe_invalid ("base_graphics_backend::finalize"); } + + void finalize (const graphics_handle&); private: std::string name; @@ -1764,27 +1764,27 @@ { return rep->get_screen_size (); } // Notifies backend that object't property has changed. - void property_changed (const graphics_object& go, int id) - { rep->property_changed (go, id); } + void update (const graphics_object& go, int id) + { rep->update (go, id); } - void property_changed (const graphics_handle& h, int id) - { rep->property_changed (h, id); } + void update (const graphics_handle& h, int id) + { rep->update (h, id); } // Notifies backend that new object was created. - void object_created (const graphics_object& go) - { rep->object_created (go); } + void initialize (const graphics_object& go) + { rep->initialize (go); } - void object_created (const graphics_handle& h) - { rep->object_created (h); } + void initialize (const graphics_handle& h) + { rep->initialize (h); } // Notifies backend that object was destroyed. // This is called only for explicitly deleted object. Children are // deleted implicitly and backend isn't notified. - void object_destroyed (const graphics_object& go) - { rep->object_destroyed (go); } + void finalize (const graphics_object& go) + { rep->finalize (go); } - void object_destroyed (const graphics_handle& h) - { rep->object_destroyed (h); } + void finalize (const graphics_handle& h) + { rep->finalize (h); } OCTINTERP_API static graphics_backend default_backend (void); @@ -2599,7 +2599,7 @@ void set_backend (const graphics_backend& b) { if (backend) - backend.object_destroyed (__myhandle__); + backend.finalize (__myhandle__); backend = b; __backend__ = b.get_name (); __plot_stream__ = Matrix ();