diff options
Diffstat (limited to 'include/turns/adw/actionrow.hpp')
| -rw-r--r-- | include/turns/adw/actionrow.hpp | 98 |
1 files changed, 22 insertions, 76 deletions
diff --git a/include/turns/adw/actionrow.hpp b/include/turns/adw/actionrow.hpp index 15ddbb1..d098d65 100644 --- a/include/turns/adw/actionrow.hpp +++ b/include/turns/adw/actionrow.hpp @@ -2,16 +2,22 @@ #define TURNS_ADW_ACTION_ROW_HPP #include "helpers/gobj_mixin.hpp" -#include "turns/adw/helpers/properties.hpp" #include "turns/adw/preferencesrow.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> #include <gtkmm/widget.h> +#include <glib-object.h> +#include <glib.h> + using AdwActionRow = struct _AdwActionRow; +using AdwActionRowClass = struct _AdwActionRowClass; namespace turns::adw { @@ -21,9 +27,9 @@ namespace turns::adw struct Class : Glib::Class { using BaseClassParent = AdwPreferencesRowClass; - using BaseClassType = struct AdwActionRowClass; + using BaseClassType = AdwActionRowClass; using BaseObjectType = AdwActionRow; - using CppClassParent = adw::PreferencesRow; + using CppClassParent = adw::PreferencesRow::Class; using CppObjectType = ActionRow; auto init() -> Glib::Class const &; @@ -53,12 +59,19 @@ namespace turns::adw auto add_suffix(Gtk::Widget & widget) -> ActionRow &; auto remove(Gtk::Widget & widget) -> ActionRow &; - auto get_activatable_widget(this auto && self) noexcept; - [[deprecated("replaced by add_prefix")]] auto get_icon_name(this auto && self); - auto get_subtitle(this auto && self); - auto get_subtitle_lines(this auto && self) noexcept; - auto get_subtitle_selectable(this auto && self) noexcept; - auto get_title_lines(this auto && self) noexcept; + auto get_activatable_widget() const noexcept -> Glib::RefPtr<Gtk::Widget>; + [[deprecated("replaced by add_prefix")]] auto get_icon_name() const -> Glib::ustring; + auto get_subtitle() const -> Glib::ustring; + auto get_subtitle_lines() const noexcept -> int; + auto get_subtitle_selectable() const noexcept -> bool; + auto get_title_lines() const noexcept -> int; + + auto property_activatable_widget() noexcept -> Glib::PropertyProxy<Gtk::Widget *>; + [[deprecated("replaced by add_prefix")]] auto property_icon_name() noexcept -> Glib::PropertyProxy<Glib::ustring>; + auto property_subtitle() noexcept -> Glib::PropertyProxy<Glib::ustring>; + auto property_subtitle_lines() noexcept -> Glib::PropertyProxy<int>; + auto property_subtitle_selectable() noexcept -> Glib::PropertyProxy<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 &; @@ -67,78 +80,11 @@ namespace turns::adw auto set_subtitle_selectable(bool subtitle_selectable) noexcept -> CppObjectType &; auto set_title_lines(int title_lines) noexcept -> CppObjectType &; - auto property_activatable_widget(this auto && self); - [[deprecated("replaced by add_prefix")]] auto property_icon_name(this auto && self); - auto property_subtitle(this auto && self); - auto property_subtitle_lines(this auto && self); - auto property_subtitle_selectable(this auto && self); - auto property_title_lines(this auto && self); - protected: explicit ActionRow(Glib::ConstructParams const & params); explicit ActionRow(BaseObjectType * gobj); }; - auto ActionRow::get_activatable_widget(this auto && self) noexcept - { - return self.property_activatable_widget().value(); - } - - auto ActionRow::get_icon_name(this auto && self) - { - return self.property_icon_name().value(); - } - - auto ActionRow::get_subtitle(this auto && self) - { - return self.property_subtitle().value(); - } - - auto ActionRow::get_subtitle_lines(this auto && self) noexcept - { - return self.property_subtitle_lines().value(); - } - - auto ActionRow::get_subtitle_selectable(this auto && self) noexcept - { - return self.property_subtitle_selectable().value(); - } - - auto ActionRow::get_title_lines(this auto && self) noexcept - { - return self.property_title_lines().value(); - } - - auto ActionRow::property_activatable_widget(this auto && self) - { - return helpers::make_property_proxy<Gtk::Widget *>(self, "activatable-widget"); - } - - auto ActionRow::property_icon_name(this auto && self) - { - return helpers::make_property_proxy<Glib::ustring>(self, "icon-name"); - } - - auto ActionRow::property_subtitle(this auto && self) - { - return helpers::make_property_proxy<Glib::ustring>(self, "subtitle"); - } - - auto ActionRow::property_subtitle_lines(this auto && self) - { - return helpers::make_property_proxy<int>(self, "subtitle-lines"); - } - - auto ActionRow::property_subtitle_selectable(this auto && self) - { - return helpers::make_property_proxy<bool>(self, "subtitle-selectable"); - } - - auto ActionRow::property_title_lines(this auto && self) - { - return helpers::make_property_proxy<int>(self, "title-lines"); - } - } // namespace turns::adw namespace Glib |
