diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2025-04-28 09:58:10 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2025-04-28 10:00:26 +0200 |
| commit | 3fe6119b93141d74c9f34f69d2b3b6ae016c2abf (patch) | |
| tree | 383abae15bacfbf5f7c3a63fb8d5ab1c0cbec55c /adw/include/adwaitamm/windowtitle.hpp | |
| parent | 33d8a352eca90a530d560175f5406a5bde5e2861 (diff) | |
| download | turns-3fe6119b93141d74c9f34f69d2b3b6ae016c2abf.tar.xz turns-3fe6119b93141d74c9f34f69d2b3b6ae016c2abf.zip | |
adw: implement WindowTitle
Diffstat (limited to 'adw/include/adwaitamm/windowtitle.hpp')
| -rw-r--r-- | adw/include/adwaitamm/windowtitle.hpp | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/adw/include/adwaitamm/windowtitle.hpp b/adw/include/adwaitamm/windowtitle.hpp new file mode 100644 index 0000000..d142a95 --- /dev/null +++ b/adw/include/adwaitamm/windowtitle.hpp @@ -0,0 +1,78 @@ +/** + * @author Felix Morgner (felix.morgner@gmail.com) + * @copyright Copyright (c) 2025 + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef LIBADWAITAMM_WINDOW_TITLE_HPP +#define LIBADWAITAMM_WINDOW_TITLE_HPP + +#include "helpers/gobj_mixin.hpp" + +#include <glibmm/object.h> +#include <glibmm/propertyproxy.h> +#include <glibmm/ustring.h> + +#include <gtkmm/widget.h> + +#include <glib-object.h> + +#define _ADWAITA_INSIDE +#include <adw-window-title.h> +#undef _ADWAITA_INSIDE + +namespace Adwaita +{ + struct WindowTitle final : Gtk::Widget, + helpers::gobj_mixin<WindowTitle, AdwWindowTitle> + { + + using BaseObjectType = AdwWindowTitle; + using BaseClassType = AdwWindowTitleClass; + using CppObjectType = WindowTitle; + using CppClassType = struct WindowTitle_Class; + + using helpers::gobj_mixin<CppObjectType, BaseObjectType>::gobj; + using helpers::gobj_mixin<CppObjectType, BaseObjectType>::gobj_copy; + +#pragma mark - Special Member Functions + WindowTitle(Glib::ustring const & title, Glib::ustring const & subtitle); + WindowTitle(WindowTitle const & other) = delete; + WindowTitle(WindowTitle && other) noexcept = default; + + auto operator=(WindowTitle const & other) noexcept -> WindowTitle & = delete; + auto operator=(WindowTitle && other) noexcept -> WindowTitle & = default; + +#pragma mark - GObject Support + auto static get_type() -> GType; + auto static get_base_type() -> GType; + +#pragma mark - Getters + [[nodiscard]] auto get_subtitle() const -> Glib::ustring; + [[nodiscard]] auto get_title() const -> Glib::ustring; + +#pragma mark - Setters + auto set_subtitle(Glib::ustring const & value) -> void; + auto set_title(Glib::ustring const & value) -> void; + +#pragma mark - Properties + [[nodiscard]] auto property_subtitle() -> Glib::PropertyProxy<Glib::ustring>; + [[nodiscard]] auto property_subtitle() const -> Glib::PropertyProxy_ReadOnly<Glib::ustring>; + [[nodiscard]] auto property_title() -> Glib::PropertyProxy<Glib::ustring>; + [[nodiscard]] auto property_title() const -> Glib::PropertyProxy_ReadOnly<Glib::ustring>; + + protected: + friend WindowTitle_Class; + +#pragma mark - Internal Constructors + explicit WindowTitle(Glib::ConstructParams const & params); + explicit WindowTitle(BaseObjectType * gobj); + }; +} // namespace Adwaita + +namespace Glib +{ + auto wrap(AdwWindowTitle * object, bool copy = false) -> Adwaita::WindowTitle *; +} // namespace Glib + +#endif
\ No newline at end of file |
