diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/applicationwindow.cpp | 97 |
1 files changed, 94 insertions, 3 deletions
diff --git a/src/applicationwindow.cpp b/src/applicationwindow.cpp index 1de245f..45e8129 100644 --- a/src/applicationwindow.cpp +++ b/src/applicationwindow.cpp @@ -6,15 +6,21 @@ #include "adwaitamm/applicationwindow.hpp" +#include "adwaitamm/breakpoint.hpp" +#include "adwaitamm/dialog.hpp" #include "adwaitamm/private/applicationwindow_p.hpp" #include <glibmm/object.h> #include <glibmm/objectbase.h> +#include <glibmm/propertyproxy.h> #include <glibmm/refptr.h> #include <glibmm/wrap.h> +#include <giomm/listmodel.h> + #include <gtkmm/application.h> #include <gtkmm/applicationwindow.h> +#include <gtkmm/widget.h> #include <glib-object.h> #include <gtk/gtk.h> @@ -24,8 +30,24 @@ 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<Gtk::Application> 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(); @@ -36,10 +58,79 @@ namespace Adwaita return adw_application_window_get_type(); } - ApplicationWindow::ApplicationWindow(Glib::RefPtr<Gtk::Application> const & app) - : Glib::ObjectBase{nullptr} - , Gtk::ApplicationWindow{GTK_APPLICATION_WINDOW(adw_application_window_new(unwrap(app)))} + auto ApplicationWindow::add_breakpoint(Glib::RefPtr<Breakpoint> 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<BaseObjectType *>(unwrap(this))); + } + + auto ApplicationWindow::get_content() const -> Gtk::Widget * + { + return Glib::wrap(adw_application_window_get_content(const_cast<BaseObjectType *>(unwrap(this)))); + } + + auto ApplicationWindow::get_current_breakpoint() const -> Glib::RefPtr<Breakpoint> + { + return Glib::wrap(adw_application_window_get_current_breakpoint(const_cast<BaseObjectType *>(unwrap(this)))); + } + + auto ApplicationWindow::get_dialogs() const -> Glib::RefPtr<Gio::ListModel> + { + return Glib::wrap(adw_application_window_get_dialogs(const_cast<BaseObjectType *>(unwrap(this)))); + } + + auto ApplicationWindow::get_visible_dialog() const -> Dialog * + { + return Glib::wrap(adw_application_window_get_visible_dialog(const_cast<BaseObjectType *>(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<bool> + { + return {this, property_name::adaptive_preview}; + } + + auto ApplicationWindow::property_adaptive_preview() const -> Glib::PropertyProxy_ReadOnly<bool> + { + return {this, property_name::adaptive_preview}; + } + + auto ApplicationWindow::property_content() -> Glib::PropertyProxy<Gtk::Widget *> + { + return {this, property_name::content}; + } + + auto ApplicationWindow::property_content() const -> Glib::PropertyProxy_ReadOnly<Gtk::Widget *> + { + return {this, property_name::content}; + } + + auto ApplicationWindow::property_current_breakpoint() const -> Glib::PropertyProxy_ReadOnly<Glib::RefPtr<Breakpoint>> + { + return {this, property_name::current_breakpoint}; + } + + auto ApplicationWindow::property_dialogs() const -> Glib::PropertyProxy_ReadOnly<Glib::RefPtr<Gio::ListModel>> + { + return {this, property_name::dialogs}; + } + + auto ApplicationWindow::property_visible_dialog() const -> Glib::PropertyProxy_ReadOnly<Dialog *> { + return {this, property_name::visible_dialog}; } ApplicationWindow::ApplicationWindow(Glib::ConstructParams const & params) |
