From a86aa317479afa799a420f3e459bf7e8bc03b907 Mon Sep 17 00:00:00 2001 From: Mads Kiilerich Date: Wed, 26 Jan 2022 21:21:06 +0100 Subject: [PATCH] gtkmm: use get_visible() instead of deprecated Gtk::Widget::is_visible() --- gtk2_ardour/ardour_message.cc | 2 +- gtk2_ardour/ardour_ui.cc | 2 +- gtk2_ardour/ardour_ui3.cc | 2 +- gtk2_ardour/ardour_ui_keys.cc | 2 +- gtk2_ardour/ardour_ui_video.cc | 2 +- gtk2_ardour/audio_clock.cc | 2 +- gtk2_ardour/editor.cc | 4 ++-- gtk2_ardour/editor_canvas.cc | 2 +- gtk2_ardour/luadialog.cc | 2 +- gtk2_ardour/mixer_ui.cc | 2 +- gtk2_ardour/monitor_section.cc | 2 +- gtk2_ardour/new_user_wizard.cc | 2 +- gtk2_ardour/patch_change_widget.cc | 2 +- gtk2_ardour/plugin_dspload_window.cc | 2 +- gtk2_ardour/plugin_eq_gui.cc | 2 +- gtk2_ardour/plugin_pin_dialog.cc | 2 +- gtk2_ardour/plugin_selector.cc | 2 +- gtk2_ardour/plugin_ui.cc | 2 +- gtk2_ardour/processor_box.cc | 8 ++++---- gtk2_ardour/recorder_ui.cc | 2 +- gtk2_ardour/route_ui.cc | 10 +++++----- gtk2_ardour/sfdb_ui.cc | 4 ++-- gtk2_ardour/shuttle_control.cc | 2 +- gtk2_ardour/splash.cc | 2 +- libs/gtkmm2ext/persistent_tooltip.cc | 2 +- libs/widgets/frame.cc | 2 +- libs/widgets/pane.cc | 16 ++++++++-------- libs/widgets/popup.cc | 2 +- libs/widgets/tabbable.cc | 2 +- 29 files changed, 45 insertions(+), 45 deletions(-) diff --git a/gtk2_ardour/ardour_message.cc b/gtk2_ardour/ardour_message.cc index 230307ec7c..527f44b435 100644 --- a/gtk2_ardour/ardour_message.cc +++ b/gtk2_ardour/ardour_message.cc @@ -90,7 +90,7 @@ ArdourMessageDialog::push_splash () { if (Splash::exists()) { Splash* spl = Splash::instance(); - if (spl->is_visible()) { + if (spl->get_visible()) { spl->pop_back_for (*this); _splash_pushed = true; } diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index d83f684ed1..b28cb02155 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -2789,7 +2789,7 @@ ARDOUR_UI::add_route () add_route_dialog->signal_response().connect (sigc::mem_fun (*this, &ARDOUR_UI::add_route_dialog_response)); } - if (add_route_dialog->is_visible()) { + if (add_route_dialog->get_visible()) { /* we're already doing this */ return; } diff --git a/gtk2_ardour/ardour_ui3.cc b/gtk2_ardour/ardour_ui3.cc index 6a76070939..7d592fd9fe 100644 --- a/gtk2_ardour/ardour_ui3.cc +++ b/gtk2_ardour/ardour_ui3.cc @@ -162,7 +162,7 @@ ARDOUR_UI::shared_popup_menu () { ENSURE_GUI_THREAD (*this, &ARDOUR_UI::shared_popup_menu, ignored); - assert (!_shared_popup_menu || !_shared_popup_menu->is_visible()); + assert (!_shared_popup_menu || !_shared_popup_menu->get_visible()); delete _shared_popup_menu; _shared_popup_menu = new Gtk::Menu; return _shared_popup_menu; diff --git a/gtk2_ardour/ardour_ui_keys.cc b/gtk2_ardour/ardour_ui_keys.cc index dbfdb6faf5..99f11db984 100644 --- a/gtk2_ardour/ardour_ui_keys.cc +++ b/gtk2_ardour/ardour_ui_keys.cc @@ -55,7 +55,7 @@ ARDOUR_UI::key_event_handler (GdkEventKey* ev, Gtk::Window* event_window) Gtkmm2ext::Bindings* bindings = 0; Gtk::Window* window = 0; - if (virtual_keyboard_window && virtual_keyboard_window->is_visible()) { + if (virtual_keyboard_window && virtual_keyboard_window->get_visible()) { if (gtk_window_propagate_key_event (virtual_keyboard_window->gobj(), ev)) { return true; } diff --git a/gtk2_ardour/ardour_ui_video.cc b/gtk2_ardour/ardour_ui_video.cc index 15eaf06021..39fbb26a5c 100644 --- a/gtk2_ardour/ardour_ui_video.cc +++ b/gtk2_ardour/ardour_ui_video.cc @@ -233,7 +233,7 @@ ARDOUR_UI::add_video (Gtk::Window* float_window) add_video_dialog->set_transient_for (*float_window); } - if (add_video_dialog->is_visible()) { + if (add_video_dialog->get_visible()) { /* we're already doing this */ return; } diff --git a/gtk2_ardour/audio_clock.cc b/gtk2_ardour/audio_clock.cc index 75d2f4f890..0ce7532f22 100644 --- a/gtk2_ardour/audio_clock.cc +++ b/gtk2_ardour/audio_clock.cc @@ -848,7 +848,7 @@ AudioClock::set (timepos_t const & w, bool force, timecnt_t const & offset) { timepos_t when (w); - if ((!force && !is_visible()) || !_session) { + if ((!force && !get_visible()) || !_session) { return; } diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 7c7b33e94d..e5633a00cc 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -1897,7 +1897,7 @@ Editor::add_region_context_items (Menu_Helpers::MenuList& edit_items, boost::sha const timepos_t position = get_preferred_edit_position (EDIT_IGNORE_NONE, true); edit_items.push_back (*_popup_region_menu_item); - if (Config->get_layer_model() == Manual && track->playlist()->count_regions_at (position) > 1 && (layering_order_editor == 0 || !layering_order_editor->is_visible ())) { + if (Config->get_layer_model() == Manual && track->playlist()->count_regions_at (position) > 1 && (layering_order_editor == 0 || !layering_order_editor->get_visible ())) { edit_items.push_back (*manage (_region_actions->get_action ("choose-top-region-context-menu")->create_menu_item ())); } edit_items.push_back (SeparatorElem()); @@ -6449,7 +6449,7 @@ Editor::change_region_layering_order (bool from_context_menu) void Editor::update_region_layering_order_editor () { - if (layering_order_editor && layering_order_editor->is_visible ()) { + if (layering_order_editor && layering_order_editor->get_visible ()) { change_region_layering_order (true); } } diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc index 5bf93ea641..4ad269bb11 100644 --- a/gtk2_ardour/editor_canvas.cc +++ b/gtk2_ardour/editor_canvas.cc @@ -334,7 +334,7 @@ Editor::reset_controls_layout_width () edit_controls_vbox.size_request (req); w = req.width; - if (_group_tabs->is_visible()) { + if (_group_tabs->get_visible()) { _group_tabs->size_request (req); w += req.width; } diff --git a/gtk2_ardour/luadialog.cc b/gtk2_ardour/luadialog.cc index e01806dd77..648578259f 100644 --- a/gtk2_ardour/luadialog.cc +++ b/gtk2_ardour/luadialog.cc @@ -52,7 +52,7 @@ Message::run () bool splash_pushed = false; Splash* spl = Splash::exists () ? Splash::instance() : NULL; - if (spl && spl->is_visible()) { + if (spl && spl->get_visible()) { spl->pop_back_for (_message_dialog); splash_pushed = true; } diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc index a746942d52..b861c9efa2 100644 --- a/gtk2_ardour/mixer_ui.cc +++ b/gtk2_ardour/mixer_ui.cc @@ -3824,7 +3824,7 @@ Mixer_UI::screenshot (std::string const& filename) } int height = strip_packer.get_height(); - bool with_vca = vca_vpacker.is_visible (); + bool with_vca = vca_vpacker.get_visible (); MixerStrip* master = strip_by_route (_session->master_out ()); Gtk::OffscreenWindow osw; diff --git a/gtk2_ardour/monitor_section.cc b/gtk2_ardour/monitor_section.cc index b8c703aaed..3c7a5f126e 100644 --- a/gtk2_ardour/monitor_section.cc +++ b/gtk2_ardour/monitor_section.cc @@ -579,7 +579,7 @@ MonitorSection::update_processor_box () toggle_processorbox_button.set_name (X_("monitor section processors toggle")); } - if (insert_box->is_visible() == show_processor_box) { + if (insert_box->get_visible() == show_processor_box) { return; } diff --git a/gtk2_ardour/new_user_wizard.cc b/gtk2_ardour/new_user_wizard.cc index 463d46f9c0..6b34b07b87 100644 --- a/gtk2_ardour/new_user_wizard.cc +++ b/gtk2_ardour/new_user_wizard.cc @@ -562,7 +562,7 @@ NewUserWizard::push_splash () { if (Splash::exists()) { Splash* spl = Splash::instance(); - if (spl->is_visible()) { + if (spl->get_visible()) { spl->pop_back_for (*this); _splash_pushed = true; } diff --git a/gtk2_ardour/patch_change_widget.cc b/gtk2_ardour/patch_change_widget.cc index 9f72cd29c9..59f66eb41f 100644 --- a/gtk2_ardour/patch_change_widget.cc +++ b/gtk2_ardour/patch_change_widget.cc @@ -484,7 +484,7 @@ PatchChangeWidget::~PatchChangeWidget () void PatchChangeWidget::refresh () { - if (is_visible ()) { + if (get_visible ()) { on_show (); } } diff --git a/gtk2_ardour/plugin_dspload_window.cc b/gtk2_ardour/plugin_dspload_window.cc index 90cf54b0dd..7dbdf7bde2 100644 --- a/gtk2_ardour/plugin_dspload_window.cc +++ b/gtk2_ardour/plugin_dspload_window.cc @@ -74,7 +74,7 @@ PluginDSPLoadWindow::set_session (Session* s) ArdourWindow::set_session (s); if (!s) { drop_references (); - } else if (is_visible ()) { + } else if (get_visible ()) { refill_processors (); } } diff --git a/gtk2_ardour/plugin_eq_gui.cc b/gtk2_ardour/plugin_eq_gui.cc index b8933ed173..b99611ab86 100644 --- a/gtk2_ardour/plugin_eq_gui.cc +++ b/gtk2_ardour/plugin_eq_gui.cc @@ -229,7 +229,7 @@ PluginEqGui::stop_updating () void PluginEqGui::start_updating () { - if (!_update_connection.connected() && is_visible()) { + if (!_update_connection.connected() && get_visible()) { _update_connection = Glib::signal_timeout().connect (sigc::mem_fun (this, &PluginEqGui::timeout_callback), 250, Glib::PRIORITY_DEFAULT_IDLE); } } diff --git a/gtk2_ardour/plugin_pin_dialog.cc b/gtk2_ardour/plugin_pin_dialog.cc index 4ad93f9ed9..f66cd62e11 100644 --- a/gtk2_ardour/plugin_pin_dialog.cc +++ b/gtk2_ardour/plugin_pin_dialog.cc @@ -1583,7 +1583,7 @@ PluginPinWidget::connect_sidechain () _sidechain_selector = new IOSelectorWindow (_session, _pi->sidechain_input ()); } - if (_sidechain_selector->is_visible ()) { + if (_sidechain_selector->get_visible ()) { _sidechain_selector->get_toplevel ()->get_window ()->raise (); } else { _sidechain_selector->present (); diff --git a/gtk2_ardour/plugin_selector.cc b/gtk2_ardour/plugin_selector.cc index dbc58dd0de..eff9fde961 100644 --- a/gtk2_ardour/plugin_selector.cc +++ b/gtk2_ardour/plugin_selector.cc @@ -916,7 +916,7 @@ PluginSelector::plugin_menu() void PluginSelector::build_plugin_menu () { - if (is_visible ()) { + if (get_visible ()) { _need_menu_rebuild = true; return; } diff --git a/gtk2_ardour/plugin_ui.cc b/gtk2_ardour/plugin_ui.cc index db2333f700..22204646f8 100644 --- a/gtk2_ardour/plugin_ui.cc +++ b/gtk2_ardour/plugin_ui.cc @@ -422,7 +422,7 @@ PluginUIWindow::app_activated (bool) was_visible = true; } } else { - was_visible = is_visible(); + was_visible = get_visible(); get_position (pre_deactivate_x, pre_deactivate_y); hide (); _pluginui->deactivate (); diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc index 31aeddde88..413390b1bf 100644 --- a/gtk2_ardour/processor_box.cc +++ b/gtk2_ardour/processor_box.cc @@ -736,7 +736,7 @@ ProcessorEntry::add_control_state (XMLNode* node) const if (_plugin_display) { XMLNode* c = new XMLNode (X_("Object")); c->set_property (X_("id"), X_("InlineDisplay")); - c->set_property (X_("visible"), _plugin_display->is_visible ()); + c->set_property (X_("visible"), _plugin_display->get_visible ()); node->add_child_nocopy (*c); } } @@ -793,7 +793,7 @@ ProcessorEntry::build_controls_menu () if (_plugin_display) { items.push_back (CheckMenuElem (_("Inline Display"))); Gtk::CheckMenuItem* c = dynamic_cast (&items.back ()); - c->set_active (_plugin_display->is_visible ()); + c->set_active (_plugin_display->get_visible ()); c->signal_toggled().connect (sigc::mem_fun (*this, &ProcessorEntry::toggle_inline_display_visibility)); } @@ -826,7 +826,7 @@ ProcessorEntry::build_controls_menu () void ProcessorEntry::toggle_inline_display_visibility () { - if (_plugin_display->is_visible ()) { + if (_plugin_display->get_visible ()) { _plugin_display->hide(); } else { _plugin_display->show(); @@ -1736,7 +1736,7 @@ ProcessorEntry::PluginInlineDisplay::update_height_alloc (uint32_t inline_height Gtk::ScrolledWindow* sw = dynamic_cast (pr); if (sw) { const Gtk::VScrollbar* vsb = sw->get_vscrollbar(); - sc = vsb && vsb->is_visible(); + sc = vsb && vsb->get_visible(); } if (shm != _cur_height) { diff --git a/gtk2_ardour/recorder_ui.cc b/gtk2_ardour/recorder_ui.cc index 50dcd3f3c5..4575658200 100644 --- a/gtk2_ardour/recorder_ui.cc +++ b/gtk2_ardour/recorder_ui.cc @@ -1081,7 +1081,7 @@ void RecorderUI::update_spacer_width (Allocation&, TrackRecordAxis* rec) { int w = rec->summary_xpos (); - if (_rec_group_tabs->is_visible ()) { + if (_rec_group_tabs->get_visible ()) { w += _rec_group_tabs->get_width (); } _space.set_size_request (w, -1); //< Note: this is idempotent diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc index 88c47e008c..857ba5519d 100644 --- a/gtk2_ardour/route_ui.cc +++ b/gtk2_ardour/route_ui.cc @@ -593,7 +593,7 @@ RouteUI::edit_output_configuration () IOSelectorWindow* w = output_selectors[id]; - if (w->is_visible()) { + if (w->get_visible()) { w->get_toplevel()->get_window()->raise(); } else { w->present (); @@ -611,7 +611,7 @@ RouteUI::edit_input_configuration () IOSelectorWindow* w = input_selectors[_route->id ()]; - if (w->is_visible()) { + if (w->get_visible()) { w->get_toplevel()->get_window()->raise(); } else { w->present (); @@ -635,8 +635,8 @@ RouteUI::solo_press(GdkEventButton* ev) if (Keyboard::is_context_menu_event (ev)) { - if (! (solo_isolated_led && solo_isolated_led->is_visible()) || - ! (solo_safe_led && solo_safe_led->is_visible())) { + if (! (solo_isolated_led && solo_isolated_led->get_visible()) || + ! (solo_safe_led && solo_safe_led->get_visible())) { if (solo_menu == 0) { build_solo_menu (); @@ -1751,7 +1751,7 @@ RouteUI::route_rename () void RouteUI::toggle_comment_editor () { - if (_comment_window && _comment_window->is_visible ()) { + if (_comment_window && _comment_window->get_visible ()) { _comment_window->hide (); } else { open_comment_editor (); diff --git a/gtk2_ardour/sfdb_ui.cc b/gtk2_ardour/sfdb_ui.cc index bce02f4b86..7c6dcec04f 100644 --- a/gtk2_ardour/sfdb_ui.cc +++ b/gtk2_ardour/sfdb_ui.cc @@ -2030,7 +2030,7 @@ SoundFileOmega::reset (uint32_t selected_audio_tracks, uint32_t selected_midi_tr chooser.set_filter (audio_and_midi_filter); } - if (is_visible()) { + if (get_visible()) { reset_options (); } } @@ -2038,7 +2038,7 @@ SoundFileOmega::reset (uint32_t selected_audio_tracks, uint32_t selected_midi_tr void SoundFileOmega::file_selection_changed () { - if (resetting_ourselves || !is_visible ()) { + if (resetting_ourselves || !get_visible ()) { return; } diff --git a/gtk2_ardour/shuttle_control.cc b/gtk2_ardour/shuttle_control.cc index 2a7277098b..52fa802cd5 100644 --- a/gtk2_ardour/shuttle_control.cc +++ b/gtk2_ardour/shuttle_control.cc @@ -209,7 +209,7 @@ ShuttleControl::~ShuttleControl () void ShuttleControl::varispeed_button_clicked () { - if (_session->default_play_speed () == 1.0 && !_vari_dialog.is_visible ()) { + if (_session->default_play_speed () == 1.0 && !_vari_dialog.get_visible ()) { _vari_dialog.present (); } else { _vari_dialog.hide (); diff --git a/gtk2_ardour/splash.cc b/gtk2_ardour/splash.cc index 16f005d09a..908d137360 100644 --- a/gtk2_ardour/splash.cc +++ b/gtk2_ardour/splash.cc @@ -269,7 +269,7 @@ Splash::expose (GdkEventExpose* ev) void Splash::boot_message (std::string msg) { - if (!is_visible() && _window_stack.empty ()) { + if (!get_visible() && _window_stack.empty ()) { display (); } message (msg); diff --git a/libs/gtkmm2ext/persistent_tooltip.cc b/libs/gtkmm2ext/persistent_tooltip.cc index 4334ff418e..6bc45c3a31 100644 --- a/libs/gtkmm2ext/persistent_tooltip.cc +++ b/libs/gtkmm2ext/persistent_tooltip.cc @@ -143,7 +143,7 @@ PersistentTooltip::show () set_tip (_tip); - if (!_window->is_visible ()) { + if (!_window->get_visible ()) { int rx, ry; int sw = gdk_screen_width (); diff --git a/libs/widgets/frame.cc b/libs/widgets/frame.cc index 466821fdd1..49295a9610 100644 --- a/libs/widgets/frame.cc +++ b/libs/widgets/frame.cc @@ -313,7 +313,7 @@ Frame::on_expose_event (GdkEventExpose* ev) cr->restore (); } - if (_w->is_visible ()) { + if (_w->get_visible ()) { propagate_expose (*_w, ev); } return true; diff --git a/libs/widgets/pane.cc b/libs/widgets/pane.cc index 7eabd0e8d1..ef170cb12b 100644 --- a/libs/widgets/pane.cc +++ b/libs/widgets/pane.cc @@ -103,7 +103,7 @@ Pane::on_size_request (GtkRequisition* req) for (Children::iterator c = children.begin(); c != children.end(); ++c) { GtkRequisition r; - if (!(*c)->w->is_visible ()) { + if (!(*c)->w->get_visible ()) { continue; } @@ -248,7 +248,7 @@ Pane::reallocate (Gtk::Allocation const & alloc) if (children.size() == 1) { /* only child gets the full allocation */ - if (children.front()->w->is_visible ()) { + if (children.front()->w->get_visible ()) { children.front()->w->size_allocate (alloc); } return; @@ -269,7 +269,7 @@ Pane::reallocate (Gtk::Allocation const & alloc) /* skip initial hidden children */ while (child != children.end()) { - if ((*child)->w->is_visible()) { + if ((*child)->w->get_visible()) { break; } ++child; @@ -284,7 +284,7 @@ Pane::reallocate (Gtk::Allocation const & alloc) /* Move on to next *visible* child */ while (++next != children.end()) { - if ((*next)->w->is_visible()) { + if ((*next)->w->get_visible()) { break; } } @@ -321,7 +321,7 @@ Pane::reallocate (Gtk::Allocation const & alloc) } else { child_alloc.set_height (max (child_alloc.get_height(), (*child)->minsize)); } - } else if (!check_fract && (*child)->w->is_visible ()) { + } else if (!check_fract && (*child)->w->get_visible ()) { if (horizontal) { child_alloc.set_width (max (child_alloc.get_width(), cr.width)); } else { @@ -329,7 +329,7 @@ Pane::reallocate (Gtk::Allocation const & alloc) } } - if ((*child)->w->is_visible ()) { + if ((*child)->w->get_visible ()) { (*child)->w->size_allocate (child_alloc); } @@ -380,12 +380,12 @@ Pane::on_expose_event (GdkEventExpose* ev) for (child = children.begin(), div = dividers.begin(); child != children.end(); ++child) { - if ((*child)->w->is_visible()) { + if ((*child)->w->get_visible()) { propagate_expose (*((*child)->w), ev); } if (div != dividers.end()) { - if ((*div)->is_visible()) { + if ((*div)->get_visible()) { propagate_expose (**div, ev); } ++div; diff --git a/libs/widgets/popup.cc b/libs/widgets/popup.cc index 84def111c2..55bdab9dae 100644 --- a/libs/widgets/popup.cc +++ b/libs/widgets/popup.cc @@ -99,7 +99,7 @@ PopUp::touch () { ENSURE_GUI_THREAD (mem_fun (*this, &PopUp::touch)); - if (is_visible ()) { + if (get_visible ()) { remove (); } else { Gtkmm2ext::set_size_request_to_display_given_text (label, my_text.c_str(), 25, 10); diff --git a/libs/widgets/tabbable.cc b/libs/widgets/tabbable.cc index 1005456ee5..6957ef2ad1 100644 --- a/libs/widgets/tabbable.cc +++ b/libs/widgets/tabbable.cc @@ -87,7 +87,7 @@ Tabbable::window_visible () const return false; } - return _window->is_visible(); + return _window->get_visible(); } Window*