diff options
Diffstat (limited to 'adw')
| -rw-r--r-- | adw/include/adwaitamm/actionrow.hpp | 28 | ||||
| -rw-r--r-- | adw/include/adwaitamm/breakpoint.hpp | 1 | ||||
| -rw-r--r-- | adw/include/adwaitamm/helpers/properties.hpp | 35 | ||||
| -rw-r--r-- | adw/include/adwaitamm/preferencesrow.hpp | 62 | ||||
| -rw-r--r-- | adw/include/adwaitamm/switchrow.hpp | 20 | ||||
| -rw-r--r-- | adw/include/adwaitamm/toast.hpp | 9 | ||||
| -rw-r--r-- | adw/include/adwaitamm/toastoverlay.hpp | 1 | ||||
| -rw-r--r-- | adw/src/actionrow.cpp | 98 | ||||
| -rw-r--r-- | adw/src/breakpoint.cpp | 8 | ||||
| -rw-r--r-- | adw/src/preferencesrow.cpp | 69 | ||||
| -rw-r--r-- | adw/src/switchrow.cpp | 21 | ||||
| -rw-r--r-- | adw/src/toast.cpp | 58 | ||||
| -rw-r--r-- | adw/src/toastoverlay.cpp | 5 |
13 files changed, 250 insertions, 165 deletions
diff --git a/adw/include/adwaitamm/actionrow.hpp b/adw/include/adwaitamm/actionrow.hpp index c7ff6c2..5b99ab7 100644 --- a/adw/include/adwaitamm/actionrow.hpp +++ b/adw/include/adwaitamm/actionrow.hpp @@ -1,8 +1,8 @@ #ifndef LIBADWAITAMM_ACTION_ROW_HPP #define LIBADWAITAMM_ACTION_ROW_HPP -#include "helpers/gobj_mixin.hpp" #include "adwaitamm/preferencesrow.hpp" +#include "helpers/gobj_mixin.hpp" #include <glibmm/class.h> #include <glibmm/object.h> @@ -55,9 +55,9 @@ namespace Adwaita auto static get_type() -> GType; auto static get_base_type() -> GType; - auto add_prefix(Gtk::Widget & widget) -> ActionRow &; - auto add_suffix(Gtk::Widget & widget) -> ActionRow &; - auto remove(Gtk::Widget & widget) -> ActionRow &; + auto add_prefix(Gtk::Widget & widget) -> void; + auto add_suffix(Gtk::Widget & widget) -> void; + auto remove(Gtk::Widget & widget) -> void; auto get_activatable_widget() const noexcept -> Glib::RefPtr<Gtk::Widget>; [[deprecated("replaced by add_prefix")]] auto get_icon_name() const -> Glib::ustring; @@ -66,19 +66,25 @@ namespace Adwaita auto get_subtitle_selectable() const noexcept -> bool; auto get_title_lines() const noexcept -> int; + auto set_activatable_widget(Gtk::Widget & widget) noexcept -> void; + [[deprecated("replaced by add_prefix")]] auto set_icon_name(Glib::ustring const & name) -> void; + auto set_subtitle(Glib::ustring const & subtitle) -> void; + auto set_subtitle_lines(int subtitle_lines) noexcept -> void; + auto set_subtitle_selectable(bool subtitle_selectable) noexcept -> void; + auto set_title_lines(int title_lines) noexcept -> void; + auto property_activatable_widget() noexcept -> Glib::PropertyProxy<Gtk::Widget *>; + auto property_activatable_widget() const noexcept -> Glib::PropertyProxy_ReadOnly<Gtk::Widget *>; [[deprecated("replaced by add_prefix")]] auto property_icon_name() noexcept -> Glib::PropertyProxy<Glib::ustring>; + [[deprecated("replaced by add_prefix")]] auto property_icon_name() const noexcept -> Glib::PropertyProxy_ReadOnly<Glib::ustring>; auto property_subtitle() noexcept -> Glib::PropertyProxy<Glib::ustring>; + auto property_subtitle() const noexcept -> Glib::PropertyProxy_ReadOnly<Glib::ustring>; auto property_subtitle_lines() noexcept -> Glib::PropertyProxy<int>; + auto property_subtitle_lines() const noexcept -> Glib::PropertyProxy_ReadOnly<int>; auto property_subtitle_selectable() noexcept -> Glib::PropertyProxy<bool>; + auto property_subtitle_selectable() const noexcept -> Glib::PropertyProxy_ReadOnly<bool>; auto property_title_lines() noexcept -> Glib::PropertyProxy<int>; - - auto set_activatable_widget(Gtk::Widget & widget) noexcept -> CppObjectType &; - [[deprecated("replaced by add_prefix")]] auto set_icon_name(Glib::ustring const & name) -> CppObjectType &; - auto set_subtitle(Glib::ustring const & subtitle) -> CppObjectType &; - auto set_subtitle_lines(int subtitle_lines) noexcept -> CppObjectType &; - auto set_subtitle_selectable(bool subtitle_selectable) noexcept -> CppObjectType &; - auto set_title_lines(int title_lines) noexcept -> CppObjectType &; + auto property_title_lines() const noexcept -> Glib::PropertyProxy_ReadOnly<int>; protected: explicit ActionRow(Glib::ConstructParams const & params); diff --git a/adw/include/adwaitamm/breakpoint.hpp b/adw/include/adwaitamm/breakpoint.hpp index 529344d..13e9f1e 100644 --- a/adw/include/adwaitamm/breakpoint.hpp +++ b/adw/include/adwaitamm/breakpoint.hpp @@ -84,6 +84,7 @@ namespace Adwaita auto static get_base_type() -> GType; auto property_condition() -> Glib::PropertyProxy<BreakpointCondition *>; + auto property_condition() const -> Glib::PropertyProxy_ReadOnly<BreakpointCondition *>; protected: explicit Breakpoint(BreakpointCondition & condition); diff --git a/adw/include/adwaitamm/helpers/properties.hpp b/adw/include/adwaitamm/helpers/properties.hpp deleted file mode 100644 index fad99d6..0000000 --- a/adw/include/adwaitamm/helpers/properties.hpp +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef LIBADWAITAMM_HELPERS_PROPERTIES_HPP -#define LIBADWAITAMM_HELPERS_PROPERTIES_HPP - -#include <glibmm/propertyproxy.h> -#include <glibmm/ustring.h> - -#include <type_traits> - -namespace Adwaita::helpers -{ - - template<typename ProxiedType, typename ObjectType> - struct deduced_property_proxy - { - using type = Glib::PropertyProxy<ProxiedType>; - }; - - template<typename ProxiedType, typename ObjectType> - struct deduced_property_proxy<ProxiedType, ObjectType const> - { - using type = Glib::PropertyProxy_ReadOnly<ProxiedType>; - }; - - template<typename ProxiedType, typename ObjectType> - using deduced_property_proxy_t = typename deduced_property_proxy<ProxiedType, ObjectType>::type; - - template<typename ProxiedType, typename ObjectType> - auto make_property_proxy(ObjectType && object, char const * property) - { - return deduced_property_proxy_t<ProxiedType, std::remove_reference_t<ObjectType>>{&object, property}; - } - -} // namespace Adwaita::helpers - -#endif
\ No newline at end of file diff --git a/adw/include/adwaitamm/preferencesrow.hpp b/adw/include/adwaitamm/preferencesrow.hpp index b4fde1e..6c1d6bb 100644 --- a/adw/include/adwaitamm/preferencesrow.hpp +++ b/adw/include/adwaitamm/preferencesrow.hpp @@ -2,11 +2,11 @@ #define LIBADWAITAMM_PREFERENCES_ROW_HPP #include "helpers/gobj_mixin.hpp" -#include "adwaitamm/helpers/properties.hpp" #include <glibmm/class.h> #include <glibmm/object.h> #include <glibmm/objectbase.h> +#include <glibmm/propertyproxy.h> #include <glibmm/refptr.h> #include <glibmm/ustring.h> @@ -53,66 +53,30 @@ namespace Adwaita auto static get_type() -> GType; auto static get_base_type() -> GType; - auto get_title(this auto && self); - auto get_title_selectable(this auto && self) noexcept; - auto get_use_markup(this auto && self) noexcept; - auto get_use_underline(this auto && self) noexcept; + auto get_title() const -> Glib::ustring; + auto get_title_selectable() const noexcept -> bool; + auto get_use_markup() const noexcept -> bool; + auto get_use_underline() const noexcept -> bool; auto set_title(Glib::ustring const & title) -> CppObjectType &; auto set_title_selectable(bool selectable) noexcept -> CppObjectType &; auto set_use_markup(bool use) noexcept -> CppObjectType &; auto set_use_underline(bool use) noexcept -> CppObjectType &; - auto property_title(this auto && self); - auto property_title_selectable(this auto && self); - auto property_use_markup(this auto && self); - auto property_use_underline(this auto && self); + auto property_title_selectable() -> Glib::PropertyProxy<bool>; + auto property_title_selectable() const -> Glib::PropertyProxy_ReadOnly<bool>; + auto property_title() -> Glib::PropertyProxy<Glib::ustring>; + auto property_title() const -> Glib::PropertyProxy_ReadOnly<Glib::ustring>; + auto property_use_markup() -> Glib::PropertyProxy<bool>; + auto property_use_markup() const -> Glib::PropertyProxy_ReadOnly<bool>; + auto property_use_underline() -> Glib::PropertyProxy<bool>; + auto property_use_underline() const -> Glib::PropertyProxy_ReadOnly<bool>; protected: explicit PreferencesRow(Glib::ConstructParams const & params); explicit PreferencesRow(BaseObjectType * gobj); }; - auto PreferencesRow::get_title(this auto && self) - { - return self.property_title().value(); - } - - auto PreferencesRow::get_title_selectable(this auto && self) noexcept - { - return self.property_title_selectable().value(); - } - - auto PreferencesRow::get_use_markup(this auto && self) noexcept - { - return self.property_use_markup().value(); - } - - auto PreferencesRow::get_use_underline(this auto && self) noexcept - { - return self.property_use_underline().value(); - } - - auto PreferencesRow::property_title(this auto && self) - { - return helpers::make_property_proxy<Glib::ustring>(self, "title"); - } - - auto PreferencesRow::property_title_selectable(this auto && self) - { - return helpers::make_property_proxy<bool>(self, "title-selectable"); - } - - auto PreferencesRow::property_use_markup(this auto && self) - { - return helpers::make_property_proxy<bool>(self, "use-markup"); - } - - auto PreferencesRow::property_use_underline(this auto && self) - { - return helpers::make_property_proxy<bool>(self, "use-underline"); - } - } // namespace Adwaita namespace Glib diff --git a/adw/include/adwaitamm/switchrow.hpp b/adw/include/adwaitamm/switchrow.hpp index 37e2e05..622b58a 100644 --- a/adw/include/adwaitamm/switchrow.hpp +++ b/adw/include/adwaitamm/switchrow.hpp @@ -3,11 +3,11 @@ #include "helpers/gobj_mixin.hpp" #include "adwaitamm/actionrow.hpp" -#include "adwaitamm/helpers/properties.hpp" #include <glibmm/class.h> #include <glibmm/object.h> #include <glibmm/objectbase.h> +#include <glibmm/propertyproxy.h> #include <glibmm/refptr.h> #include <glibmm/ustring.h> @@ -57,27 +57,17 @@ namespace Adwaita auto static get_type() -> GType; auto static get_base_type() -> GType; - auto get_active(this auto && self) noexcept; + auto get_active() const noexcept -> bool; + auto set_active(bool value) noexcept -> void; - auto get_active(Gtk::Widget & widget) noexcept -> CppObjectType &; - - auto property_active(this auto && self); + auto property_active() -> Glib::PropertyProxy<bool>; + auto property_active() const -> Glib::PropertyProxy_ReadOnly<bool>; protected: explicit SwitchRow(Glib::ConstructParams const & params); explicit SwitchRow(BaseObjectType * gobj); }; - auto SwitchRow::get_active(this auto && self) noexcept - { - return self.property_active().value(); - } - - auto SwitchRow::property_active(this auto && self) - { - return helpers::make_property_proxy<bool>(self, "active"); - } - } // namespace Adwaita namespace Glib diff --git a/adw/include/adwaitamm/toast.hpp b/adw/include/adwaitamm/toast.hpp index ba82497..2c4718b 100644 --- a/adw/include/adwaitamm/toast.hpp +++ b/adw/include/adwaitamm/toast.hpp @@ -2,6 +2,7 @@ #define LIBADWAITAMM_TOAST_HPP #include "adwaitamm/helpers/gobj_mixin.hpp" + #include <sigc++/signal.h> #include <glibmm/object.h> @@ -80,13 +81,21 @@ namespace Adwaita auto set_use_markup(bool value) -> void; auto property_action_name() -> Glib::PropertyProxy<Glib::ustring>; + auto property_action_name() const -> Glib::PropertyProxy_ReadOnly<Glib::ustring>; auto property_action_target() -> Glib::PropertyProxy<Glib::VariantBase>; + auto property_action_target() const -> Glib::PropertyProxy_ReadOnly<Glib::VariantBase>; auto property_button_label() -> Glib::PropertyProxy<Glib::ustring>; + auto property_button_label() const -> Glib::PropertyProxy_ReadOnly<Glib::ustring>; auto property_custom_title() -> Glib::PropertyProxy<Gtk::Widget *>; + auto property_custom_title() const -> Glib::PropertyProxy_ReadOnly<Gtk::Widget *>; auto property_priority() -> Glib::PropertyProxy<ToastPriority>; + auto property_priority() const -> Glib::PropertyProxy_ReadOnly<ToastPriority>; auto property_timeout() -> Glib::PropertyProxy<unsigned>; + auto property_timeout() const -> Glib::PropertyProxy_ReadOnly<unsigned>; auto property_title() -> Glib::PropertyProxy<Glib::ustring>; + auto property_title() const -> Glib::PropertyProxy_ReadOnly<Glib::ustring>; auto property_use_markup() -> Glib::PropertyProxy<bool>; + auto property_use_markup() const -> Glib::PropertyProxy_ReadOnly<bool>; auto signal_button_clicked() -> Glib::SignalProxy<void()>; auto signal_dismissed() -> Glib::SignalProxy<void()>; diff --git a/adw/include/adwaitamm/toastoverlay.hpp b/adw/include/adwaitamm/toastoverlay.hpp index 9872c1b..5e2742d 100644 --- a/adw/include/adwaitamm/toastoverlay.hpp +++ b/adw/include/adwaitamm/toastoverlay.hpp @@ -59,6 +59,7 @@ namespace Adwaita auto set_child(Gtk::Widget & value) -> void; auto property_child() -> Glib::PropertyProxy<Gtk::Widget *>; + auto property_child() const -> Glib::PropertyProxy_ReadOnly<Gtk::Widget *>; protected: explicit ToastOverlay(Glib::ConstructParams const & params); diff --git a/adw/src/actionrow.cpp b/adw/src/actionrow.cpp index 186cff8..297cefc 100644 --- a/adw/src/actionrow.cpp +++ b/adw/src/actionrow.cpp @@ -1,6 +1,5 @@ #include "adwaitamm/actionrow.hpp" -#include "adwaitamm/helpers/properties.hpp" #include "adwaitamm/preferencesrow.hpp" #include <glibmm/class.h> @@ -77,22 +76,19 @@ namespace Adwaita { } - auto ActionRow::add_prefix(Gtk::Widget & widget) -> ActionRow & + auto ActionRow::add_prefix(Gtk::Widget & widget) -> void { adw_action_row_add_prefix(Glib::unwrap(this), Glib::unwrap(&widget)); - return *this; } - auto ActionRow::add_suffix(Gtk::Widget & widget) -> ActionRow & + auto ActionRow::add_suffix(Gtk::Widget & widget) -> void { adw_action_row_add_suffix(Glib::unwrap(this), Glib::unwrap(&widget)); - return *this; } - auto ActionRow::remove(Gtk::Widget & widget) -> ActionRow & + auto ActionRow::remove(Gtk::Widget & widget) -> void { adw_action_row_remove(Glib::unwrap(this), Glib::unwrap(&widget)); - return *this; } auto ActionRow::get_activatable_widget() const noexcept -> Glib::RefPtr<Gtk::Widget> @@ -128,73 +124,97 @@ namespace Adwaita return adw_action_row_get_title_lines(const_cast<BaseObjectType *>(Glib::unwrap(this))); } + auto ActionRow::set_activatable_widget(Gtk::Widget & widget) noexcept -> void + { + adw_action_row_set_activatable_widget(Glib::unwrap(this), Glib::unwrap(&widget)); + } + + auto ActionRow::set_icon_name(Glib::ustring const & name) -> void + { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + adw_action_row_set_icon_name(Glib::unwrap(this), name.c_str()); +#pragma GCC diagnostic pop + } + + auto ActionRow::set_subtitle(Glib::ustring const & subtitle) -> void + { + adw_action_row_set_subtitle(Glib::unwrap(this), subtitle.c_str()); + } + + auto ActionRow::set_subtitle_lines(int subtitle_lines) noexcept -> void + { + adw_action_row_set_subtitle_lines(Glib::unwrap(this), subtitle_lines); + } + + auto ActionRow::set_subtitle_selectable(bool subtitle_selectable) noexcept -> void + { + adw_action_row_set_subtitle_selectable(Glib::unwrap(this), static_cast<gboolean>(subtitle_selectable)); + } + + auto ActionRow::set_title_lines(int title_lines) noexcept -> void + { + adw_action_row_set_title_lines(Glib::unwrap(this), title_lines); + } + auto ActionRow::property_activatable_widget() noexcept -> Glib::PropertyProxy<Gtk::Widget *> { - return helpers::make_property_proxy<Gtk::Widget *>(*this, "activatable-widget"); + return Glib::PropertyProxy<Gtk::Widget *>(this, "activatable-widget"); } - auto ActionRow::property_icon_name() noexcept -> Glib::PropertyProxy<Glib::ustring> + auto ActionRow::property_activatable_widget() const noexcept -> Glib::PropertyProxy_ReadOnly<Gtk::Widget *> { - return helpers::make_property_proxy<Glib::ustring>(*this, "icon-name"); + return Glib::PropertyProxy_ReadOnly<Gtk::Widget *>(this, "activatable-widget"); } - auto ActionRow::property_subtitle() noexcept -> Glib::PropertyProxy<Glib::ustring> + auto ActionRow::property_icon_name() noexcept -> Glib::PropertyProxy<Glib::ustring> { - return helpers::make_property_proxy<Glib::ustring>(*this, "subtitle"); + return Glib::PropertyProxy<Glib::ustring>(this, "icon-name"); } - auto ActionRow::property_subtitle_lines() noexcept -> Glib::PropertyProxy<int> + auto ActionRow::property_icon_name() const noexcept -> Glib::PropertyProxy_ReadOnly<Glib::ustring> { - return helpers::make_property_proxy<int>(*this, "subtitle-lines"); + return Glib::PropertyProxy_ReadOnly<Glib::ustring>(this, "icon-name"); } - auto ActionRow::property_subtitle_selectable() noexcept -> Glib::PropertyProxy<bool> + auto ActionRow::property_subtitle() noexcept -> Glib::PropertyProxy<Glib::ustring> { - return helpers::make_property_proxy<bool>(*this, "subtitle-selectable"); + return Glib::PropertyProxy<Glib::ustring>(this, "subtitle"); } - auto ActionRow::property_title_lines() noexcept -> Glib::PropertyProxy<int> + auto ActionRow::property_subtitle() const noexcept -> Glib::PropertyProxy_ReadOnly<Glib::ustring> { - return helpers::make_property_proxy<int>(*this, "title-lines"); + return Glib::PropertyProxy_ReadOnly<Glib::ustring>(this, "subtitle"); } - auto ActionRow::set_activatable_widget(Gtk::Widget & widget) noexcept -> CppObjectType & + auto ActionRow::property_subtitle_lines() noexcept -> Glib::PropertyProxy<int> { - adw_action_row_set_activatable_widget(Glib::unwrap(this), Glib::unwrap(&widget)); - return *this; + return Glib::PropertyProxy<int>(this, "subtitle-lines"); } - auto ActionRow::set_icon_name(Glib::ustring const & name) -> CppObjectType & + auto ActionRow::property_subtitle_lines() const noexcept -> Glib::PropertyProxy_ReadOnly<int> { -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" - adw_action_row_set_icon_name(Glib::unwrap(this), name.c_str()); -#pragma GCC diagnostic pop - return *this; + return Glib::PropertyProxy_ReadOnly<int>(this, "subtitle-lines"); } - auto ActionRow::set_subtitle(Glib::ustring const & subtitle) -> CppObjectType & + auto ActionRow::property_subtitle_selectable() noexcept -> Glib::PropertyProxy<bool> { - adw_action_row_set_subtitle(Glib::unwrap(this), subtitle.c_str()); - return *this; + return Glib::PropertyProxy<bool>(this, "subtitle-selectable"); } - auto ActionRow::set_subtitle_lines(int subtitle_lines) noexcept -> CppObjectType & + auto ActionRow::property_subtitle_selectable() const noexcept -> Glib::PropertyProxy_ReadOnly<bool> { - adw_action_row_set_subtitle_lines(Glib::unwrap(this), subtitle_lines); - return *this; + return Glib::PropertyProxy_ReadOnly<bool>(this, "subtitle-selectable"); } - auto ActionRow::set_subtitle_selectable(bool subtitle_selectable) noexcept -> CppObjectType & + auto ActionRow::property_title_lines() noexcept -> Glib::PropertyProxy<int> { - adw_action_row_set_subtitle_selectable(Glib::unwrap(this), static_cast<gboolean>(subtitle_selectable)); - return *this; + return Glib::PropertyProxy<int>(this, "title-lines"); } - auto ActionRow::set_title_lines(int title_lines) noexcept -> CppObjectType & + auto ActionRow::property_title_lines() const noexcept -> Glib::PropertyProxy_ReadOnly<int> { - adw_action_row_set_title_lines(Glib::unwrap(this), title_lines); - return *this; + return Glib::PropertyProxy_ReadOnly<int>(this, "title-lines"); } } // namespace Adwaita diff --git a/adw/src/breakpoint.cpp b/adw/src/breakpoint.cpp index a1b20f9..01e68ca 100644 --- a/adw/src/breakpoint.cpp +++ b/adw/src/breakpoint.cpp @@ -1,7 +1,6 @@ #include "adwaitamm/breakpoint.hpp" #include "adwaitamm/enums.hpp" -#include "adwaitamm/helpers/properties.hpp" #include <glibmm/class.h> #include <glibmm/object.h> @@ -147,7 +146,12 @@ namespace Adwaita auto Breakpoint::property_condition() -> Glib::PropertyProxy<BreakpointCondition *> { - return helpers::make_property_proxy<BreakpointCondition *>(*this, "condition"); + return Glib::PropertyProxy<BreakpointCondition *>(this, "condition"); + } + + auto Breakpoint::property_condition() const -> Glib::PropertyProxy_ReadOnly<BreakpointCondition *> + { + return Glib::PropertyProxy_ReadOnly<BreakpointCondition *>(this, "condition"); } } // namespace Adwaita 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 <glibmm/class.h> #include <glibmm/object.h> #include <glibmm/objectbase.h> +#include <glibmm/propertyproxy.h> #include <glibmm/refptr.h> #include <glibmm/ustring.h> #include <glibmm/utility.h> @@ -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<BaseObjectType *>(unwrap(this))); + } + + auto PreferencesRow::get_title_selectable() const noexcept -> bool + { + return adw_preferences_row_get_title_selectable(const_cast<BaseObjectType *>(unwrap(this))); + } + + auto PreferencesRow::get_use_markup() const noexcept -> bool + { + return adw_preferences_row_get_use_markup(const_cast<BaseObjectType *>(unwrap(this))); + } + + auto PreferencesRow::get_use_underline() const noexcept -> bool + { + return adw_preferences_row_get_use_underline(const_cast<BaseObjectType *>(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<Glib::ustring> { + return Glib::PropertyProxy<Glib::ustring>{this, "title"}; } - PreferencesRow::PreferencesRow(BaseObjectType * gobj) - : Gtk::ListBoxRow(GTK_LIST_BOX_ROW(gobj)) + auto PreferencesRow::property_title() const -> Glib::PropertyProxy_ReadOnly<Glib::ustring> + { + return Glib::PropertyProxy_ReadOnly<Glib::ustring>{this, "title"}; + } + + auto PreferencesRow::property_title_selectable() -> Glib::PropertyProxy<bool> + { + return Glib::PropertyProxy<bool>{this, "title-selectable"}; + } + + auto PreferencesRow::property_title_selectable() const -> Glib::PropertyProxy_ReadOnly<bool> + { + return Glib::PropertyProxy_ReadOnly<bool>{this, "title-selectable"}; + } + + auto PreferencesRow::property_use_markup() -> Glib::PropertyProxy<bool> + { + return Glib::PropertyProxy<bool>{this, "use-markup"}; + } + + auto PreferencesRow::property_use_markup() const -> Glib::PropertyProxy_ReadOnly<bool> + { + return Glib::PropertyProxy_ReadOnly<bool>{this, "use-markup"}; + } + + auto PreferencesRow::property_use_underline() -> Glib::PropertyProxy<bool> + { + return Glib::PropertyProxy<bool>{this, "use-underline"}; + } + + auto PreferencesRow::property_use_underline() const -> Glib::PropertyProxy_ReadOnly<bool> { + return Glib::PropertyProxy_ReadOnly<bool>{this, "use-underline"}; } } // namespace Adwaita diff --git a/adw/src/switchrow.cpp b/adw/src/switchrow.cpp index 0aab454..9c0245e 100644 --- a/adw/src/switchrow.cpp +++ b/adw/src/switchrow.cpp @@ -5,6 +5,7 @@ #include <glibmm/class.h> #include <glibmm/object.h> #include <glibmm/objectbase.h> +#include <glibmm/propertyproxy.h> #include <glibmm/refptr.h> #include <glibmm/wrap.h> @@ -68,6 +69,26 @@ namespace Adwaita { } + auto SwitchRow::get_active() const noexcept -> bool + { + return adw_switch_row_get_active(const_cast<BaseObjectType *>(unwrap(this))); + } + + auto SwitchRow::set_active(bool value) noexcept -> void + { + adw_switch_row_set_active(unwrap(this), value); + } + + auto SwitchRow::property_active() -> Glib::PropertyProxy<bool> + { + return Glib::PropertyProxy<bool>{this, "active"}; + } + + auto SwitchRow::property_active() const -> Glib::PropertyProxy_ReadOnly<bool> + { + return Glib::PropertyProxy_ReadOnly<bool>{this, "active"}; + } + } // namespace Adwaita namespace Glib diff --git a/adw/src/toast.cpp b/adw/src/toast.cpp index d5b372e..4d66c93 100644 --- a/adw/src/toast.cpp +++ b/adw/src/toast.cpp @@ -1,7 +1,6 @@ #include "adwaitamm/toast.hpp" #include "adwaitamm/enums.hpp" -#include "adwaitamm/helpers/properties.hpp" #include <glibmm/class.h> #include <glibmm/object.h> @@ -43,7 +42,7 @@ namespace Adwaita if (!gtype_) { class_init_func_ = &class_init_function; - gtype_= adw_toast_get_type(); + gtype_ = adw_toast_get_type(); } return *this; } @@ -183,42 +182,81 @@ namespace Adwaita auto Toast::property_action_name() -> Glib::PropertyProxy<Glib::ustring> { - return helpers::make_property_proxy<Glib::ustring>(*this, "action-name"); + return Glib::PropertyProxy<Glib::ustring>(this, "action-name"); + } + + auto Toast::property_action_name() const -> Glib::PropertyProxy_ReadOnly<Glib::ustring> + { + return Glib::PropertyProxy_ReadOnly<Glib::ustring>(this, "action-name"); } auto Toast::property_action_target() -> Glib::PropertyProxy<Glib::VariantBase> { - return helpers::make_property_proxy<Glib::VariantBase>(*this, "action-target"); + return Glib::PropertyProxy<Glib::VariantBase>(this, "action-target"); + } + + auto Toast::property_action_target() const -> Glib::PropertyProxy_ReadOnly<Glib::VariantBase> + { + return Glib::PropertyProxy_ReadOnly<Glib::VariantBase>(this, "action-target"); } auto Toast::property_button_label() -> Glib::PropertyProxy<Glib::ustring> { - return helpers::make_property_proxy<Glib::ustring>(*this, "button-label"); + return Glib::PropertyProxy<Glib::ustring>(this, "button-label"); + } + + auto Toast::property_button_label() const -> Glib::PropertyProxy_ReadOnly<Glib::ustring> + { + return Glib::PropertyProxy_ReadOnly<Glib::ustring>(this, "button-label"); } auto Toast::property_custom_title() -> Glib::PropertyProxy<Gtk::Widget *> { - return helpers::make_property_proxy<Gtk::Widget *>(*this, "custom-title"); + return Glib::PropertyProxy<Gtk::Widget *>(this, "custom-title"); + } + + auto Toast::property_custom_title() const -> Glib::PropertyProxy_ReadOnly<Gtk::Widget *> + { + return Glib::PropertyProxy_ReadOnly<Gtk::Widget *>(this, "custom-title"); } auto Toast::property_priority() -> Glib::PropertyProxy<ToastPriority> { - return helpers::make_property_proxy<ToastPriority>(*this, "priority"); + return Glib::PropertyProxy<ToastPriority>(this, "priority"); } + auto Toast::property_priority() const -> Glib::PropertyProxy_ReadOnly<ToastPriority> + { + return Glib::PropertyProxy_ReadOnly<ToastPriority>(this, "priority"); + } auto Toast::property_timeout() -> Glib::PropertyProxy<unsigned> { - return helpers::make_property_proxy<unsigned>(*this, "timeout"); + return Glib::PropertyProxy<unsigned>(this, "timeout"); + } + + auto Toast::property_timeout() const -> Glib::PropertyProxy_ReadOnly<unsigned> + { + return Glib::PropertyProxy_ReadOnly<unsigned>(this, "timeout"); } auto Toast::property_title() -> Glib::PropertyProxy<Glib::ustring> { - return helpers::make_property_proxy<Glib::ustring>(*this, "title"); + return Glib::PropertyProxy<Glib::ustring>(this, "title"); + } + + auto Toast::property_title() const -> Glib::PropertyProxy_ReadOnly<Glib::ustring> + { + return Glib::PropertyProxy_ReadOnly<Glib::ustring>(this, "title"); } auto Toast::property_use_markup() -> Glib::PropertyProxy<bool> { - return helpers::make_property_proxy<bool>(*this, "use-markup"); + return Glib::PropertyProxy<bool>(this, "use-markup"); + } + + auto Toast::property_use_markup() const -> Glib::PropertyProxy_ReadOnly<bool> + { + return Glib::PropertyProxy_ReadOnly<bool>(this, "use-markup"); } auto Toast::signal_button_clicked() -> Glib::SignalProxy<void()> diff --git a/adw/src/toastoverlay.cpp b/adw/src/toastoverlay.cpp index cc9eb26..e59ba62 100644 --- a/adw/src/toastoverlay.cpp +++ b/adw/src/toastoverlay.cpp @@ -84,6 +84,11 @@ namespace Adwaita return Glib::PropertyProxy<Gtk::Widget *>{this, "child"}; } + auto ToastOverlay::property_child() const -> Glib::PropertyProxy_ReadOnly<Gtk::Widget *> + { + return Glib::PropertyProxy_ReadOnly<Gtk::Widget *>{this, "child"}; + } + ToastOverlay::ToastOverlay(Glib::ConstructParams const & params) : Gtk::Widget{params} { |
