diff options
83 files changed, 7 insertions, 7095 deletions
diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..c151109 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "deps/libadwaitamm"] + path = deps/libadwaitamm + url = ../libadwaitamm.git diff --git a/CMakeLists.txt b/CMakeLists.txt index ba4b133..39423a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,8 +32,8 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin") -set(GLIB_MINIMUM_VERSION "2.80") -set(GTK4_MINIMUM_VERSION "4.14") +set(GLIB_MINIMUM_VERSION "2.84") +set(GTK4_MINIMUM_VERSION "4.16") # Build options @@ -68,11 +68,12 @@ pkg_check_modules("giomm" IMPORTED_TARGET REQUIRED "giomm-2.68>=${GLIB_MINIMUM_V pkg_check_modules("glibmm" IMPORTED_TARGET REQUIRED "glibmm-2.68>=${GLIB_MINIMUM_VERSION}") pkg_check_modules("gtkmm" IMPORTED_TARGET REQUIRED "gtkmm-4.0>=${GTK4_MINIMUM_VERSION}") +add_subdirectory("deps/libadwaitamm" EXCLUDE_FROM_ALL SYSTEM) + include("Catch") # Targets -add_subdirectory("adw") add_subdirectory("app") add_subdirectory("core") add_subdirectory("lang") diff --git a/adw/CMakeLists.txt b/adw/CMakeLists.txt deleted file mode 100644 index 6b08199..0000000 --- a/adw/CMakeLists.txt +++ /dev/null @@ -1,65 +0,0 @@ -cmake_minimum_required(VERSION "3.30.0") - -project("adwaitamm" - LANGUAGES CXX - VERSION "1.7.0" - DESCRIPTION "C++ wrapper for libadwaita" -) - -include("GNUInstallDirs") - -find_package("PkgConfig" REQUIRED) - -pkg_check_modules("adwaita" IMPORTED_TARGET REQUIRED "libadwaita-1>=1.7.0") -pkg_check_modules("giomm" IMPORTED_TARGET REQUIRED "giomm-2.68>=2.80") -pkg_check_modules("glibmm" IMPORTED_TARGET REQUIRED "glibmm-2.68>=2.80") - -add_library("adwaitamm") - -file(GLOB_RECURSE ADWAITAMM_SOURCES RELATIVE "${PROJECT_SOURCE_DIR}" CONFIGURE_DEPENDS "src/**.cpp") - -target_sources("adwaitamm" PRIVATE - ${ADWAITAMM_SOURCES} -) - -file(GLOB_RECURSE ADWAITAMM_HEADERS RELATIVE "${PROJECT_SOURCE_DIR}" CONFIGURE_DEPENDS "include/**/*.hpp") - -target_sources("adwaitamm" PUBLIC - FILE_SET HEADERS - FILES ${ADWAITAMM_HEADERS} - BASE_DIRS "include" -) - -target_include_directories("adwaitamm" SYSTEM PUBLIC - "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>" - "$<INSTALL_INTERFACE:include>" -) - -target_compile_features("adwaitamm" PUBLIC - "cxx_std_20" -) - -target_compile_options("adwaitamm" PRIVATE - "$<$<CXX_COMPILER_ID:GNU,Clang>:-Wall>" - "$<$<CXX_COMPILER_ID:GNU,Clang>:-Wextra>" - "$<$<CXX_COMPILER_ID:GNU,Clang>:-Werror>" - "$<$<CXX_COMPILER_ID:GNU,Clang>:-pedantic-errors>" -) - -target_link_libraries("adwaitamm" PUBLIC - "PkgConfig::adwaita" - "PkgConfig::gtkmm" -) - -set_target_properties("adwaitamm" PROPERTIES - CXX_EXTENSIONS NO - CXX_STANDARD_REQUIRED YES -) - -add_library("adwaitamm::adwaitamm" ALIAS "adwaitamm") - -install(TARGETS "adwaitamm" - FILE_SET HEADERS - ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" -)
\ No newline at end of file diff --git a/adw/include/adwaitamm/aboutdialog.hpp b/adw/include/adwaitamm/aboutdialog.hpp deleted file mode 100644 index 86f6751..0000000 --- a/adw/include/adwaitamm/aboutdialog.hpp +++ /dev/null @@ -1,170 +0,0 @@ -/** - * @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 <glibmm/object.h> -#include <glibmm/propertyproxy.h> -#include <glibmm/refptr.h> -#include <glibmm/signalproxy.h> -#include <glibmm/ustring.h> - -#include <gtkmm/aboutdialog.h> - -#include <glib-object.h> - -#include <string> -#include <vector> - -#define _ADWAITA_INSIDE -#include <adw-about-dialog.h> -#undef _ADWAITA_INSIDE - -namespace Adwaita -{ - enum struct ResponseAppearance; - - struct AboutDialog final : Dialog, - helpers::gobj_mixin<AboutDialog, AdwAboutDialog> - { - using BaseObjectType = AdwAboutDialog; - using BaseClassType = AdwAboutDialogClass; - using CppObjectType = AboutDialog; - using CppClassType = struct AboutDialog_Class; - - using helpers::gobj_mixin<CppObjectType, BaseObjectType>::gobj; - using helpers::gobj_mixin<CppObjectType, BaseObjectType>::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<Glib::ustring> const & people) -> void; - auto add_credit_section(Glib::ustring const & name, std::vector<Glib::ustring> 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<Glib::ustring>; - [[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<Glib::ustring>; - [[nodiscard]] auto get_developer_name() const -> Glib::ustring; - [[nodiscard]] auto get_developers() const -> std::vector<Glib::ustring>; - [[nodiscard]] auto get_documenters() const -> std::vector<Glib::ustring>; - [[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<Glib::ustring> 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<Glib::ustring> const & value) -> void; - auto set_developer_name(Glib::ustring const & value) -> void; - auto set_developers(std::vector<Glib::ustring> const & value) -> void; - auto set_documenters(std::vector<Glib::ustring> 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<Glib::ustring>; - auto property_application_icon() const -> Glib::PropertyProxy_ReadOnly<Glib::ustring>; - auto property_application_name() -> Glib::PropertyProxy<Glib::ustring>; - auto property_application_name() const -> Glib::PropertyProxy_ReadOnly<Glib::ustring>; - auto property_artists() -> Glib::PropertyProxy<std::vector<Glib::ustring>>; - auto property_artists() const -> Glib::PropertyProxy_ReadOnly<std::vector<Glib::ustring>>; - auto property_comments() -> Glib::PropertyProxy<Glib::ustring>; - auto property_comments() const -> Glib::PropertyProxy_ReadOnly<Glib::ustring>; - auto property_copyright() -> Glib::PropertyProxy<Glib::ustring>; - auto property_copyright() const -> Glib::PropertyProxy_ReadOnly<Glib::ustring>; - auto property_debug_info() -> Glib::PropertyProxy<Glib::ustring>; - auto property_debug_info() const -> Glib::PropertyProxy_ReadOnly<Glib::ustring>; - auto property_debug_info_filename() -> Glib::PropertyProxy<Glib::ustring>; - auto property_debug_info_filename() const -> Glib::PropertyProxy_ReadOnly<Glib::ustring>; - auto property_designers() -> Glib::PropertyProxy<std::vector<Glib::ustring>>; - auto property_designers() const -> Glib::PropertyProxy_ReadOnly<std::vector<Glib::ustring>>; - auto property_developer_name() -> Glib::PropertyProxy<Glib::ustring>; - auto property_developer_name() const -> Glib::PropertyProxy_ReadOnly<Glib::ustring>; - auto property_developers() -> Glib::PropertyProxy<std::vector<Glib::ustring>>; - auto property_developers() const -> Glib::PropertyProxy_ReadOnly<std::vector<Glib::ustring>>; - auto property_documenters() -> Glib::PropertyProxy<std::vector<Glib::ustring>>; - auto property_documenters() const -> Glib::PropertyProxy_ReadOnly<std::vector<Glib::ustring>>; - auto property_issue_url() -> Glib::PropertyProxy<Glib::ustring>; - auto property_issue_url() const -> Glib::PropertyProxy_ReadOnly<Glib::ustring>; - auto property_license_type() -> Glib::PropertyProxy<Gtk::License>; - auto property_license_type() const -> Glib::PropertyProxy_ReadOnly<Gtk::License>; - auto property_license() -> Glib::PropertyProxy<Glib::ustring>; - auto property_license() const -> Glib::PropertyProxy_ReadOnly<Glib::ustring>; - auto property_release_notes() -> Glib::PropertyProxy<Glib::ustring>; - auto property_release_notes() const -> Glib::PropertyProxy_ReadOnly<Glib::ustring>; - auto property_release_notes_version() -> Glib::PropertyProxy<Glib::ustring>; - auto property_release_notes_version() const -> Glib::PropertyProxy_ReadOnly<Glib::ustring>; - auto property_support_url() -> Glib::PropertyProxy<Glib::ustring>; - auto property_support_url() const -> Glib::PropertyProxy_ReadOnly<Glib::ustring>; - auto property_translator_credits() -> Glib::PropertyProxy<Glib::ustring>; - auto property_translator_credits() const -> Glib::PropertyProxy_ReadOnly<Glib::ustring>; - auto property_version() -> Glib::PropertyProxy<Glib::ustring>; - auto property_version() const -> Glib::PropertyProxy_ReadOnly<Glib::ustring>; - auto property_website() -> Glib::PropertyProxy<Glib::ustring>; - auto property_website() const -> Glib::PropertyProxy_ReadOnly<Glib::ustring>; - -#pragma mark - Signals - auto signal_activate_link() -> Glib::SignalProxy<bool(Glib::ustring const &)>; - - 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/actionrow.hpp b/adw/include/adwaitamm/actionrow.hpp deleted file mode 100644 index 8b5db03..0000000 --- a/adw/include/adwaitamm/actionrow.hpp +++ /dev/null @@ -1,109 +0,0 @@ -/** - * @author Felix Morgner (felix.morgner@gmail.com) - * @copyright Copyright (c) 2025 - * SPDX-License-Identifier: LGPL-2.1-or-later - */ - -#ifndef LIBADWAITAMM_ACTION_ROW_HPP -#define LIBADWAITAMM_ACTION_ROW_HPP - -#include "adwaitamm/helpers/gobj_mixin.hpp" -#include "adwaitamm/preferencesrow.hpp" - -#include <glibmm/class.h> -#include <glibmm/object.h> -#include <glibmm/objectbase.h> -#include <glibmm/propertyproxy.h> -#include <glibmm/signalproxy.h> -#include <glibmm/ustring.h> - -#include <gtkmm/widget.h> - -#include <glib-object.h> -#include <glib.h> - -#define _ADWAITA_INSIDE -#include <adw-action-row.h> -#undef _ADWAITA_INSIDE - -namespace Adwaita -{ - struct ActionRow : PreferencesRow, - helpers::gobj_mixin<ActionRow, AdwActionRow> - { - using BaseObjectType = AdwActionRow; - using BaseClassType = AdwActionRowClass; - using CppObjectType = ActionRow; - using CppClassType = struct ActionRow_Class; - - using helpers::gobj_mixin<CppObjectType, BaseObjectType>::gobj; - using helpers::gobj_mixin<CppObjectType, BaseObjectType>::gobj_copy; - - explicit ActionRow(); - ActionRow(ActionRow const & other) = delete; - ActionRow(ActionRow && other) noexcept = default; - - auto operator=(ActionRow const & other) noexcept -> ActionRow & = delete; - auto operator=(ActionRow && other) noexcept -> ActionRow & = default; - - auto static get_type() -> GType; - auto static get_base_type() -> GType; - -#pragma mark - Functions - auto activate() -> void; - auto add_prefix(Gtk::Widget & widget) -> void; - auto add_suffix(Gtk::Widget & widget) -> void; - auto remove(Gtk::Widget & widget) -> void; - -#pragma mark - Getters - auto get_activatable_widget() const noexcept -> Gtk::Widget *; - [[deprecated("replaced by add_prefix")]] auto get |
