summaryrefslogtreecommitdiff
path: root/adw/include
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2025-03-27 08:27:32 +0100
committerFelix Morgner <felix.morgner@gmail.com>2025-03-27 08:27:32 +0100
commit5467a7c2b1fb1831ca726d1ecb6b46010d146ebc (patch)
treec1f1ae48c385c5406d8735e915198dc3d3664466 /adw/include
parentcde49b2d8ba32ec5ee1c63087042d8255d88d701 (diff)
downloadturns-5467a7c2b1fb1831ca726d1ecb6b46010d146ebc.tar.xz
turns-5467a7c2b1fb1831ca726d1ecb6b46010d146ebc.zip
adw: clean up implementation
Diffstat (limited to 'adw/include')
-rw-r--r--adw/include/turns/adw/actionrow.hpp98
-rw-r--r--adw/include/turns/adw/application.hpp3
-rw-r--r--adw/include/turns/adw/applicationwindow.hpp64
-rw-r--r--adw/include/turns/adw/dialog.hpp7
-rw-r--r--adw/include/turns/adw/preferencesdialog.hpp3
-rw-r--r--adw/include/turns/adw/preferencespage.hpp3
-rw-r--r--adw/include/turns/adw/preferencesrow.hpp3
-rw-r--r--adw/include/turns/adw/switchrow.hpp10
8 files changed, 108 insertions, 83 deletions
diff --git a/adw/include/turns/adw/actionrow.hpp b/adw/include/turns/adw/actionrow.hpp
index 15ddbb1..d098d65 100644
--- a/adw/include/turns/adw/actionrow.hpp
+++ b/adw/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
diff --git a/adw/include/turns/adw/application.hpp b/adw/include/turns/adw/application.hpp
index 64efcb0..df5e930 100644
--- a/adw/include/turns/adw/application.hpp
+++ b/adw/include/turns/adw/application.hpp
@@ -12,6 +12,7 @@
#include <gtkmm/application.h>
using AdwApplication = struct _AdwApplication;
+using AdwApplicationClass = struct _AdwApplicationClass;
namespace turns::adw
{
@@ -21,7 +22,7 @@ namespace turns::adw
struct Class : Glib::Class
{
using BaseClassParent = GtkApplicationClass;
- using BaseClassType = struct AdwApplicationClass;
+ using BaseClassType = AdwApplicationClass;
using BaseObjectType = AdwApplication;
using CppClassParent = struct Gtk::Application_Class;
using CppObjectType = Application;
diff --git a/adw/include/turns/adw/applicationwindow.hpp b/adw/include/turns/adw/applicationwindow.hpp
new file mode 100644
index 0000000..e5b02b0
--- /dev/null
+++ b/adw/include/turns/adw/applicationwindow.hpp
@@ -0,0 +1,64 @@
+#ifndef TURNS_ADW_APPLICATION_WINDOW_HPP
+#define TURNS_ADW_APPLICATION_WINDOW_HPP
+
+#include "helpers/gobj_mixin.hpp"
+
+#include <glibmm/object.h>
+#include <glibmm/objectbase.h>
+#include <glibmm/refptr.h>
+#include <glibmm/ustring.h>
+
+#include <gtkmm/application.h>
+#include <gtkmm/applicationwindow.h>
+
+using AdwApplicationWindow = struct _AdwApplicationWindow;
+using AdwApplicationWindowClass = struct _AdwApplicationWindowClass;
+
+namespace turns::adw
+{
+ struct ApplicationWindow : Gtk::ApplicationWindow,
+ helpers::gobj_mixin<ApplicationWindow, AdwApplicationWindow>
+ {
+ struct Class : Glib::Class
+ {
+ using BaseClassParent = GtkApplicationWindowClass;
+ using BaseClassType = AdwApplicationWindowClass;
+ using BaseObjectType = AdwApplicationWindow;
+ using CppClassParent = struct Gtk::ApplicationWindow_Class;
+ using CppObjectType = ApplicationWindow;
+
+ auto init() -> Glib::Class const &;
+ auto static class_init_function(void * gclass, void * data) -> void;
+ auto static wrap_new(GObject * object) -> Glib::ObjectBase *;
+ };
+
+ using BaseObjectType = Class::BaseObjectType;
+ using BaseClassType = Class::BaseClassType;
+ using CppObjectType = Class::CppObjectType;
+ using CppClassType = Class;
+
+ using helpers::gobj_mixin<CppObjectType, BaseObjectType>::gobj;
+ using helpers::gobj_mixin<CppObjectType, BaseObjectType>::gobj_copy;
+
+ explicit ApplicationWindow(Gtk::Application & app);
+ ApplicationWindow(ApplicationWindow const & other) = delete;
+ ApplicationWindow(ApplicationWindow && other) noexcept = default;
+
+ auto operator=(ApplicationWindow const & other) noexcept -> ApplicationWindow & = delete;
+ auto operator=(ApplicationWindow && other) noexcept -> ApplicationWindow & = default;
+
+ auto static get_type() -> GType;
+ auto static get_base_type() -> GType;
+
+ protected:
+ explicit ApplicationWindow(Glib::ConstructParams const & params);
+ explicit ApplicationWindow(BaseObjectType * gobj);
+ };
+} // namespace turns::adw
+
+namespace Glib
+{
+ auto wrap(AdwApplicationWindow * object, bool copy = false) -> turns::adw::ApplicationWindow *;
+} // namespace Glib
+
+#endif \ No newline at end of file
diff --git a/adw/include/turns/adw/dialog.hpp b/adw/include/turns/adw/dialog.hpp
index af5f5da..75a095c 100644
--- a/adw/include/turns/adw/dialog.hpp
+++ b/adw/include/turns/adw/dialog.hpp
@@ -4,11 +4,16 @@
#include "helpers/gobj_mixin.hpp"
#include <glibmm/class.h>
+#include <glibmm/object.h>
+#include <glibmm/objectbase.h>
#include <glibmm/refptr.h>
#include <gtkmm/widget.h>
+#include <glib-object.h>
+
using AdwDialog = struct _AdwDialog;
+using AdwDialogClass = struct _AdwDialogClass;
namespace turns::adw
{
@@ -20,7 +25,7 @@ namespace turns::adw
struct Class : Glib::Class
{
using BaseClassParent = GtkWidgetClass;
- using BaseClassType = struct AdwDialogClass;
+ using BaseClassType = AdwDialogClass;
using BaseObjectType = AdwDialog;
using CppClassParent = struct Gtk::Widget_Class;
using CppObjectType = Dialog;
diff --git a/adw/include/turns/adw/preferencesdialog.hpp b/adw/include/turns/adw/preferencesdialog.hpp
index 06ac600..85735ef 100644
--- a/adw/include/turns/adw/preferencesdialog.hpp
+++ b/adw/include/turns/adw/preferencesdialog.hpp
@@ -11,6 +11,7 @@
#include <gtkmm/widget.h>
using AdwPreferencesDialog = struct _AdwPreferencesDialog;
+using AdwPreferencesDialogClass = struct _AdwPreferencesDialogClass;
namespace turns::adw
{
@@ -22,7 +23,7 @@ namespace turns::adw
struct Class : Glib::Class
{
using BaseClassParent = AdwDialogClass;
- using BaseClassType = struct AdwPreferencesDialogClass;
+ using BaseClassType = AdwPreferencesDialogClass;
using BaseObjectType = AdwPreferencesDialog;
using CppClassParent = adw::Dialog::Class;
using CppObjectType = PreferencesDialog;
diff --git a/adw/include/turns/adw/preferencespage.hpp b/adw/include/turns/adw/preferencespage.hpp
index 30e7eed..b8b4051 100644
--- a/adw/include/turns/adw/preferencespage.hpp
+++ b/adw/include/turns/adw/preferencespage.hpp
@@ -10,6 +10,7 @@
#include <gtkmm/widget.h>
using AdwPreferencesPage = struct _AdwPreferencesPage;
+using AdwPreferencesPageClass = struct _AdwPreferencesPageClass;
namespace turns::adw
{
@@ -19,7 +20,7 @@ namespace turns::adw
struct Class : Glib::Class
{
using BaseClassParent = GtkWidgetClass;
- using BaseClassType = struct AdwPreferencesPageClass;
+ using BaseClassType = AdwPreferencesPageClass;
using BaseObjectType = AdwPreferencesPage;
using CppClassParent = struct Gtk::Widget_Class;
using CppObjectType = PreferencesPage;
diff --git a/adw/include/turns/adw/preferencesrow.hpp b/adw/include/turns/adw/preferencesrow.hpp
index 6f831b0..a0f22ed 100644
--- a/adw/include/turns/adw/preferencesrow.hpp
+++ b/adw/include/turns/adw/preferencesrow.hpp
@@ -11,6 +11,7 @@
#include <gtkmm/listboxrow.h>
using AdwPreferencesRow = struct _AdwPreferencesRow;
+using AdwPreferencesRowClass = struct _AdwPreferencesRowClass;
namespace turns::adw
{
@@ -20,7 +21,7 @@ namespace turns::adw
struct Class : Glib::Class
{
using BaseClassParent = GtkListBoxRowClass;
- using BaseClassType = struct AdwPreferencesRowClass;
+ using BaseClassType = AdwPreferencesRowClass;
using BaseObjectType = AdwPreferencesRow;
using CppClassParent = struct Gtk::ListBoxRow_Class;
using CppObjectType = PreferencesRow;
diff --git a/adw/include/turns/adw/switchrow.hpp b/adw/include/turns/adw/switchrow.hpp
index ed5190a..e7e0131 100644
--- a/adw/include/turns/adw/switchrow.hpp
+++ b/adw/include/turns/adw/switchrow.hpp
@@ -6,11 +6,17 @@
#include "turns/adw/helpers/properties.hpp"
#include <glibmm/class.h>
+#include <glibmm/object.h>
+#include <glibmm/objectbase.h>
#include <glibmm/refptr.h>
#include <glibmm/ustring.h>
#include <gtkmm/widget.h>
+#define _ADWAITA_INSIDE
+#include <adw-switch-row.h>
+#undef _ADWAITA_INSIDE
+
using AdwSwitchRow = struct _AdwSwitchRow;
namespace turns::adw
@@ -21,9 +27,9 @@ namespace turns::adw
struct Class : Glib::Class
{
using BaseClassParent = AdwActionRowClass;
- using BaseClassType = struct AdwSwitchRowClass;
+ using BaseClassType = AdwSwitchRowClass;
using BaseObjectType = AdwSwitchRow;
- using CppClassParent = adw::ActionRow;
+ using CppClassParent = adw::ActionRow::Class;
using CppObjectType = SwitchRow;
auto init() -> Glib::Class const &;