From b95258f419c62f7f38ec6128568df5897e4f5696 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Fri, 4 Apr 2025 22:15:41 +0200 Subject: adw: clean up property definitions --- adw/src/preferencesrow.cpp | 69 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 65 insertions(+), 4 deletions(-) (limited to 'adw/src/preferencesrow.cpp') diff --git a/adw/src/preferencesrow.cpp b/adw/src/preferencesrow.cpp index a586027..fe6410f 100644 --- a/adw/src/preferencesrow.cpp +++ b/adw/src/preferencesrow.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -55,12 +56,42 @@ namespace Adwaita return adw_preferences_row_get_type(); } + PreferencesRow::PreferencesRow(Glib::ConstructParams const & params) + : Gtk::ListBoxRow{params} + { + } + + PreferencesRow::PreferencesRow(BaseObjectType * gobj) + : Gtk::ListBoxRow(GTK_LIST_BOX_ROW(gobj)) + { + } + PreferencesRow::PreferencesRow() : Glib::ObjectBase{nullptr} , Gtk::ListBoxRow{Glib::ConstructParams{_class.init()}} { } + auto PreferencesRow::get_title() const -> Glib::ustring + { + return adw_preferences_row_get_title(const_cast(unwrap(this))); + } + + auto PreferencesRow::get_title_selectable() const noexcept -> bool + { + return adw_preferences_row_get_title_selectable(const_cast(unwrap(this))); + } + + auto PreferencesRow::get_use_markup() const noexcept -> bool + { + return adw_preferences_row_get_use_markup(const_cast(unwrap(this))); + } + + auto PreferencesRow::get_use_underline() const noexcept -> bool + { + return adw_preferences_row_get_use_underline(const_cast(unwrap(this))); + } + auto PreferencesRow::set_title(Glib::ustring const & title) -> CppObjectType & { adw_preferences_row_set_title(Glib::unwrap(this), title.c_str()); @@ -85,14 +116,44 @@ namespace Adwaita return *this; } - PreferencesRow::PreferencesRow(Glib::ConstructParams const & params) - : Gtk::ListBoxRow{params} + auto PreferencesRow::property_title() -> Glib::PropertyProxy { + return Glib::PropertyProxy{this, "title"}; } - PreferencesRow::PreferencesRow(BaseObjectType * gobj) - : Gtk::ListBoxRow(GTK_LIST_BOX_ROW(gobj)) + auto PreferencesRow::property_title() const -> Glib::PropertyProxy_ReadOnly + { + return Glib::PropertyProxy_ReadOnly{this, "title"}; + } + + auto PreferencesRow::property_title_selectable() -> Glib::PropertyProxy + { + return Glib::PropertyProxy{this, "title-selectable"}; + } + + auto PreferencesRow::property_title_selectable() const -> Glib::PropertyProxy_ReadOnly + { + return Glib::PropertyProxy_ReadOnly{this, "title-selectable"}; + } + + auto PreferencesRow::property_use_markup() -> Glib::PropertyProxy + { + return Glib::PropertyProxy{this, "use-markup"}; + } + + auto PreferencesRow::property_use_markup() const -> Glib::PropertyProxy_ReadOnly + { + return Glib::PropertyProxy_ReadOnly{this, "use-markup"}; + } + + auto PreferencesRow::property_use_underline() -> Glib::PropertyProxy + { + return Glib::PropertyProxy{this, "use-underline"}; + } + + auto PreferencesRow::property_use_underline() const -> Glib::PropertyProxy_ReadOnly { + return Glib::PropertyProxy_ReadOnly{this, "use-underline"}; } } // namespace Adwaita -- cgit v1.2.3