From 4e4332cb402fd3151e11e7e3b6d673388d7bb4a9 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Sat, 26 Apr 2025 16:33:35 +0200 Subject: adw: implement AboutDialog --- adw/include/adwaitamm/aboutdialog.hpp | 170 +++++++ adw/include/adwaitamm/private/aboutdialog_p.hpp | 35 ++ adw/src/aboutdialog.cpp | 607 ++++++++++++++++++++++++ adw/src/private/aboutdialog_p.cpp | 40 ++ adw/src/wrap_init.cpp | 4 + 5 files changed, 856 insertions(+) create mode 100644 adw/include/adwaitamm/aboutdialog.hpp create mode 100644 adw/include/adwaitamm/private/aboutdialog_p.hpp create mode 100644 adw/src/aboutdialog.cpp create mode 100644 adw/src/private/aboutdialog_p.cpp diff --git a/adw/include/adwaitamm/aboutdialog.hpp b/adw/include/adwaitamm/aboutdialog.hpp new file mode 100644 index 0000000..86f6751 --- /dev/null +++ b/adw/include/adwaitamm/aboutdialog.hpp @@ -0,0 +1,170 @@ +/** + * @author Felix Morgner (felix.morgner@gmail.com) + * @copyright Copyright (c) 2025 + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef LIBADWAITAMM_ABOUT_DIALOG_HPP +#define LIBADWAITAMM_ABOUT_DIALOG_HPP + +#include "adwaitamm/dialog.hpp" +#include "adwaitamm/helpers/gobj_mixin.hpp" + +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include + +#define _ADWAITA_INSIDE +#include +#undef _ADWAITA_INSIDE + +namespace Adwaita +{ + enum struct ResponseAppearance; + + struct AboutDialog final : Dialog, + helpers::gobj_mixin + { + using BaseObjectType = AdwAboutDialog; + using BaseClassType = AdwAboutDialogClass; + using CppObjectType = AboutDialog; + using CppClassType = struct AboutDialog_Class; + + using helpers::gobj_mixin::gobj; + using helpers::gobj_mixin::gobj_copy; + +#pragma mark - Special Member Functions + AboutDialog(); + AboutDialog(std::string resource_path, std::string release_notes_version); + AboutDialog(AboutDialog const & other) = delete; + AboutDialog(AboutDialog && other) noexcept = default; + + auto operator=(AboutDialog const & other) noexcept -> AboutDialog & = delete; + auto operator=(AboutDialog && other) noexcept -> AboutDialog & = default; + +#pragma mark - GObject Support + auto static get_type() -> GType; + auto static get_base_type() -> GType; + +#pragma mark - Functions + auto add_acknowledgement_section(Glib::ustring const & name, std::vector const & people) -> void; + auto add_credit_section(Glib::ustring const & name, std::vector const & people) -> void; + auto + add_legal_section(Glib::ustring const & title, Glib::ustring const & copyright, Gtk::License license_type, Glib::ustring const & license) + -> void; + auto add_link(Glib::ustring const & title, Glib::ustring const & url) -> void; + auto add_other_app(Glib::ustring const & id, Glib::ustring const & name, Glib::ustring const & summary) -> void; + +#pragma mark - Getters + [[nodiscard]] auto get_application_icon() const -> Glib::ustring; + [[nodiscard]] auto get_application_name() const -> Glib::ustring; + [[nodiscard]] auto get_artists() const -> std::vector; + [[nodiscard]] auto get_comments() const -> Glib::ustring; + [[nodiscard]] auto get_copyright() const -> Glib::ustring; + [[nodiscard]] auto get_debug_info() const -> Glib::ustring; + [[nodiscard]] auto get_debug_info_filename() const -> Glib::ustring; + [[nodiscard]] auto get_designers() const -> std::vector; + [[nodiscard]] auto get_developer_name() const -> Glib::ustring; + [[nodiscard]] auto get_developers() const -> std::vector; + [[nodiscard]] auto get_documenters() const -> std::vector; + [[nodiscard]] auto get_issue_url() const -> Glib::ustring; + [[nodiscard]] auto get_license() const -> Glib::ustring; + [[nodiscard]] auto get_license_type() const -> Gtk::License; + [[nodiscard]] auto get_release_notes() const -> Glib::ustring; + [[nodiscard]] auto get_release_notes_version() const -> Glib::ustring; + [[nodiscard]] auto get_support_url() const -> Glib::ustring; + [[nodiscard]] auto get_translator_credits() const -> Glib::ustring; + [[nodiscard]] auto get_version() const -> Glib::ustring; + [[nodiscard]] auto get_website() const -> Glib::ustring; + +#pragma mark - Setters + auto set_application_icon(Glib::ustring const & value) -> void; + auto set_application_name(Glib::ustring const & value) -> void; + auto set_artists(std::vector const & value) -> void; + auto set_comments(Glib::ustring const & value) -> void; + auto set_copyright(Glib::ustring const & value) -> void; + auto set_debug_info(Glib::ustring const & value) -> void; + auto set_debug_info_filename(Glib::ustring const & value) -> void; + auto set_designers(std::vector const & value) -> void; + auto set_developer_name(Glib::ustring const & value) -> void; + auto set_developers(std::vector const & value) -> void; + auto set_documenters(std::vector const & value) -> void; + auto set_issue_url(Glib::ustring const & value) -> void; + auto set_license(Glib::ustring const & value) -> void; + auto set_license_type(Gtk::License const & value) -> void; + auto set_release_notes(Glib::ustring const & value) -> void; + auto set_release_notes_version(Glib::ustring const & value) -> void; + auto set_support_url(Glib::ustring const & value) -> void; + auto set_translator_credits(Glib::ustring const & value) -> void; + auto set_version(Glib::ustring const & value) -> void; + auto set_website(Glib::ustring const & value) -> void; + +#pragma mark - Properties + auto property_application_icon() -> Glib::PropertyProxy; + auto property_application_icon() const -> Glib::PropertyProxy_ReadOnly; + auto property_application_name() -> Glib::PropertyProxy; + auto property_application_name() const -> Glib::PropertyProxy_ReadOnly; + auto property_artists() -> Glib::PropertyProxy>; + auto property_artists() const -> Glib::PropertyProxy_ReadOnly>; + auto property_comments() -> Glib::PropertyProxy; + auto property_comments() const -> Glib::PropertyProxy_ReadOnly; + auto property_copyright() -> Glib::PropertyProxy; + auto property_copyright() const -> Glib::PropertyProxy_ReadOnly; + auto property_debug_info() -> Glib::PropertyProxy; + auto property_debug_info() const -> Glib::PropertyProxy_ReadOnly; + auto property_debug_info_filename() -> Glib::PropertyProxy; + auto property_debug_info_filename() const -> Glib::PropertyProxy_ReadOnly; + auto property_designers() -> Glib::PropertyProxy>; + auto property_designers() const -> Glib::PropertyProxy_ReadOnly>; + auto property_developer_name() -> Glib::PropertyProxy; + auto property_developer_name() const -> Glib::PropertyProxy_ReadOnly; + auto property_developers() -> Glib::PropertyProxy>; + auto property_developers() const -> Glib::PropertyProxy_ReadOnly>; + auto property_documenters() -> Glib::PropertyProxy>; + auto property_documenters() const -> Glib::PropertyProxy_ReadOnly>; + auto property_issue_url() -> Glib::PropertyProxy; + auto property_issue_url() const -> Glib::PropertyProxy_ReadOnly; + auto property_license_type() -> Glib::PropertyProxy; + auto property_license_type() const -> Glib::PropertyProxy_ReadOnly; + auto property_license() -> Glib::PropertyProxy; + auto property_license() const -> Glib::PropertyProxy_ReadOnly; + auto property_release_notes() -> Glib::PropertyProxy; + auto property_release_notes() const -> Glib::PropertyProxy_ReadOnly; + auto property_release_notes_version() -> Glib::PropertyProxy; + auto property_release_notes_version() const -> Glib::PropertyProxy_ReadOnly; + auto property_support_url() -> Glib::PropertyProxy; + auto property_support_url() const -> Glib::PropertyProxy_ReadOnly; + auto property_translator_credits() -> Glib::PropertyProxy; + auto property_translator_credits() const -> Glib::PropertyProxy_ReadOnly; + auto property_version() -> Glib::PropertyProxy; + auto property_version() const -> Glib::PropertyProxy_ReadOnly; + auto property_website() -> Glib::PropertyProxy; + auto property_website() const -> Glib::PropertyProxy_ReadOnly; + +#pragma mark - Signals + auto signal_activate_link() -> Glib::SignalProxy; + + protected: + friend AboutDialog_Class; + +#pragma mark - Internal Constructors + explicit AboutDialog(Glib::ConstructParams const & params); + explicit AboutDialog(BaseObjectType * gobj); + }; +} // namespace Adwaita + +namespace Glib +{ + auto wrap(AdwAboutDialog * object, bool copy = false) -> Adwaita::AboutDialog *; +} // namespace Glib + +#endif \ No newline at end of file diff --git a/adw/include/adwaitamm/private/aboutdialog_p.hpp b/adw/include/adwaitamm/private/aboutdialog_p.hpp new file mode 100644 index 0000000..754b631 --- /dev/null +++ b/adw/include/adwaitamm/private/aboutdialog_p.hpp @@ -0,0 +1,35 @@ +/** + * @author Felix Morgner (felix.morgner@gmail.com) + * @copyright Copyright (c) 2025 + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + + #ifndef LIBADWAITAMM_PRIVATE_ABOUT_DIALOG_P_HPP + #define LIBADWAITAMM_PRIVATE_ABOUT_DIALOG_P_HPP + + #include "adwaitamm/private/dialog_p.hpp" + + #include + #include + + #define _ADWAITA_INSIDE + #include + #undef _ADWAITA_INSIDE + + namespace Adwaita + { + struct AboutDialog_Class : Glib::Class + { + using BaseClassParent = AdwDialogClass; + using BaseClassType = AdwAboutDialogClass; + using BaseObjectType = AdwAboutDialog; + using CppClassParent = Dialog_Class; + using CppObjectType = struct AboutDialog; + + auto init() -> Glib::Class const &; + auto static class_init_function(void * gclass, void * data) -> void; + auto static wrap_new(GObject * object) -> Glib::ObjectBase *; + }; + } // namespace Adwaita + + #endif \ No newline at end of file diff --git a/adw/src/aboutdialog.cpp b/adw/src/aboutdialog.cpp new file mode 100644 index 0000000..a30758a --- /dev/null +++ b/adw/src/aboutdialog.cpp @@ -0,0 +1,607 @@ +/** + * @author Felix Morgner (felix.morgner@gmail.com) + * @copyright Copyright (c) 2025 + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "adwaitamm/aboutdialog.hpp" + +#include "adwaitamm/dialog.hpp" +#include "adwaitamm/private/aboutdialog_p.hpp" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include + +namespace Adwaita +{ + + namespace + { + auto constinit _class = AboutDialog_Class{}; ///< The static instance of this types class + + extern "C" auto AdwAboutDialog_signal_activate_link_connect_callback(AdwAboutDialog * self, char const * uri, void * user_data) -> gboolean + try + { + auto object = Glib::wrap(self); + if (object) + { + auto slot = Glib::SignalProxyNormal::data_to_slot(user_data); + if (slot) + { + return static_cast( + (*static_cast *>(slot))(Glib::convert_const_gchar_ptr_to_ustring(uri))); + } + } + return {}; + } + catch (...) + { + Glib::exception_handlers_invoke(); + return {}; + } + + extern "C" auto AdwAboutDialog_signal_activate_link_notify_callback(AdwAboutDialog * self, char const * uri, void * user_data) -> gboolean + try + { + auto object = Glib::wrap(self); + if (object) + { + auto slot = Glib::SignalProxyNormal::data_to_slot(user_data); + if (slot) + { + (*static_cast *>(slot))(Glib::convert_const_gchar_ptr_to_ustring(uri)); + } + } + return {}; + } + catch (...) + { + Glib::exception_handlers_invoke(); + return {}; + } + + namespace property_name + { + auto constexpr application_icon = "application-icon"; + auto constexpr application_name = "application-name"; + auto constexpr artists = "artists"; + auto constexpr comments = "comments"; + auto constexpr copyright = "copyright"; + auto constexpr debug_info = "debug-info"; + auto constexpr debug_info_filename = "debug-info-filename"; + auto constexpr designers = "designers"; + auto constexpr developer_name = "developer-name"; + auto constexpr developers = "developers"; + auto constexpr documenters = "documenters"; + auto constexpr issue_url = "issue-url"; + auto constexpr license_type = "license-type"; + auto constexpr license = "license"; + auto constexpr release_notes = "release-notes"; + auto constexpr release_notes_version = "release-notes-version"; + auto constexpr support_url = "support-url"; + auto constexpr translator_credits = "translator-credits"; + auto constexpr version = "version"; + auto constexpr website = "website"; + } // namespace property_name + + namespace signal_info + { + static const Glib::SignalProxyInfo activate_link = {"activate_link", + (GCallback)&AdwAboutDialog_signal_activate_link_connect_callback, + (GCallback)&AdwAboutDialog_signal_activate_link_notify_callback}; + } // namespace signal_info + + } // namespace + + AboutDialog::AboutDialog() + : Glib::ObjectBase{nullptr} + , Dialog{Glib::ConstructParams{_class.init()}} + { + } + + AboutDialog::AboutDialog(std::string resource_path, std::string release_notes_version) + : Glib::ObjectBase{nullptr} + , Dialog{adw_about_dialog_new_from_appdata(resource_path.c_str(), Glib::c_str_or_nullptr(release_notes_version))} + { + } + + auto AboutDialog::get_type() -> GType + { + return _class.init().get_type(); + } + + auto AboutDialog::get_base_type() -> GType + { + return adw_about_dialog_get_type(); + } + + auto AboutDialog::add_acknowledgement_section(Glib::ustring const & name, std::vector const & people) -> void + { + return adw_about_dialog_add_acknowledgement_section(unwrap(this), + Glib::c_str_or_nullptr(name), + Glib::ArrayHandler::vector_to_array(people).data()); + } + + auto AboutDialog::add_credit_section(Glib::ustring const & name, std::vector const & people) -> void + { + + return adw_about_dialog_add_credit_section(unwrap(this), + Glib::c_str_or_nullptr(name), + Glib::ArrayHandler::vector_to_array(people).data()); + } + + auto AboutDialog::add_legal_section(Glib::ustring const & title, + Glib::ustring const & copyright, + Gtk::License license_type, + Glib::ustring const & license) -> void + { + return adw_about_dialog_add_legal_section(Glib::unwrap(this), + title.c_str(), + c_str_or_nullptr(copyright), + static_cast(license_type), + c_str_or_nullptr(license)); + } + + auto AboutDialog::add_link(Glib::ustring const & title, Glib::ustring const & url) -> void + { + return adw_about_dialog_add_link(unwrap(this), title.c_str(), url.c_str()); + } + + auto AboutDialog::add_other_app(Glib::ustring const & id, Glib::ustring const & name, Glib::ustring const & summary) -> void + { + return adw_about_dialog_add_other_app(unwrap(this), id.c_str(), name.c_str(), summary.c_str()); + } + + auto AboutDialog::get_application_icon() const -> Glib::ustring + { + return adw_about_dialog_get_application_icon(const_cast(unwrap(this))); + } + + auto AboutDialog::get_application_name() const -> Glib::ustring + { + return adw_about_dialog_get_application_name(const_cast(unwrap(this))); + } + + auto AboutDialog::get_artists() const -> std::vector + { + return Glib::ArrayHandler::array_to_vector(adw_about_dialog_get_artists(const_cast(unwrap(this))), + Glib::OWNERSHIP_NONE); + } + + auto AboutDialog::get_comments() const -> Glib::ustring + { + return adw_about_dialog_get_comments(const_cast(unwrap(this))); + } + + auto AboutDialog::get_copyright() const -> Glib::ustring + { + return adw_about_dialog_get_copyright(const_cast(unwrap(this))); + } + + auto AboutDialog::get_debug_info() const -> Glib::ustring + { + return adw_about_dialog_get_debug_info(const_cast(unwrap(this))); + } + + auto AboutDialog::get_debug_info_filename() const -> Glib::ustring + { + return adw_about_dialog_get_debug_info_filename(const_cast(unwrap(this))); + } + + auto AboutDialog::get_designers() const -> std::vector + { + return Glib::ArrayHandler::array_to_vector(adw_about_dialog_get_designers(const_cast(unwrap(this))), + Glib::OWNERSHIP_NONE); + } + + auto AboutDialog::get_developer_name() const -> Glib::ustring + { + return adw_about_dialog_get_developer_name(const_cast(unwrap(this))); + } + + auto AboutDialog::get_developers() const -> std::vector + { + return Glib::ArrayHandler::array_to_vector(adw_about_dialog_get_developers(const_cast(unwrap(this))), + Glib::OWNERSHIP_NONE); + } + + auto AboutDialog::get_documenters() const -> std::vector + { + return Glib::ArrayHandler::array_to_vector(adw_about_dialog_get_documenters(const_cast(unwrap(this))), + Glib::OWNERSHIP_NONE); + } + + auto AboutDialog::get_issue_url() const -> Glib::ustring + { + return adw_about_dialog_get_issue_url(const_cast(unwrap(this))); + } + + auto AboutDialog::get_license() const -> Glib::ustring + { + return adw_about_dialog_get_license(const_cast(unwrap(this))); + } + + auto AboutDialog::get_license_type() const -> Gtk::License + { + return static_cast(adw_about_dialog_get_license_type(const_cast(unwrap(this)))); + } + + auto AboutDialog::get_release_notes() const -> Glib::ustring + { + return adw_about_dialog_get_release_notes(const_cast(unwrap(this))); + } + + auto AboutDialog::get_release_notes_version() const -> Glib::ustring + { + return adw_about_dialog_get_release_notes_version(const_cast(unwrap(this))); + } + + auto AboutDialog::get_support_url() const -> Glib::ustring + { + return adw_about_dialog_get_support_url(const_cast(unwrap(this))); + } + + auto AboutDialog::get_translator_credits() const -> Glib::ustring + { + return adw_about_dialog_get_translator_credits(const_cast(unwrap(this))); + } + + auto AboutDialog::get_version() const -> Glib::ustring + { + return adw_about_dialog_get_version(const_cast(unwrap(this))); + } + + auto AboutDialog::get_website() const -> Glib::ustring + { + return adw_about_dialog_get_website(const_cast(unwrap(this))); + } + + auto AboutDialog::set_application_icon(Glib::ustring const & value) -> void + { + return adw_about_dialog_set_application_icon(unwrap(this), value.c_str()); + } + + auto AboutDialog::set_application_name(Glib::ustring const & value) -> void + { + return adw_about_dialog_set_application_name(unwrap(this), value.c_str()); + } + + auto AboutDialog::set_artists(std::vector const & value) -> void + { + return adw_about_dialog_set_artists(unwrap(this), Glib::ArrayHandler::vector_to_array(value).data()); + } + + auto AboutDialog::set_comments(Glib::ustring const & value) -> void + { + return adw_about_dialog_set_comments(unwrap(this), value.c_str()); + } + + auto AboutDialog::set_copyright(Glib::ustring const & value) -> void + { + return adw_about_dialog_set_copyright(unwrap(this), value.c_str()); + } + + auto AboutDialog::set_debug_info(Glib::ustring const & value) -> void + { + return adw_about_dialog_set_debug_info(unwrap(this), value.c_str()); + } + + auto AboutDialog::set_debug_info_filename(Glib::ustring const & value) -> void + { + return adw_about_dialog_set_debug_info_filename(unwrap(this), value.c_str()); + } + + auto AboutDialog::set_designers(std::vector const & value) -> void + { + return adw_about_dialog_set_designers(unwrap(this), Glib::ArrayHandler::vector_to_array(value).data()); + } + + auto AboutDialog::set_developer_name(Glib::ustring const & value) -> void + { + return adw_about_dialog_set_developer_name(unwrap(this), value.c_str()); + } + + auto AboutDialog::set_developers(std::vector const & value) -> void + { + return adw_about_dialog_set_developers(unwrap(this), Glib::ArrayHandler::vector_to_array(value).data()); + } + + auto AboutDialog::set_documenters(std::vector const & value) -> void + { + return adw_about_dialog_set_documenters(unwrap(this), Glib::ArrayHandler::vector_to_array(value).data()); + } + + auto AboutDialog::set_issue_url(Glib::ustring const & value) -> void + { + return adw_about_dialog_set_issue_url(unwrap(this), value.c_str()); + } + + auto AboutDialog::set_license(Glib::ustring const & value) -> void + { + return adw_about_dialog_set_license(unwrap(this), value.c_str()); + } + + auto AboutDialog::set_license_type(Gtk::License const & value) -> void + { + return adw_about_dialog_set_license_type(unwrap(this), static_cast(value)); + } + + auto AboutDialog::set_release_notes(Glib::ustring const & value) -> void + { + return adw_about_dialog_set_release_notes(unwrap(this), value.c_str()); + } + + auto AboutDialog::set_release_notes_version(Glib::ustring const & value) -> void + { + return adw_about_dialog_set_release_notes_version(unwrap(this), value.c_str()); + } + + auto AboutDialog::set_support_url(Glib::ustring const & value) -> void + { + return adw_about_dialog_set_support_url(unwrap(this), value.c_str()); + } + + auto AboutDialog::set_translator_credits(Glib::ustring const & value) -> void + { + return adw_about_dialog_set_translator_credits(unwrap(this), value.c_str()); + } + + auto AboutDialog::set_version(Glib::ustring const & value) -> void + { + return adw_about_dialog_set_version(unwrap(this), value.c_str()); + } + + auto AboutDialog::set_website(Glib::ustring const & value) -> void + { + return adw_about_dialog_set_website(unwrap(this), value.c_str()); + } + + auto AboutDialog::property_application_icon() -> Glib::PropertyProxy + { + return Glib::PropertyProxy{this, property_name::application_icon}; + } + + auto AboutDialog::property_application_icon() const -> Glib::PropertyProxy_ReadOnly + { + return Glib::PropertyProxy_ReadOnly{this, property_name::application_icon}; + } + + auto AboutDialog::property_application_name() -> Glib::PropertyProxy + { + return Glib::PropertyProxy{this, property_name::application_name}; + } + + auto AboutDialog::property_application_name() const -> Glib::PropertyProxy_ReadOnly + { + return Glib::PropertyProxy_ReadOnly{this, property_name::application_name}; + } + + auto AboutDialog::property_artists() -> Glib::PropertyProxy> + { + return Glib::PropertyProxy>{this, property_name::artists}; + } + + auto AboutDialog::property_artists() const -> Glib::PropertyProxy_ReadOnly> + { + return Glib::PropertyProxy_ReadOnly>{this, property_name::artists}; + } + + auto AboutDialog::property_comments() -> Glib::PropertyProxy + { + return Glib::PropertyProxy{this, property_name::comments}; + } + + auto AboutDialog::property_comments() const -> Glib::PropertyProxy_ReadOnly + { + return Glib::PropertyProxy_ReadOnly{this, property_name::comments}; + } + + auto AboutDialog::property_copyright() -> Glib::PropertyProxy + { + return Glib::PropertyProxy{this, property_name::copyright}; + } + + auto AboutDialog::property_copyright() const -> Glib::PropertyProxy_ReadOnly + { + return Glib::PropertyProxy_ReadOnly{this, property_name::copyright}; + } + + auto AboutDialog::property_debug_info() -> Glib::PropertyProxy + { + return Glib::PropertyProxy{this, property_name::debug_info}; + } + + auto AboutDialog::property_debug_info() const -> Glib::PropertyProxy_ReadOnly + { + return Glib::PropertyProxy_ReadOnly{this, property_name::debug_info}; + } + + auto AboutDialog::property_debug_info_filename() -> Glib::PropertyProxy + { + return Glib::PropertyProxy{this, property_name::debug_info_filename}; + } + + auto AboutDialog::property_debug_info_filename() const -> Glib::PropertyProxy_ReadOnly + { + return Glib::PropertyProxy_ReadOnly{this, property_name::debug_info_filename}; + } + + auto AboutDialog::property_designers() -> Glib::PropertyProxy> + { + return Glib::PropertyProxy>{this, property_name::designers}; + } + + auto AboutDialog::property_designers() const -> Glib::PropertyProxy_ReadOnly> + { + return Glib::PropertyProxy_ReadOnly>{this, property_name::designers}; + } + + auto AboutDialog::property_developer_name() -> Glib::PropertyProxy + { + return Glib::PropertyProxy{this, property_name::developer_name}; + } + + auto AboutDialog::property_developer_name() const -> Glib::PropertyProxy_ReadOnly + { + return Glib::PropertyProxy_ReadOnly{this, property_name::developer_name}; + } + + auto AboutDialog::property_developers() -> Glib::PropertyProxy> + { + return Glib::PropertyProxy>{this, property_name::developers}; + } + + auto AboutDialog::property_developers() const -> Glib::PropertyProxy_ReadOnly> + { + return Glib::PropertyProxy_ReadOnly>{this, property_name::developers}; + } + + auto AboutDialog::property_documenters() -> Glib::PropertyProxy> + { + return Glib::PropertyProxy>{this, property_name::documenters}; + } + + auto AboutDialog::property_documenters() const -> Glib::PropertyProxy_ReadOnly> + { + return Glib::PropertyProxy_ReadOnly>{this, property_name::documenters}; + } + + auto AboutDialog::property_issue_url() -> Glib::PropertyProxy + { + return Glib::PropertyProxy{this, property_name::issue_url}; + } + + auto AboutDialog::property_issue_url() const -> Glib::PropertyProxy_ReadOnly + { + return Glib::PropertyProxy_ReadOnly{this, property_name::issue_url}; + } + + auto AboutDialog::property_license_type() -> Glib::PropertyProxy + { + return Glib::PropertyProxy{this, property_name::license_type}; + } + + auto AboutDialog::property_license_type() const -> Glib::PropertyProxy_ReadOnly + { + return Glib::PropertyProxy_ReadOnly{this, property_name::license_type}; + } + + auto AboutDialog::property_license() -> Glib::PropertyProxy + { + return Glib::PropertyProxy{this, property_name::license}; + } + + auto AboutDialog::property_license() const -> Glib::PropertyProxy_ReadOnly + { + return Glib::PropertyProxy_ReadOnly{this, property_name::license}; + } + + auto AboutDialog::property_release_notes() -> Glib::PropertyProxy + { + return Glib::PropertyProxy{this, property_name::release_notes}; + } + + auto AboutDialog::property_release_notes() const -> Glib::PropertyProxy_ReadOnly + { + return Glib::PropertyProxy_ReadOnly{this, property_name::release_notes}; + } + + auto AboutDialog::property_release_notes_version() -> Glib::PropertyProxy + { + return Glib::PropertyProxy{this, property_name::release_notes_version}; + } + + auto AboutDialog::property_release_notes_version() const -> Glib::PropertyProxy_ReadOnly + { + return Glib::PropertyProxy_ReadOnly{this, property_name::release_notes_version}; + } + + auto AboutDialog::property_support_url() -> Glib::PropertyProxy + { + return Glib::PropertyProxy{this, property_name::support_url}; + } + + auto AboutDialog::property_support_url() const -> Glib::PropertyProxy_ReadOnly + { + return Glib::PropertyProxy_ReadOnly{this, property_name::support_url}; + } + + auto AboutDialog::property_translator_credits() -> Glib::PropertyProxy + { + return Glib::PropertyProxy{this, property_name::translator_credits}; + } + + auto AboutDialog::property_translator_credits() const -> Glib::PropertyProxy_ReadOnly + { + return Glib::PropertyProxy_ReadOnly{this, property_name::translator_credits}; + } + + auto AboutDialog::property_version() -> Glib::PropertyProxy + { + return Glib::PropertyProxy{this, property_name::version}; + } + + auto AboutDialog::property_version() const -> Glib::PropertyProxy_ReadOnly + { + return Glib::PropertyProxy_ReadOnly{this, property_name::version}; + } + + auto AboutDialog::property_website() -> Glib::PropertyProxy + { + return Glib::PropertyProxy{this, property_name::website}; + } + + auto AboutDialog::property_website() const -> Glib::PropertyProxy_ReadOnly + { + return Glib::PropertyProxy_ReadOnly{this, property_name::website}; + } + + auto AboutDialog::signal_activate_link() -> Glib::SignalProxy + { + return Glib::SignalProxy{this, &signal_info::activate_link}; + } + + AboutDialog::AboutDialog(Glib::ConstructParams const & params) + : Dialog{params} + { + } + + AboutDialog::AboutDialog(BaseObjectType * gobj) + : Dialog(ADW_DIALOG(gobj)) + { + } + +} // namespace Adwaita + +namespace Glib +{ + auto wrap(AdwAboutDialog * object, bool copy) -> Adwaita::AboutDialog * + { + return dynamic_cast(Glib::wrap_auto(G_OBJECT(object), copy)); + } +} // namespace Glib \ No newline at end of file diff --git a/adw/src/private/aboutdialog_p.cpp b/adw/src/private/aboutdialog_p.cpp new file mode 100644 index 0000000..ac923a8 --- /dev/null +++ b/adw/src/private/aboutdialog_p.cpp @@ -0,0 +1,40 @@ +/** + * @author Felix Morgner (felix.morgner@gmail.com) + * @copyright Copyright (c) 2025 + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "adwaitamm/private/aboutdialog_p.hpp" + +#include "adwaitamm/aboutdialog.hpp" + +#include +#include + +#include + +#include + +namespace Adwaita +{ + auto AboutDialog_Class::init() -> Glib::Class const & + { + if (!gtype_) + { + class_init_func_ = &class_init_function; + gtype_ = adw_about_dialog_get_type(); + } + return *this; + } + + auto AboutDialog_Class::class_init_function(void * gclass, void * data) -> void + { + auto const klass = static_cast(gclass); + CppClassParent::class_init_function(klass, data); + } + + auto AboutDialog_Class::wrap_new(GObject * object) -> Glib::ObjectBase * + { + return Gtk::manage(new AboutDialog(ADW_ABOUT_DIALOG(object))); + } +} // namespace Adwaita \ No newline at end of file diff --git a/adw/src/wrap_init.cpp b/adw/src/wrap_init.cpp index 9a9d372..4f6cd25 100644 --- a/adw/src/wrap_init.cpp +++ b/adw/src/wrap_init.cpp @@ -6,6 +6,7 @@ #include "adwaitamm/wrap_init.hpp" +#include "adwaitamm/aboutdialog.hpp" #include "adwaitamm/actionrow.hpp" #include "adwaitamm/alertdialog.hpp" #include "adwaitamm/application.hpp" @@ -15,6 +16,7 @@ #include "adwaitamm/preferencesdialog.hpp" #include "adwaitamm/preferencespage.hpp" #include "adwaitamm/preferencesrow.hpp" +#include "adwaitamm/private/aboutdialog_p.hpp" // IWYU pragma: keep - required for gobj class definition. #include "adwaitamm/private/actionrow_p.hpp" // IWYU pragma: keep - required for gobj class definition. #include "adwaitamm/private/alertdialog_p.hpp" // IWYU pragma: keep - required for gobj class definition. #include "adwaitamm/private/application_p.hpp" // IWYU pragma: keep - required for gobj class definition. @@ -45,6 +47,7 @@ namespace Adwaita { auto wrap_init() -> void { + WRAP_CLASS(AboutDialog, about_dialog); WRAP_CLASS(ActionRow, action_row); WRAP_CLASS(AlertDialog, alert_dialog); WRAP_CLASS(Application, application); @@ -59,6 +62,7 @@ namespace Adwaita WRAP_CLASS(Toast, toast); WRAP_CLASS(ToastOverlay, toast_overlay); + ENSURE_TYPE(AboutDialog); ENSURE_TYPE(ActionRow); ENSURE_TYPE(AlertDialog); ENSURE_TYPE(Application); -- cgit v1.2.3