From 91b08d5f45be567457b8843d91ebec0311fc9305 Mon Sep 17 00:00:00 2001 From: Mads Kiilerich Date: Wed, 26 Jan 2022 21:22:00 +0100 Subject: [PATCH] gtkmm: use get_realized() instead of deprecated Gtk::Widget::is_realized() --- gtk2_ardour/audio_clock.cc | 6 +++--- gtk2_ardour/input_port_monitor.cc | 6 +++--- gtk2_ardour/mini_timeline.cc | 2 +- libs/canvas/canvas.cc | 2 +- libs/gtkmm2ext/cairo_widget.cc | 2 +- libs/widgets/ardour_button.cc | 14 +++++++------- libs/widgets/ardour_fader.cc | 2 +- libs/widgets/frame.cc | 2 +- libs/widgets/tearoff.cc | 2 +- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/gtk2_ardour/audio_clock.cc b/gtk2_ardour/audio_clock.cc index 0ce7532f22..a80ab62a1c 100644 --- a/gtk2_ardour/audio_clock.cc +++ b/gtk2_ardour/audio_clock.cc @@ -157,7 +157,7 @@ AudioClock::set_widget_name (const string& str) set_name (str + " clock"); } - if (is_realized()) { + if (get_realized()) { set_colors (); } } @@ -347,7 +347,7 @@ AudioClock::set_clock_dimensions (Gtk::Requisition& req) tmp = Pango::Layout::create (get_pango_context()); - if (!is_realized()) { + if (!get_realized()) { font = get_font_for_style (get_name()); } else { font = style->get_font(); @@ -2302,7 +2302,7 @@ AudioClock::on_style_changed (const Glib::RefPtr& old_style) if (_layout && (_layout->get_font_description ().gobj () == 0 || _layout->get_font_description () != new_style->get_font ())) { _layout->set_font_description (new_style->get_font ()); queue_resize (); - } else if (is_realized ()) { + } else if (get_realized ()) { queue_resize (); } diff --git a/gtk2_ardour/input_port_monitor.cc b/gtk2_ardour/input_port_monitor.cc index 6fa7c1522e..210488722b 100644 --- a/gtk2_ardour/input_port_monitor.cc +++ b/gtk2_ardour/input_port_monitor.cc @@ -247,7 +247,7 @@ InputPortMonitor::InputScope::InputScope (samplecnt_t rate, int l, int g, Orient void InputPortMonitor::InputScope::dpi_reset () { - if (is_realized ()) { + if (get_realized ()) { queue_resize (); } } @@ -453,7 +453,7 @@ InputPortMonitor::EventMeter::dpi_reset () _layout->get_pixel_size (_length, _extent); _extent += 2; _length += 2; - if (is_realized ()) { + if (get_realized ()) { queue_resize (); } } @@ -562,7 +562,7 @@ InputPortMonitor::EventMonitor::dpi_reset () _layout->get_pixel_size (_width, _height); _width += 2; _height += 2; - if (is_realized ()) { + if (get_realized ()) { queue_resize (); } } diff --git a/gtk2_ardour/mini_timeline.cc b/gtk2_ardour/mini_timeline.cc index 253261478c..3453ebd4c2 100644 --- a/gtk2_ardour/mini_timeline.cc +++ b/gtk2_ardour/mini_timeline.cc @@ -140,7 +140,7 @@ MiniTimeline::dpi_changed () { calculate_time_width (); - if (is_realized()) { + if (get_realized()) { queue_resize (); } } diff --git a/libs/canvas/canvas.cc b/libs/canvas/canvas.cc index 71972a6616..e7265d2070 100644 --- a/libs/canvas/canvas.cc +++ b/libs/canvas/canvas.cc @@ -541,7 +541,7 @@ void GtkCanvas::use_nsglview () { assert (!_nsglview); - assert (!is_realized()); + assert (!get_realized()); #ifdef ARDOUR_CANVAS_NSVIEW_TAG // patched gdkquartz.h _nsglview = Gtkmm2ext::nsglview_create (this); #endif diff --git a/libs/gtkmm2ext/cairo_widget.cc b/libs/gtkmm2ext/cairo_widget.cc index b7e8c09d66..12a27a1ed3 100644 --- a/libs/gtkmm2ext/cairo_widget.cc +++ b/libs/gtkmm2ext/cairo_widget.cc @@ -88,7 +88,7 @@ CairoWidget::use_nsglview () { assert (!_nsglview); assert (!_canvas_widget); - assert (!is_realized()); + assert (!get_realized()); #ifdef ARDOUR_CANVAS_NSVIEW_TAG // patched gdkquartz.h _nsglview = Gtkmm2ext::nsglview_create (this); #endif diff --git a/libs/widgets/ardour_button.cc b/libs/widgets/ardour_button.cc index 47b4a8fb0c..d8b8eb4b4b 100644 --- a/libs/widgets/ardour_button.cc +++ b/libs/widgets/ardour_button.cc @@ -206,7 +206,7 @@ ArdourButton::set_text (const std::string& str, bool markup) _text = str; _markup = markup; - if (!is_realized()) { + if (!get_realized()) { return; } ensure_layout (); @@ -1098,7 +1098,7 @@ ArdourButton::on_style_changed (const RefPtr& style) if (!_custom_font_set && _layout && _layout->get_font_description () != new_style->get_font ()) { _layout->set_font_description (new_style->get_font ()); queue_resize (); - } else if (is_realized()) { + } else if (get_realized()) { queue_resize (); } } @@ -1110,7 +1110,7 @@ ArdourButton::on_name_changed () _char_pixel_height = 0; _diameter = 0; _update_colors = true; - if (is_realized()) { + if (get_realized()) { queue_resize (); } } @@ -1149,7 +1149,7 @@ ArdourButton::set_image (const RefPtr& img) { _elements = (ArdourButton::Element) (_elements & ~ArdourButton::Text); _pixbuf = img; - if (is_realized()) { + if (get_realized()) { queue_resize (); } } @@ -1274,7 +1274,7 @@ ArdourButton::set_tweaks (Tweaks t) { if (_tweaks != t) { _tweaks = t; - if (is_realized()) { + if (get_realized()) { queue_resize (); } } @@ -1303,7 +1303,7 @@ ArdourButton::set_layout_ellipsize_width (int w) if (_layout_ellipsize_width > 3 * PANGO_SCALE) { _layout->set_width (_layout_ellipsize_width - 3 * PANGO_SCALE); } - if (is_realized ()) { + if (get_realized ()) { queue_resize (); } } @@ -1322,7 +1322,7 @@ ArdourButton::set_text_ellipsize (Pango::EllipsizeMode e) if (_layout_ellipsize_width > 3 * PANGO_SCALE) { _layout->set_width (_layout_ellipsize_width - 3 * PANGO_SCALE); } - if (is_realized ()) { + if (get_realized ()) { queue_resize (); } } diff --git a/libs/widgets/ardour_fader.cc b/libs/widgets/ardour_fader.cc index 8543d65536..b414e27883 100644 --- a/libs/widgets/ardour_fader.cc +++ b/libs/widgets/ardour_fader.cc @@ -385,7 +385,7 @@ ArdourFader::on_size_allocate (Gtk::Allocation& alloc) _span = alloc.get_width (); } - if (is_realized() && ((old_girth != _girth) || (old_span != _span))) { + if (get_realized() && ((old_girth != _girth) || (old_span != _span))) { /* recreate patterns in case we've changed size */ create_patterns (); } diff --git a/libs/widgets/frame.cc b/libs/widgets/frame.cc index 49295a9610..7cd8ad8a4b 100644 --- a/libs/widgets/frame.cc +++ b/libs/widgets/frame.cc @@ -171,7 +171,7 @@ Frame::on_style_changed (const Glib::RefPtr& style) if (_layout && (_layout->get_font_description ().gobj () == 0 || _layout->get_font_description () != new_style->get_font ())) { _layout->set_font_description (new_style->get_font ()); queue_resize (); - } else if (is_realized ()) { + } else if (get_realized ()) { queue_resize (); } } diff --git a/libs/widgets/tearoff.cc b/libs/widgets/tearoff.cc index 751dba3b77..3aaf5f9b2d 100644 --- a/libs/widgets/tearoff.cc +++ b/libs/widgets/tearoff.cc @@ -307,7 +307,7 @@ TearOff::set_state (const XMLNode& node) node.get_property (X_("xpos"), own_window_xpos); node.get_property (X_("ypos"), own_window_ypos); - if (own_window.is_realized ()) { + if (own_window.get_realized ()) { own_window.set_default_size (own_window_width, own_window_height); own_window.move (own_window_xpos, own_window_ypos); }