aboutsummaryrefslogtreecommitdiff
path: root/src/toolbarview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/toolbarview.cpp')
-rw-r--r--src/toolbarview.cpp253
1 files changed, 253 insertions, 0 deletions
diff --git a/src/toolbarview.cpp b/src/toolbarview.cpp
new file mode 100644
index 0000000..b2a9de6
--- /dev/null
+++ b/src/toolbarview.cpp
@@ -0,0 +1,253 @@
+/**
+ * @author Felix Morgner (felix.morgner@gmail.com)
+ * @copyright Copyright (c) 2025
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "adwaitamm/toolbarview.hpp"
+
+#include "adwaitamm/enums.hpp"
+#include "adwaitamm/private/toolbarview_p.hpp"
+
+#include <glibmm/object.h>
+#include <glibmm/objectbase.h>
+#include <glibmm/propertyproxy.h>
+#include <glibmm/ustring.h>
+#include <glibmm/wrap.h>
+
+#include <gtkmm/widget.h>
+
+#include <glib-object.h>
+#include <gtk/gtk.h>
+
+namespace Adwaita
+{
+
+ namespace
+ {
+ auto constinit _class = ToolbarView_Class{};
+
+ namespace property_name
+ {
+ auto constexpr bottom_bar_height = "bottom-bar-height";
+ auto constexpr bottom_bar_style = "bottom-bar-style";
+ auto constexpr content = "content";
+ auto constexpr extend_content_to_bottom_edge = "extend-content-to-bottom-edge";
+ auto constexpr extend_content_to_top_edge = "extend-content-to-top-edge";
+ auto constexpr reveal_bottom_bars = "reveal-bottom-bars";
+ auto constexpr reveal_top_bars = "reveal-top-bars";
+ auto constexpr top_bar_height = "top-bar-height";
+ auto constexpr top_bar_style = "top-bar-style";
+ } // namespace property_name
+ } // namespace
+
+ ToolbarView::ToolbarView()
+ : Glib::ObjectBase{nullptr}
+ , Gtk::Widget{Glib::ConstructParams{_class.init()}}
+ {
+ }
+
+ auto ToolbarView::get_type() -> GType
+ {
+ return _class.init().get_type();
+ }
+
+ auto ToolbarView::get_base_type() -> GType
+ {
+ return adw_toolbar_view_get_type();
+ }
+
+ ToolbarView::ToolbarView(Glib::ConstructParams const & params)
+ : Gtk::Widget{params}
+ {
+ }
+
+ ToolbarView::ToolbarView(BaseObjectType * gobj)
+ : Gtk::Widget(GTK_WIDGET(gobj))
+ {
+ }
+
+ auto ToolbarView::add_bottom_bar(Gtk::Widget & widget) -> void
+ {
+ return adw_toolbar_view_add_bottom_bar(unwrap(this), unwrap(&widget));
+ }
+
+ auto ToolbarView::add_top_bar(Gtk::Widget & widget) -> void
+ {
+ return adw_toolbar_view_add_top_bar(unwrap(this), unwrap(&widget));
+ }
+
+ auto ToolbarView::remove(Gtk::Widget & widget) -> void
+ {
+ return adw_toolbar_view_remove(unwrap(this), unwrap(&widget));
+ }
+
+ auto ToolbarView::get_bottom_bar_height() const -> int
+ {
+ return adw_toolbar_view_get_bottom_bar_height(const_cast<BaseObjectType *>(unwrap(this)));
+ }
+
+ auto ToolbarView::get_bottom_bar_style() const -> ToolbarStyle
+ {
+ return static_cast<ToolbarStyle>(adw_toolbar_view_get_bottom_bar_style(const_cast<BaseObjectType *>(unwrap(this))));
+ }
+
+ auto ToolbarView::get_content() const -> Gtk::Widget *
+ {
+ return Glib::wrap(adw_toolbar_view_get_content(const_cast<BaseObjectType *>(unwrap(this))));
+ }
+
+ auto ToolbarView::get_extend_content_to_bottom_edge() const -> bool
+ {
+ return adw_toolbar_view_get_extend_content_to_bottom_edge(const_cast<BaseObjectType *>(unwrap(this)));
+ }
+
+ auto ToolbarView::get_extend_content_to_top_edge() const -> bool
+ {
+ return adw_toolbar_view_get_extend_content_to_top_edge(const_cast<BaseObjectType *>(unwrap(this)));
+ }
+
+ auto ToolbarView::get_reveal_bottom_bars() const -> bool
+ {
+ return adw_toolbar_view_get_reveal_bottom_bars(const_cast<BaseObjectType *>(unwrap(this)));
+ }
+
+ auto ToolbarView::get_reveal_top_bars() const -> bool
+ {
+ return adw_toolbar_view_get_reveal_top_bars(const_cast<BaseObjectType *>(unwrap(this)));
+ }
+
+ auto ToolbarView::get_top_bar_height() const -> int
+ {
+ return adw_toolbar_view_get_top_bar_height(const_cast<BaseObjectType *>(unwrap(this)));
+ }
+
+ auto ToolbarView::get_top_bar_style() const -> ToolbarStyle
+ {
+ return static_cast<ToolbarStyle>(adw_toolbar_view_get_top_bar_style(const_cast<BaseObjectType *>(unwrap(this))));
+ }
+
+ auto ToolbarView::set_bottom_bar_style(ToolbarStyle value) -> void
+ {
+ return adw_toolbar_view_set_bottom_bar_style(unwrap(this), static_cast<AdwToolbarStyle>(value));
+ }
+
+ auto ToolbarView::set_content(Gtk::Widget & value) -> void
+ {
+ return adw_toolbar_view_set_content(unwrap(this), unwrap(&value));
+ }
+
+ auto ToolbarView::set_extend_content_to_bottom_edge(bool value) -> void
+ {
+ return adw_toolbar_view_set_extend_content_to_bottom_edge(unwrap(this), value);
+ }
+
+ auto ToolbarView::set_extend_content_to_top_edge(bool value) -> void
+ {
+ return adw_toolbar_view_set_extend_content_to_top_edge(unwrap(this), value);
+ }
+
+ auto ToolbarView::set_reveal_bottom_bars(bool value) -> void
+ {
+ return adw_toolbar_view_set_reveal_bottom_bars(unwrap(this), value);
+ }
+
+ auto ToolbarView::set_reveal_top_bars(bool value) -> void
+ {
+ return adw_toolbar_view_set_reveal_top_bars(unwrap(this), value);
+ }
+
+ auto ToolbarView::set_top_bar_style(ToolbarStyle value) -> void
+ {
+ return adw_toolbar_view_set_top_bar_style(unwrap(this), static_cast<AdwToolbarStyle>(value));
+ }
+
+ auto ToolbarView::property_bottom_bar_height() const -> Glib::PropertyProxy_ReadOnly<int>
+ {
+ return {this, property_name::bottom_bar_height};
+ }
+
+ auto ToolbarView::property_bottom_bar_style() -> Glib::PropertyProxy<ToolbarStyle>
+ {
+ return {this, property_name::bottom_bar_style};
+ }
+
+ auto ToolbarView::property_bottom_bar_style() const -> Glib::PropertyProxy_ReadOnly<ToolbarStyle>
+ {
+ return {this, property_name::bottom_bar_style};
+ }
+
+ auto ToolbarView::property_content() -> Glib::PropertyProxy<Gtk::Widget *>
+ {
+ return {this, property_name::content};
+ }
+
+ auto ToolbarView::property_content() const -> Glib::PropertyProxy_ReadOnly<Gtk::Widget *>
+ {
+ return {this, property_name::content};
+ }
+
+ auto ToolbarView::property_extend_content_to_bottom_edge() -> Glib::PropertyProxy<bool>
+ {
+ return {this, property_name::extend_content_to_bottom_edge};
+ }
+
+ auto ToolbarView::property_extend_content_to_bottom_edge() const -> Glib::PropertyProxy_ReadOnly<bool>
+ {
+ return {this, property_name::extend_content_to_bottom_edge};
+ }
+
+ auto ToolbarView::property_extend_content_to_top_edge() -> Glib::PropertyProxy<bool>
+ {
+ return {this, property_name::extend_content_to_top_edge};
+ }
+
+ auto ToolbarView::property_extend_content_to_top_edge() const -> Glib::PropertyProxy_ReadOnly<bool>
+ {
+ return {this, property_name::extend_content_to_top_edge};
+ }
+
+ auto ToolbarView::property_reveal_bottom_bars() -> Glib::PropertyProxy<bool>
+ {
+ return {this, property_name::reveal_bottom_bars};
+ }
+
+ auto ToolbarView::property_reveal_bottom_bars() const -> Glib::PropertyProxy_ReadOnly<bool>
+ {
+ return {this, property_name::reveal_bottom_bars};
+ }
+
+ auto ToolbarView::property_reveal_top_bars() -> Glib::PropertyProxy<bool>
+ {
+ return {this, property_name::reveal_top_bars};
+ }
+
+ auto ToolbarView::property_reveal_top_bars() const -> Glib::PropertyProxy_ReadOnly<bool>
+ {
+ return {this, property_name::reveal_top_bars};
+ }
+
+ auto ToolbarView::property_top_bar_height() const -> Glib::PropertyProxy_ReadOnly<int>
+ {
+ return {this, property_name::top_bar_height};
+ }
+
+ auto ToolbarView::property_top_bar_style() -> Glib::PropertyProxy<ToolbarStyle>
+ {
+ return {this, property_name::top_bar_style};
+ }
+
+ auto ToolbarView::property_top_bar_style() const -> Glib::PropertyProxy_ReadOnly<ToolbarStyle>
+ {
+ return {this, property_name::top_bar_style};
+ }
+
+} // namespace Adwaita
+
+namespace Glib
+{
+ auto wrap(AdwToolbarView * object, bool copy) -> Adwaita::ToolbarView *
+ {
+ return dynamic_cast<Adwaita::ToolbarView *>(Glib::wrap_auto(G_OBJECT(object), copy));
+ }
+} // namespace Glib \ No newline at end of file