aboutsummaryrefslogtreecommitdiff
path: root/src/toolbarview.cpp
blob: b2a9de605843cbd09e6f56704b0d32a493b40987 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
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