diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/adwaitamm/adwaitamm.hpp | 1 | ||||
| -rw-r--r-- | include/adwaitamm/enums.hpp | 8 | ||||
| -rw-r--r-- | include/adwaitamm/private/toolbarview_p.hpp | 35 | ||||
| -rw-r--r-- | include/adwaitamm/private/windowtitle_p.hpp | 4 | ||||
| -rw-r--r-- | include/adwaitamm/toolbarview.hpp | 100 |
5 files changed, 144 insertions, 4 deletions
diff --git a/include/adwaitamm/adwaitamm.hpp b/include/adwaitamm/adwaitamm.hpp index 9dd0adb..1bee898 100644 --- a/include/adwaitamm/adwaitamm.hpp +++ b/include/adwaitamm/adwaitamm.hpp @@ -19,6 +19,7 @@ #include <adwaitamm/switchrow.hpp> // IWYU pragma: export #include <adwaitamm/toast.hpp> // IWYU pragma: export #include <adwaitamm/toastoverlay.hpp> // IWYU pragma: export +#include <adwaitamm/toolbarview.hpp> // IWYU pragma: export #include <adwaitamm/windowtitle.hpp> // IWYU pragma: export #include <adwaitamm/wrap_init.hpp> // IWYU pragma: export diff --git a/include/adwaitamm/enums.hpp b/include/adwaitamm/enums.hpp index 0d09833..159b20d 100644 --- a/include/adwaitamm/enums.hpp +++ b/include/adwaitamm/enums.hpp @@ -69,6 +69,13 @@ namespace Adwaita High, }; + enum class ToolbarStyle + { + Flat, + Raised, + RaisedBorder, + }; + } // namespace Adwaita namespace Glib @@ -89,6 +96,7 @@ namespace Glib VALUE_SPECIALIZATION(RatioType); VALUE_SPECIALIZATION(ResponseAppearance); VALUE_SPECIALIZATION(ToastPriority); + VALUE_SPECIALIZATION(ToolbarStyle); #undef VALUE_SPECIALIZATION diff --git a/include/adwaitamm/private/toolbarview_p.hpp b/include/adwaitamm/private/toolbarview_p.hpp new file mode 100644 index 0000000..cafc474 --- /dev/null +++ b/include/adwaitamm/private/toolbarview_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_TOOLBAR_VIEW_P_HPP +#define LIBADWAITAMM_PRIVATE_TOOLBAR_VIEW_P_HPP + +#include <glibmm/class.h> +#include <glibmm/objectbase.h> + +#include <gtkmm/widget.h> + +#define _ADWAITA_INSIDE +#include <adw-toolbar-view.h> +#undef _ADWAITA_INSIDE + +namespace Adwaita +{ + struct ToolbarView_Class : Glib::Class + { + using BaseClassParent = GtkWidgetClass; + using BaseClassType = AdwToolbarViewClass; + using BaseObjectType = AdwToolbarView; + using CppClassParent = Gtk::Widget_Class; + using CppObjectType = struct ToolbarView; + + 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/include/adwaitamm/private/windowtitle_p.hpp b/include/adwaitamm/private/windowtitle_p.hpp index 460505a..2728d8a 100644 --- a/include/adwaitamm/private/windowtitle_p.hpp +++ b/include/adwaitamm/private/windowtitle_p.hpp @@ -29,10 +29,6 @@ namespace Adwaita auto init() -> Glib::Class const &; auto static class_init_function(void * gclass, void * data) -> void; auto static wrap_new(GObject * object) -> Glib::ObjectBase *; - - protected: - auto static close_attempt(BaseObjectType * self) -> void; - auto static closed(BaseObjectType * self) -> void; }; } // namespace Adwaita diff --git a/include/adwaitamm/toolbarview.hpp b/include/adwaitamm/toolbarview.hpp new file mode 100644 index 0000000..d64ee44 --- /dev/null +++ b/include/adwaitamm/toolbarview.hpp @@ -0,0 +1,100 @@ +/** + * @author Felix Morgner (felix.morgner@gmail.com) + * @copyright Copyright (c) 2025 + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef LIBADWAITAMM_TOOLBAR_VIEW_HPP +#define LIBADWAITAMM_TOOLBAR_VIEW_HPP + +#include "adwaitamm/enums.hpp" +#include "helpers/gobj_mixin.hpp" + +#include <glibmm/object.h> +#include <glibmm/propertyproxy.h> + +#include <gtkmm/widget.h> + +#include <glib-object.h> + +#define _ADWAITA_INSIDE +#include <adw-toolbar-view.h> +#undef _ADWAITA_INSIDE + +namespace Adwaita +{ + struct ToolbarView final : Gtk::Widget, + helpers::gobj_mixin<ToolbarView, AdwToolbarView> + { + + using BaseObjectType = AdwToolbarView; + using BaseClassType = AdwToolbarViewClass; + using CppObjectType = ToolbarView; + using CppClassType = struct ToolbarView_Class; + + using helpers::gobj_mixin<CppObjectType, BaseObjectType>::gobj; + using helpers::gobj_mixin<CppObjectType, BaseObjectType>::gobj_copy; + + ToolbarView(); + ToolbarView(ToolbarView const & other) = delete; + ToolbarView(ToolbarView && other) noexcept = default; + + auto operator=(ToolbarView const & other) noexcept -> ToolbarView & = delete; + auto operator=(ToolbarView && other) noexcept -> ToolbarView & = default; + + auto static get_type() -> GType; + auto static get_base_type() -> GType; + + auto add_bottom_bar(Gtk::Widget & widget) -> void; + auto add_top_bar(Gtk::Widget & widget) -> void; + auto remove(Gtk::Widget & widget) -> void; + + [[nodiscard]] auto get_bottom_bar_height() const -> int; + [[nodiscard]] auto get_bottom_bar_style() const -> ToolbarStyle; + [[nodiscard]] auto get_content() const -> Gtk::Widget *; + [[nodiscard]] auto get_extend_content_to_bottom_edge() const -> bool; + [[nodiscard]] auto get_extend_content_to_top_edge() const -> bool; + [[nodiscard]] auto get_reveal_bottom_bars() const -> bool; + [[nodiscard]] auto get_reveal_top_bars() const -> bool; + [[nodiscard]] auto get_top_bar_height() const -> int; + [[nodiscard]] auto get_top_bar_style() const -> ToolbarStyle; + + auto set_bottom_bar_style(ToolbarStyle value) -> void; + auto set_content(Gtk::Widget & value) -> void; + auto set_extend_content_to_bottom_edge(bool value) -> void; + auto set_extend_content_to_top_edge(bool value) -> void; + auto set_reveal_bottom_bars(bool value) -> void; + auto set_reveal_top_bars(bool value) -> void; + auto set_top_bar_style(ToolbarStyle value) -> void; + + [[nodiscard]] auto property_bottom_bar_height() const -> Glib::PropertyProxy_ReadOnly<int>; + [[nodiscard]] auto property_bottom_bar_style() -> Glib::PropertyProxy<ToolbarStyle>; + [[nodiscard]] auto property_bottom_bar_style() const -> Glib::PropertyProxy_ReadOnly<ToolbarStyle>; + [[nodiscard]] auto property_content() -> Glib::PropertyProxy<Gtk::Widget *>; + [[nodiscard]] auto property_content() const -> Glib::PropertyProxy_ReadOnly<Gtk::Widget *>; + [[nodiscard]] auto property_extend_content_to_bottom_edge() -> Glib::PropertyProxy<bool>; + [[nodiscard]] auto property_extend_content_to_bottom_edge() const -> Glib::PropertyProxy_ReadOnly<bool>; + [[nodiscard]] auto property_extend_content_to_top_edge() -> Glib::PropertyProxy<bool>; + [[nodiscard]] auto property_extend_content_to_top_edge() const -> Glib::PropertyProxy_ReadOnly<bool>; + [[nodiscard]] auto property_reveal_bottom_bars() -> Glib::PropertyProxy<bool>; + [[nodiscard]] auto property_reveal_bottom_bars() const -> Glib::PropertyProxy_ReadOnly<bool>; + [[nodiscard]] auto property_reveal_top_bars() -> Glib::PropertyProxy<bool>; + [[nodiscard]] auto property_reveal_top_bars() const -> Glib::PropertyProxy_ReadOnly<bool>; + [[nodiscard]] auto property_top_bar_height() const -> Glib::PropertyProxy_ReadOnly<int>; + [[nodiscard]] auto property_top_bar_style() -> Glib::PropertyProxy<ToolbarStyle>; + [[nodiscard]] auto property_top_bar_style() const -> Glib::PropertyProxy_ReadOnly<ToolbarStyle>; + + protected: + friend ToolbarView_Class; + + explicit ToolbarView(Glib::ConstructParams const & params); + explicit ToolbarView(BaseObjectType * gobj); + }; +} // namespace Adwaita + +namespace Glib +{ + auto wrap(AdwToolbarView * object, bool copy = false) -> Adwaita::ToolbarView *; +} // namespace Glib + +#endif
\ No newline at end of file |
