summaryrefslogtreecommitdiff
path: root/adw/src/actionrow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'adw/src/actionrow.cpp')
-rw-r--r--adw/src/actionrow.cpp102
1 files changed, 84 insertions, 18 deletions
diff --git a/adw/src/actionrow.cpp b/adw/src/actionrow.cpp
index f45f7a3..e8cfc7d 100644
--- a/adw/src/actionrow.cpp
+++ b/adw/src/actionrow.cpp
@@ -1,10 +1,12 @@
#include "turns/adw/actionrow.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 <glibmm/utility.h>
@@ -12,10 +14,13 @@
#include <gtkmm/init.h>
#include <gtkmm/listboxrow.h>
+#include <gtkmm/object.h>
#include <gtkmm/private/widget_p.h>
+#include <gtkmm/widget.h>
#include <adwaita.h>
#include <glib-object.h>
+#include <glib.h>
#include <gtk/gtk.h>
namespace turns::adw
@@ -29,7 +34,7 @@ namespace turns::adw
{
if (!gtype_)
{
- class_init_func_ = &ActionRow::Class::class_init_function;
+ class_init_func_ = &class_init_function;
register_derived_type(adw_action_row_get_type());
}
return *this;
@@ -37,13 +42,13 @@ namespace turns::adw
auto ActionRow::Class::class_init_function(void * gclass, void * data) -> void
{
- auto const klass = static_cast<AdwActionRowClass *>(gclass);
- PreferencesRow::Class::class_init_function(klass, data);
+ auto const klass = static_cast<BaseClassType *>(gclass);
+ CppClassParent::class_init_function(klass, data);
}
auto ActionRow::Class::wrap_new(GObject * object) -> Glib::ObjectBase *
{
- return new ActionRow(ADW_ACTION_ROW(object));
+ return Gtk::manage(new ActionRow(ADW_ACTION_ROW(object)));
}
auto ActionRow::get_type() -> GType
@@ -62,6 +67,16 @@ namespace turns::adw
{
}
+ ActionRow::ActionRow(Glib::ConstructParams const & params)
+ : adw::PreferencesRow{params}
+ {
+ }
+
+ ActionRow::ActionRow(BaseObjectType * gobj)
+ : adw::PreferencesRow(ADW_PREFERENCES_ROW(gobj))
+ {
+ }
+
auto ActionRow::add_prefix(Gtk::Widget & widget) -> ActionRow &
{
adw_action_row_add_prefix(Glib::unwrap(this), Glib::unwrap(&widget));
@@ -80,6 +95,69 @@ namespace turns::adw
return *this;
}
+ auto ActionRow::get_activatable_widget() const noexcept -> Glib::RefPtr<Gtk::Widget>
+ {
+ return Glib::make_refptr_for_instance(Glib::wrap(adw_action_row_get_activatable_widget(const_cast<BaseObjectType *>(Glib::unwrap(this)))));
+ }
+
+ auto ActionRow::get_icon_name() const -> Glib::ustring
+ {
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+ return adw_action_row_get_icon_name(const_cast<BaseObjectType *>(Glib::unwrap(this)));
+#pragma GCC diagnostic pop
+ }
+
+ auto ActionRow::get_subtitle() const -> Glib::ustring
+ {
+ return adw_action_row_get_subtitle(const_cast<BaseObjectType *>(Glib::unwrap(this)));
+ }
+
+ auto ActionRow::get_subtitle_lines() const noexcept -> int
+ {
+ return adw_action_row_get_subtitle_lines(const_cast<BaseObjectType *>(Glib::unwrap(this)));
+ }
+
+ auto ActionRow::get_subtitle_selectable() const noexcept -> bool
+ {
+ return adw_action_row_get_subtitle_selectable(const_cast<BaseObjectType *>(Glib::unwrap(this)));
+ }
+
+ auto ActionRow::get_title_lines() const noexcept -> int
+ {
+ return adw_action_row_get_title_lines(const_cast<BaseObjectType *>(Glib::unwrap(this)));
+ }
+
+ auto ActionRow::property_activatable_widget() noexcept -> Glib::PropertyProxy<Gtk::Widget *>
+ {
+ return helpers::make_property_proxy<Gtk::Widget *>(*this, "activatable-widget");
+ }
+
+ auto ActionRow::property_icon_name() noexcept -> Glib::PropertyProxy<Glib::ustring>
+ {
+ return helpers::make_property_proxy<Glib::ustring>(*this, "icon-name");
+ }
+
+ auto ActionRow::property_subtitle() noexcept -> Glib::PropertyProxy<Glib::ustring>
+ {
+ return helpers::make_property_proxy<Glib::ustring>(*this, "subtitle");
+ }
+
+ auto ActionRow::property_subtitle_lines() noexcept -> Glib::PropertyProxy<int>
+ {
+ return helpers::make_property_proxy<int>(*this, "subtitle-lines");
+ }
+
+ auto ActionRow::property_subtitle_selectable() noexcept -> Glib::PropertyProxy<bool>
+ {
+ return helpers::make_property_proxy<bool>(*this, "subtitle-selectable");
+ }
+
+ auto ActionRow::property_title_lines() noexcept -> Glib::PropertyProxy<int>
+ {
+ return helpers::make_property_proxy<int>(*this, "title-lines");
+ }
+
auto ActionRow::set_activatable_widget(Gtk::Widget & widget) noexcept -> CppObjectType &
{
adw_action_row_set_activatable_widget(Glib::unwrap(this), Glib::unwrap(&widget));
@@ -109,7 +187,7 @@ namespace turns::adw
auto ActionRow::set_subtitle_selectable(bool subtitle_selectable) noexcept -> CppObjectType &
{
- adw_action_row_set_subtitle_selectable(Glib::unwrap(this), subtitle_selectable);
+ adw_action_row_set_subtitle_selectable(Glib::unwrap(this), static_cast<gboolean>(subtitle_selectable));
return *this;
}
@@ -119,24 +197,12 @@ namespace turns::adw
return *this;
}
- ActionRow::ActionRow(Glib::ConstructParams const & params)
- : adw::PreferencesRow{params}
- {
- }
-
- ActionRow::ActionRow(BaseObjectType * gobj)
- : Glib::ObjectBase{nullptr}
- , adw::PreferencesRow(ADW_PREFERENCES_ROW(gobj))
- {
- }
-
} // namespace turns::adw
namespace Glib
{
auto wrap(AdwActionRow * object, bool copy) -> Glib::RefPtr<turns::adw::ActionRow>
{
- return Glib::make_refptr_for_instance<turns::adw::ActionRow>(
- dynamic_cast<turns::adw::ActionRow *>(Glib::wrap_auto(G_OBJECT(object), copy)));
+ return Glib::make_refptr_for_instance(dynamic_cast<turns::adw::ActionRow *>(Glib::wrap_auto(G_OBJECT(object), copy)));
}
} // namespace Glib \ No newline at end of file