changeset 10973:a8235d26b57a

improve names of base_graphics_backend methods
author John W. Eaton <jwe@octave.org>
date Tue, 14 Sep 2010 02:35:17 -0400
parents 14d16530ad59
children c6dc5f666695
files src/ChangeLog src/DLD-FUNCTIONS/fltk_backend.cc src/graphics.cc src/graphics.h.in
diffstat 4 files changed, 48 insertions(+), 39 deletions(-) [+]
line wrap: on
line diff
--- 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  <jwe@octave.org>
+
+	* 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  <jwe@octave.org>
 
 	* DLD-FUNCTIONS/fltk_backend.cc (fltk_backend::object_destroyed):
--- 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"))
       {
--- 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;
 }
--- 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 ();