Mercurial > jwe > octave
diff libinterp/corefcn/graphics.cc @ 31110:670a0d878af1
eliminate WHO arguments from interpreter-private functions
* interpreter-private.h, inpterpreter-private.cc (__get_interpreter__,
__get_dynamic_loader__, __get_error_system__, __get_gh_manager__,
__get_help_system__, __get_input_system__, __get_load_path__,
__get_load_save_system__, __get_event_manager__,
__get_output_system__, __get_type_info__, __get_symbol_table__,
__get_current_scope__, __require_current_scope__, __get_evaluator__,
__get_bp_table__, __get_child_list__, __get_cdef_manager__,
__get_display_info__, __get_gtk_manager__): Eliminate WHO argument.
Previously, it was never displayed by __get_interpreter__. And, as
pointed out by Petter Tomner in patch #10216, passing a std::string
object could have performance issues.
(__get_interpreter__): Eliminate useless call to error. Display
message to std::cerr then abort.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 22 Jun 2022 12:48:59 -0400 |
parents | c9788d7f6e65 |
children |
line wrap: on
line diff
--- a/libinterp/corefcn/graphics.cc Tue Jun 21 15:44:03 2022 +0200 +++ b/libinterp/corefcn/graphics.cc Wed Jun 22 12:48:59 2022 -0400 @@ -224,8 +224,7 @@ static double default_screendepth (void) { - octave::display_info& dpy_info - = octave::__get_display_info__ ("default_screendepth"); + octave::display_info& dpy_info = octave::__get_display_info__ (); return dpy_info.depth (); } @@ -235,8 +234,7 @@ { Matrix retval (1, 4); - octave::display_info& dpy_info - = octave::__get_display_info__ ("default_screensize"); + octave::display_info& dpy_info = octave::__get_display_info__ (); retval(0) = 1.0; retval(1) = 1.0; @@ -249,8 +247,7 @@ static double default_screenpixelsperinch (void) { - octave::display_info& dpy_info - = octave::__get_display_info__ ("default_screenpixelsperinch"); + octave::display_info& dpy_info = octave::__get_display_info__ (); return (dpy_info.x_dpi () + dpy_info.y_dpi ()) / 2; } @@ -538,8 +535,7 @@ static std::string default_graphics_toolkit (void) { - octave::gtk_manager& gtk_mgr - = octave::__get_gtk_manager__ ("default_graphics_toolkit"); + octave::gtk_manager& gtk_mgr = octave::__get_gtk_manager__ (); return gtk_mgr.default_toolkit (); } @@ -626,7 +622,7 @@ bool call_createfcn = true, bool notify_toolkit = true) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("make_graphics_handle"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); return gh_mgr.make_graphics_handle (go_name, parent, integer_figure_handle, call_createfcn, notify_toolkit); @@ -838,7 +834,7 @@ const caseless_str& from_units, const caseless_str& to_units) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("convert_text_position"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (props.get___myhandle__ ()); @@ -928,7 +924,7 @@ static Matrix screen_size_pixels (void) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("scren_size_pixels"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object obj = gh_mgr.get_object (0); @@ -943,7 +939,7 @@ { double retval = 1.0; - gh_manager& gh_mgr = octave::__get_gh_manager__ ("device_pixel_ratio"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object fig = gh_mgr.get_object (h).get_ancestor ("figure"); @@ -1008,7 +1004,7 @@ Matrix cmap (1, 3, 0.0); Matrix clim (1, 2, 0.0); - gh_manager& gh_mgr = octave::__get_gh_manager__ ("convert_cdata"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (props.get___myhandle__ ()); graphics_object ax = go.get_ancestor ("axes"); @@ -1264,8 +1260,7 @@ // Notify graphics toolkit. if (m_id >= 0 && do_notify_toolkit) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_property::set"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (m_parent); if (go) @@ -1287,8 +1282,7 @@ { const octave_value_list& l = m_listeners[mode]; - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_property::run_listeners"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); for (int i = 0; i < l.length (); i++) gh_mgr.execute_listener (m_parent, l(i)); @@ -1789,7 +1783,7 @@ double dv = v.xdouble_value (R"(set: invalid graphics handle for property "%s")", get_name ().c_str ()); - gh_manager& gh_mgr = octave::__get_gh_manager__ ("handle_property::do_set"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_handle gh = gh_mgr.lookup (dv); @@ -1851,8 +1845,7 @@ Matrix retval (m_children_list.size (), 1); octave_idx_type k = 0; - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("children_property::do_get_children"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (0); @@ -1888,8 +1881,7 @@ void children_property::do_delete_children (bool clear, bool from_root) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("children_property::do_delete_children"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); if (from_root) { @@ -1996,8 +1988,7 @@ if (m_callback.is_defined () && ! m_callback.isempty ()) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("callback_property::execute"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); gh_mgr.execute_callback (get_parent (), m_callback, data); } @@ -2135,7 +2126,7 @@ static void finalize_r (const graphics_handle& h) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("finalize_r"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (h); @@ -2153,7 +2144,7 @@ static void initialize_r (const graphics_handle& h) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("initialize_r"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (h); @@ -2247,8 +2238,7 @@ { if (! is_handle_visible ()) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("figure::properties::update_handlevisibility"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); octave_value cf = gh_mgr.get_object (0).get ("currentfigure"); @@ -2274,7 +2264,7 @@ static void update_text_pos (graphics_handle h) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("update_text_pos"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (h); @@ -2879,7 +2869,7 @@ static bool isfigure (double val) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("isfigure"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (val); @@ -2982,7 +2972,7 @@ xset (const graphics_handle& h, const caseless_str& pname, const octave_value& val) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("xset"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (h); @@ -2994,7 +2984,7 @@ { if (args.length () > 0) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("xset"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (h); @@ -3005,7 +2995,7 @@ static octave_value xget (const graphics_handle& h, const caseless_str& pname) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("xget"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (h); @@ -3020,7 +3010,7 @@ double hv = ov.xdouble_value ("%s: %s must be a graphics handle", who.c_str (), pname.c_str ()); - gh_manager& gh_mgr = octave::__get_gh_manager__ ("reparent"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_handle h = gh_mgr.lookup (hv); @@ -3069,8 +3059,7 @@ { if (h.ok ()) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("delete_graphics_object"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (h); @@ -3090,7 +3079,7 @@ static void delete_graphics_object (double val, bool from_root = false) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("delete_graphics_object"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); delete_graphics_object (gh_mgr.lookup (val), from_root || isfigure (val)); } @@ -3113,7 +3102,7 @@ { octave_value closerequestfcn = xget (h, "closerequestfcn"); - gh_manager& gh_mgr = octave::__get_gh_manager__ ("close_figure"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); gh_mgr.execute_callback (h, closerequestfcn); } @@ -3177,7 +3166,7 @@ static void adopt (const graphics_handle& parent_h, const graphics_handle& h) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("adopt"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (parent_h); @@ -3193,7 +3182,7 @@ static bool ishghandle (double val) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("ishghandle"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_handle h = gh_mgr.lookup (val); @@ -3225,7 +3214,7 @@ static void xcreatefcn (const graphics_handle& h) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("xcreatefcn"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (h); @@ -3235,7 +3224,7 @@ static void xinitialize (const graphics_handle& h) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("xinitialize"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (h); @@ -3267,8 +3256,7 @@ xreset_default_properties (graphics_handle h, property_list::pval_map_type factory_pval) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("xreset_default_properties"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (h); @@ -3431,8 +3419,7 @@ if (hp == m___myhandle__) error ("set: can not set object parent to be object itself"); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_properties::set_parent"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_handle new_parent = gh_mgr.lookup (hp); if (! new_parent.ok ()) @@ -3481,8 +3468,7 @@ // Attempt to mark parent object as modified if it exists - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_properties::mark_modified"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (get_parent ()); @@ -3493,8 +3479,7 @@ void base_properties::override_defaults (base_graphics_object& obj) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_properties::override_defaults"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (get_parent ()); @@ -3505,8 +3490,7 @@ void base_properties::update_axis_limits (const std::string& axis_type) const { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_properties::update_axis_limits"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (m___myhandle__); @@ -3518,8 +3502,7 @@ base_properties::update_axis_limits (const std::string& axis_type, const graphics_handle& h) const { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_properties::update_axis_limits"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (m___myhandle__); @@ -3533,8 +3516,7 @@ if (m_contextmenu.get ().isempty ()) return; - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_properties::update_contextmenu"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (m_contextmenu.get ()); @@ -3556,8 +3538,7 @@ octave::graphics_toolkit base_properties::get_toolkit (void) const { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_properties::get_toolkit"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get_parent ()); @@ -3572,8 +3553,7 @@ { Matrix kids = get_children (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_properties::update_boundingbox"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); for (int i = 0; i < kids.numel (); i++) { @@ -3587,8 +3567,7 @@ void base_properties::update_autopos (const std::string& elem_type) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_properties::update_autopos"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (get_parent ()); @@ -3604,8 +3583,7 @@ // This object should not be the figure "currentobject" - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_properties::update_handlevisibility"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go (gh_mgr.get_object (get___myhandle__ ())); @@ -3690,8 +3668,7 @@ bool traverse, std::list<graphics_object>& children_list) const { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_properties::get_children_of_type"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); Matrix ch = get_children (); @@ -3724,8 +3701,7 @@ if (! valid_object ()) error ("base_graphics_object::update_axis_limits: invalid graphics object"); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_graphics_object::update_axis_limits"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (get_parent ()); @@ -3740,8 +3716,7 @@ if (! valid_object ()) error ("base_graphics_object::update_axis_limits: invalid graphics object"); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_graphics_object::update_axis_limits"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (get_parent ()); @@ -3775,8 +3750,7 @@ } catch (const octave::execution_exception&) { - octave::interpreter& interp - = octave::__get_interpreter__ ("remove_all_listeners"); + octave::interpreter& interp = octave::__get_interpreter__ (); interp.recover_from_exception (); } @@ -3801,8 +3775,7 @@ } } - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_graphics_object::build_user_defaults_map"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (get_parent ()); @@ -3815,8 +3788,7 @@ { if (valid_object ()) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_graphics_object::reset_default_properties"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); property_list::pval_map_type factory_pval = gh_mgr.get_object (0).get_factory_defaults_list ().find (type ())->second; @@ -3835,8 +3807,7 @@ std::string retval; octave_map m = get ().map_value (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_graphics_object::values_as_string"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get_handle ()); @@ -3870,8 +3841,7 @@ if (! valid_object ()) error ("base_graphics_object::value_as_string: invalid graphics object"); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_graphics_object::value_as_string"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get_handle ()); @@ -3902,8 +3872,7 @@ octave_scalar_map m = get ().scalar_map_value (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_graphics_object::values_as_struct"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get_handle ()); @@ -3956,8 +3925,7 @@ return *this; else { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("graphics_object::get_ancestor"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); return gh_mgr.get_object (get_parent ()).get_ancestor (obj_type); } @@ -3996,8 +3964,7 @@ if (val.ok ()) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("root_figure::properties::set_currentfigure"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); gh_mgr.push_figure (val); } @@ -4013,8 +3980,7 @@ { bool int_fig_handle = m_integerhandle.is_on (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("figure::properties::set_integerhandle"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object this_go = gh_mgr.get_object (m___myhandle__); @@ -4146,8 +4112,7 @@ void root_figure::properties::remove_child (const graphics_handle& h, bool) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("root_figure::properties::remove_child"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); gh_mgr.pop_figure (h); @@ -4193,8 +4158,7 @@ Matrix kids = get_children (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("root_figure::properties::remove_child"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); for (octave_idx_type i = 0; i < kids.numel (); i++) { @@ -4236,8 +4200,7 @@ std::string nm = val.string_value (); - octave::gtk_manager& gtk_mgr - = octave::__get_gtk_manager__ ("figure::properties::set___graphics_toolkit__"); + octave::gtk_manager& gtk_mgr = octave::__get_gtk_manager__ (); octave::graphics_toolkit b = gtk_mgr.find_toolkit (nm); @@ -4258,8 +4221,7 @@ if (! get_currentaxes ().ok ()) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("figure::properties::adopt"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (h); @@ -4389,8 +4351,7 @@ { if (old_bb(2) != new_bb(2) || old_bb(3) != new_bb(3)) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("figure::properties::set_position"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); if (! get_resizefcn ().isempty ()) gh_mgr.post_callback (m___myhandle__, "resizefcn"); @@ -5083,7 +5044,7 @@ { graphics_handle parent_h = get_parent (); - gh_manager& gh_mgr = octave::__get_gh_manager__ ("figure::get_default"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (parent_h); @@ -5276,8 +5237,7 @@ { Matrix pos = init_pos; - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("axes::properties::calc_tightbox"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get_parent ()); @@ -5415,8 +5375,7 @@ graphics_handle val; - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("axes::properties::set_text_child"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (gh_mgr.lookup (v)); @@ -5644,8 +5603,7 @@ m_visible = "on"; - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("axes::properties::set_defaults"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (m_xlabel.handle_value ()); go.reset_default_properties (); @@ -5711,8 +5669,7 @@ { if (m___colormap__.get ().isempty ()) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("axes::properties::get_colormap"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go (gh_mgr.get_object (get___myhandle__ ())); graphics_object go_f (go.get_ancestor ("figure")); @@ -5729,8 +5686,7 @@ { graphics_handle h = hp.handle_value (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("axes::properties::delete_text_child"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); if (h.ok ()) { @@ -5758,8 +5714,7 @@ void axes::properties::remove_child (const graphics_handle& h, bool from_root) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("axes::properties::remove_child"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (h); @@ -5795,7 +5750,7 @@ void axes::properties::adopt (const graphics_handle& h) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("axes::properties::adopt"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go (gh_mgr.get_object (h)); @@ -6465,8 +6420,7 @@ if (updating_xlabel_position) return; - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("axes::properties::update_xlabel_position"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get_xlabel ()); @@ -6570,8 +6524,7 @@ if (updating_ylabel_position) return; - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("axes::properties::update_ylabel_position"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get_ylabel ()); @@ -6675,8 +6628,7 @@ if (updating_zlabel_position) return; - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("axes::properties::update_zlabel_position"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get_zlabel ()); @@ -6802,8 +6754,7 @@ if (updating_title_position) return; - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("axes::properties::update_title_position"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get_title ()); @@ -7014,8 +6965,7 @@ axes::properties::update_label_color (handle_property label, color_property col) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("axes::properties::update_label_color"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); gh_mgr.get_object (label.handle_value ()).set ("color", col.get ()); } @@ -7023,8 +6973,7 @@ void axes::properties::update_font (std::string prop) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("axes::properties::update_font"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); if (! prop.empty ()) { @@ -7068,8 +7017,7 @@ if (parent_size.isempty ()) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("axes::properties::get_boundingbox"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get_parent ()); @@ -7124,8 +7072,7 @@ else if (i == 3) htext = get_zlabel (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("axes::properties::get_extent"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); text::properties& text_props = reinterpret_cast<text::properties&> @@ -7343,8 +7290,7 @@ void axes::properties::update_units (const caseless_str& old_units) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("axes::properties::update_units"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (get_parent ()); @@ -7456,8 +7402,7 @@ { graphics_handle parent_h = get_parent (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("axes::properties::get_default"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (parent_h); @@ -8410,8 +8355,7 @@ if (m_txt_renderer.ok ()) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("axes::properties::get_ticklabel_extents"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); octave::autolock guard (gh_mgr.graphics_lock ()); @@ -8445,7 +8389,7 @@ { octave_idx_type n = kids.numel (); - gh_manager& gh_mgr = octave::__get_gh_manager__ ("get_children_limits"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); switch (limit_type) { @@ -9330,8 +9274,7 @@ { if (! is_handle_visible ()) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("axes::properties::update_handlevisibility"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go (gh_mgr.get_object (get___myhandle__ ())); @@ -9358,8 +9301,7 @@ void figure::properties::init_toolkit (void) { - octave::gtk_manager& gtk_mgr - = octave::__get_gtk_manager__ ("figure::properties::init_toolkit"); + octave::gtk_manager& gtk_mgr = octave::__get_gtk_manager__ (); m_toolkit = gtk_mgr.get_toolkit (); } @@ -9562,8 +9504,7 @@ if (new_units == "normalized" || old_units == "normalized") { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("text::properties::update_fontunits"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go (gh_mgr.get_object (get___myhandle__ ())); @@ -9582,8 +9523,7 @@ { double dpr = device_pixel_ratio (get___myhandle__ ()); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("text::properties::update_font"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); octave::autolock guard (gh_mgr.graphics_lock ()); @@ -9628,8 +9568,7 @@ string_vector sv = string_prop.string_vector_value (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("text::properties::update_text_extent"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); octave::autolock guard (gh_mgr.graphics_lock ()); @@ -9695,8 +9634,7 @@ double fontsz = get_fontsize (); double parent_height = box_pix_height; - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("text::properties::get___fontsize_points__"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go (gh_mgr.get_object (get___myhandle__ ())); @@ -9734,8 +9672,7 @@ void light::properties::update_visible (void) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("light::properties::update_visible"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get___myhandle__ ()); @@ -9752,8 +9689,7 @@ bool patch::properties::get_do_lighting (void) const { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("patch::properties::get_do_lighting"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get___myhandle__ ()); @@ -10410,8 +10346,7 @@ if (series_idx.isempty ()) return; - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("scatter::properties::update_color"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get___myhandle__ ()); @@ -10473,8 +10408,7 @@ bool surface::properties::get_do_lighting (void) const { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("surface::properties::get_do_lighting"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get___myhandle__ ()); @@ -10766,8 +10700,7 @@ void hggroup::properties::remove_child (const graphics_handle& h, bool from_root) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("hggroup::properties::remove_child"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (h); @@ -10784,8 +10717,7 @@ void hggroup::properties::adopt (const graphics_handle& h) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("hggroup::properties::adopt"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (h); @@ -10802,8 +10734,7 @@ void hggroup::properties::update_limits (void) const { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("hggroup::properties::update_limits"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (m___myhandle__); @@ -10820,8 +10751,7 @@ void hggroup::properties::update_limits (const graphics_handle& h) const { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("hggroup::properties::update_limits"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (m___myhandle__); @@ -11041,8 +10971,7 @@ // Clear the uicontextmenu property of dependent objects if (m_beingdeleted.is ("on")) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("uicontextmenu::properties::update_beingdeleted"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); std::list<graphics_handle> lst = get_dependent_obj_list (); @@ -11091,8 +11020,7 @@ { Matrix m = m_extent.get ().matrix_value (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("uicontrol::properties::get_extent"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (get_parent ()); @@ -11107,8 +11035,7 @@ { // FIXME: support multiline text - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("uicontrol::properties::update_text_extent"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get___myhandle__ ()); @@ -11120,8 +11047,7 @@ { Matrix pos = get_position ().matrix_value (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("uicontrol::properties::update_units"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (get_parent ()); @@ -11137,8 +11063,7 @@ void uicontrol::properties::set_style (const octave_value& st) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("uicontrol::properties::set_style"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go_parent = gh_mgr.get_object (get_parent ()); if (go_parent.valid_object () && go_parent.isa ("uibuttongroup")) @@ -11191,8 +11116,7 @@ if (parent_size.isempty ()) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("uicontrol::properties::get_boundingbox"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get_parent ()); @@ -11258,8 +11182,7 @@ if (parent_size.isempty ()) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("uibuttongroup::properties::get_boundingbox"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get_parent ()); @@ -11334,8 +11257,7 @@ { if (old_bb(2) != new_bb(2) || old_bb(3) != new_bb(3)) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("uibuttongroup::properties::set_position"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); if (! get_resizefcn ().isempty ()) gh_mgr.post_callback (m___myhandle__, "resizefcn"); @@ -11371,8 +11293,7 @@ { Matrix pos = get_position ().matrix_value (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("uibuttongroup::properties::update_units"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (get_parent ()); @@ -11437,8 +11358,7 @@ graphics_handle val (v); if (val.ok ()) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("uibuttongroup::properties::set_selectedobject"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go (gh_mgr.get_object (val)); @@ -11481,8 +11401,7 @@ graphics_handle current_selected = get_selectedobject (); bool has_selected = current_selected.ok (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("uibuttongroup::properties::adopt"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (h); @@ -11506,8 +11425,7 @@ if (parent_size.isempty ()) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("uipanel::properties::get_boundingbox"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get_parent ()); @@ -11582,8 +11500,7 @@ { if (old_bb(2) != new_bb(2) || old_bb(3) != new_bb(3)) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("uipanel::properties::set_position"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); if (! get_resizefcn ().isempty ()) gh_mgr.post_callback (m___myhandle__, "resizefcn"); @@ -11620,8 +11537,7 @@ { Matrix pos = get_position ().matrix_value (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("uipanel::properties::update_units"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (get_parent ()); @@ -11679,8 +11595,7 @@ if (parent_size.isempty ()) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("uitable::properties::get_boundingbox"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (get_parent ()); @@ -11806,8 +11721,7 @@ { Matrix pos = get_position ().matrix_value (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("uitable::properties::update_units"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (get_parent ()); @@ -11896,8 +11810,7 @@ // FIXME: Is it really acceptable to just let the toolkit update the extent? Matrix m = m_extent.get ().matrix_value (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("uitable::properties::get_extent"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (get_parent ()); @@ -11923,8 +11836,7 @@ { graphics_handle parent_h = get_parent (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("uitoolbar::get_default"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (parent_h); @@ -11951,8 +11863,7 @@ { graphics_handle parent_h = get_parent (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_graphics_object::get_default"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (parent_h); @@ -11962,8 +11873,7 @@ octave_value base_graphics_object::get_factory_default (const caseless_str& name) const { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("base_graphics_object::get_factory_default"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object parent_go = gh_mgr.get_object (0); @@ -11980,7 +11890,7 @@ { m_handle_map[0] = graphics_object (new root_figure ()); - octave::gtk_manager& gtk_mgr = octave::__get_gtk_manager__ ("gh_manager"); + octave::gtk_manager& gtk_mgr = octave::__get_gtk_manager__ (); // Make sure the default graphics toolkit is registered. gtk_mgr.default_toolkit (); @@ -12100,8 +12010,7 @@ void execute (void) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("callback_event::execute"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); if (m_callback.is_defined ()) gh_mgr.execute_callback (m_handle, m_callback, m_callback_data); @@ -12135,8 +12044,7 @@ { if (! m_mcode.empty ()) { - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("mcode_event::execute"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (m_handle); @@ -12203,7 +12111,7 @@ void execute (void) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("set_event::execute"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); octave::autolock guard (gh_mgr.graphics_lock ()); @@ -12311,7 +12219,7 @@ static void xset_gcbo (const graphics_handle& h) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("xset_gcbo"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (0); @@ -12450,7 +12358,7 @@ static int process_graphics_events (void) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("process_graphics_events"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); return gh_mgr.process_events (); } @@ -12747,7 +12655,7 @@ static bool is_handle_visible (const graphics_handle& h) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("is_handle_visible"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); return h.ok () && gh_mgr.is_handle_visible (h); } @@ -12755,7 +12663,7 @@ static bool is_handle_visible (double val) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("is_handle_visible"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); return is_handle_visible (gh_mgr.lookup (val)); } @@ -13108,7 +13016,7 @@ { std::string retval; - gh_manager& gh_mgr = octave::__get_gh_manager__ ("get_graphics_object_type"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_object go = gh_mgr.get_object (val); @@ -13326,7 +13234,7 @@ if (octave::math::isnan (val)) val = args(0).xdouble_value ("__go_%s__: invalid parent", go_name.c_str ()); - gh_manager& gh_mgr = octave::__get_gh_manager__ ("make_graphics_object"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); graphics_handle parent = gh_mgr.lookup (val); @@ -13489,7 +13397,7 @@ { Matrix kids = go.get_properties ().get_children (); - gh_manager& gh_mgr = octave::__get_gh_manager__ ("calc_dimensions"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); for (octave_idx_type i = 0; i < kids.numel (); i++) { @@ -14320,7 +14228,7 @@ get_property_from_handle (double handle, const std::string& property, const std::string& fcn) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("get_property_from_handle"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); octave::autolock guard (gh_mgr.graphics_lock ()); @@ -14336,7 +14244,7 @@ set_property_in_handle (double handle, const std::string& property, const octave_value& arg, const std::string& fcn) { - gh_manager& gh_mgr = octave::__get_gh_manager__ ("set_property_in_handle"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); octave::autolock guard (gh_mgr.graphics_lock ()); @@ -14386,8 +14294,7 @@ caseless_str pname = c(3).string_value (); - gh_manager& gh_mgr - = octave::__get_gh_manager__ ("do_cleanup_waitfor_listener"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); octave::autolock guard (gh_mgr.graphics_lock ()); @@ -14429,7 +14336,7 @@ caseless_str pname = args(4).string_value (); - gh_manager& gh_mgr = octave::__get_gh_manager__ ("waitfor_listener"); + gh_manager& gh_mgr = octave::__get_gh_manager__ (); octave::autolock guard (gh_mgr.graphics_lock ());