/** * @author Felix Morgner (felix.morgner@gmail.com) * @copyright Copyright (c) 2025 * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "adwaitamm/applicationwindow.hpp" #include "adwaitamm/breakpoint.hpp" #include "adwaitamm/dialog.hpp" #include "adwaitamm/private/applicationwindow_p.hpp" #include #include #include #include #include #include #include #include #include #include #include namespace Adwaita { namespace { auto constinit _class = ApplicationWindow_Class{}; namespace property_name { auto constexpr adaptive_preview = "adaptive-preview"; auto constexpr content = "content"; auto constexpr current_breakpoint = "current-breakpoint"; auto constexpr dialogs = "dialogs"; auto constexpr visible_dialog = "visible-dialog"; } // namespace property_name } // namespace ApplicationWindow::ApplicationWindow(Glib::RefPtr const & app) : Glib::ObjectBase{nullptr} , Gtk::ApplicationWindow{GTK_APPLICATION_WINDOW(adw_application_window_new(unwrap(app)))} { } auto ApplicationWindow::get_type() -> GType { return _class.init().get_type(); } auto ApplicationWindow::get_base_type() -> GType { return adw_application_window_get_type(); } auto ApplicationWindow::add_breakpoint(Glib::RefPtr const & breakpoint) -> void { return adw_application_window_add_breakpoint(unwrap(this), unwrap(breakpoint)); } auto ApplicationWindow::get_adaptive_preview() const -> bool { return adw_application_window_get_adaptive_preview(const_cast(unwrap(this))); } auto ApplicationWindow::get_content() const -> Gtk::Widget * { return Glib::wrap(adw_application_window_get_content(const_cast(unwrap(this)))); } auto ApplicationWindow::get_current_breakpoint() const -> Glib::RefPtr { return Glib::wrap(adw_application_window_get_current_breakpoint(const_cast(unwrap(this)))); } auto ApplicationWindow::get_dialogs() const -> Glib::RefPtr { return Glib::wrap(adw_application_window_get_dialogs(const_cast(unwrap(this)))); } auto ApplicationWindow::get_visible_dialog() const -> Dialog * { return Glib::wrap(adw_application_window_get_visible_dialog(const_cast(unwrap(this)))); } auto ApplicationWindow::set_adaptive_preview(bool value) -> void { return adw_application_window_set_adaptive_preview(unwrap(this), value); } auto ApplicationWindow::set_content(Gtk::Widget & value) -> void { return adw_application_window_set_content(unwrap(this), unwrap(&value)); } auto ApplicationWindow::property_adaptive_preview() -> Glib::PropertyProxy { return {this, property_name::adaptive_preview}; } auto ApplicationWindow::property_adaptive_preview() const -> Glib::PropertyProxy_ReadOnly { return {this, property_name::adaptive_preview}; } auto ApplicationWindow::property_content() -> Glib::PropertyProxy { return {this, property_name::content}; } auto ApplicationWindow::property_content() const -> Glib::PropertyProxy_ReadOnly { return {this, property_name::content}; } auto ApplicationWindow::property_current_breakpoint() const -> Glib::PropertyProxy_ReadOnly> { return {this, property_name::current_breakpoint}; } auto ApplicationWindow::property_dialogs() const -> Glib::PropertyProxy_ReadOnly> { return {this, property_name::dialogs}; } auto ApplicationWindow::property_visible_dialog() const -> Glib::PropertyProxy_ReadOnly { return {this, property_name::visible_dialog}; } ApplicationWindow::ApplicationWindow(Glib::ConstructParams const & params) : Gtk::ApplicationWindow{params} { } ApplicationWindow::ApplicationWindow(BaseObjectType * gobj) : Gtk::ApplicationWindow(GTK_APPLICATION_WINDOW(gobj)) { } } // namespace Adwaita namespace Glib { auto wrap(AdwApplicationWindow * object, bool copy) -> Adwaita::ApplicationWindow * { return dynamic_cast(Glib::wrap_auto(G_OBJECT(object), copy)); } } // namespace Glib