comparison src/graphics.cc @ 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 848f3a13b7cf
children 6ea65c5de87a
comparison
equal deleted inserted replaced
10972:14d16530ad59 10973:a8235d26b57a
782 graphics_object go = gh_manager::get_object (parent); 782 graphics_object go = gh_manager::get_object (parent);
783 if (go) 783 if (go)
784 { 784 {
785 graphics_backend backend = go.get_backend(); 785 graphics_backend backend = go.get_backend();
786 if (backend) 786 if (backend)
787 backend.property_changed (go, id); 787 backend.update (go, id);
788 } 788 }
789 } 789 }
790 790
791 // run listeners 791 // run listeners
792 if (do_run && ! error_state) 792 if (do_run && ! error_state)
1825 bp.execute_deletefcn (); 1825 bp.execute_deletefcn ();
1826 1826
1827 // notify backend 1827 // notify backend
1828 graphics_backend backend = p->second.get_backend (); 1828 graphics_backend backend = p->second.get_backend ();
1829 if (backend) 1829 if (backend)
1830 backend.object_destroyed (p->second); 1830 backend.finalize (p->second);
1831 1831
1832 // Note: this will be valid only for first explicitly 1832 // Note: this will be valid only for first explicitly
1833 // deleted object. All its children will then have an 1833 // deleted object. All its children will then have an
1834 // unknown backend. 1834 // unknown backend.
1835 1835
2004 } 2004 }
2005 2005
2006 // --------------------------------------------------------------------- 2006 // ---------------------------------------------------------------------
2007 2007
2008 void 2008 void
2009 base_graphics_backend::property_changed (const graphics_handle& h, int id) 2009 base_graphics_backend::update (const graphics_handle& h, int id)
2010 { 2010 {
2011 graphics_object go = gh_manager::get_object (h); 2011 graphics_object go = gh_manager::get_object (h);
2012 2012
2013 property_changed (go, id); 2013 update (go, id);
2014 } 2014 }
2015 2015
2016 void 2016 void
2017 base_graphics_backend::object_created (const graphics_handle& h) 2017 base_graphics_backend::initialize (const graphics_handle& h)
2018 { 2018 {
2019 graphics_object go = gh_manager::get_object (h); 2019 graphics_object go = gh_manager::get_object (h);
2020 2020
2021 object_created (go); 2021 initialize (go);
2022 } 2022 }
2023 2023
2024 void 2024 void
2025 base_graphics_backend::object_destroyed (const graphics_handle& h) 2025 base_graphics_backend::finalize (const graphics_handle& h)
2026 { 2026 {
2027 graphics_object go = gh_manager::get_object (h); 2027 graphics_object go = gh_manager::get_object (h);
2028 2028
2029 object_destroyed (go); 2029 finalize (go);
2030 } 2030 }
2031 // --------------------------------------------------------------------- 2031 // ---------------------------------------------------------------------
2032 2032
2033 void 2033 void
2034 base_properties::set_from_list (base_graphics_object& obj, 2034 base_properties::set_from_list (base_graphics_object& obj,
2327 2327
2328 ~gnuplot_backend (void) { } 2328 ~gnuplot_backend (void) { }
2329 2329
2330 bool is_valid (void) const { return true; } 2330 bool is_valid (void) const { return true; }
2331 2331
2332 void object_destroyed (const graphics_object& go) 2332 void finalize (const graphics_object& go)
2333 { 2333 {
2334 if (go.isa ("figure")) 2334 if (go.isa ("figure"))
2335 { 2335 {
2336 const figure::properties& props = 2336 const figure::properties& props =
2337 dynamic_cast<const figure::properties&> (go.get_properties ()); 2337 dynamic_cast<const figure::properties&> (go.get_properties ());
2338 2338
2339 send_quit (props.get___plot_stream__ ()); 2339 send_quit (props.get___plot_stream__ ());
2340 } 2340 }
2341 } 2341 }
2342 2342
2343 void property_changed (const graphics_object& go, int id) 2343 void update (const graphics_object& go, int id)
2344 { 2344 {
2345 if (go.isa ("figure")) 2345 if (go.isa ("figure"))
2346 { 2346 {
2347 graphics_object obj (go); 2347 graphics_object obj (go);
2348 2348
4715 go->get_properties ().execute_createfcn (); 4715 go->get_properties ().execute_createfcn ();
4716 4716
4717 // notify backend 4717 // notify backend
4718 graphics_backend backend = go->get_backend (); 4718 graphics_backend backend = go->get_backend ();
4719 if (backend) 4719 if (backend)
4720 backend.object_created (obj); 4720 backend.initialize (obj);
4721 } 4721 }
4722 else 4722 else
4723 error ("gh_manager::do_make_graphics_handle: invalid object type `%s'", 4723 error ("gh_manager::do_make_graphics_handle: invalid object type `%s'",
4724 go_name.c_str ()); 4724 go_name.c_str ());
4725 4725
4737 handle_map[h] = obj; 4737 handle_map[h] = obj;
4738 4738
4739 // notify backend 4739 // notify backend
4740 graphics_backend backend = go->get_backend (); 4740 graphics_backend backend = go->get_backend ();
4741 if (backend) 4741 if (backend)
4742 backend.object_created (obj); 4742 backend.initialize (obj);
4743 4743
4744 return h; 4744 return h;
4745 } 4745 }
4746 4746
4747 void 4747 void