File: shared.hpp

package info (click to toggle)
ares 126-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 32,600 kB
  • sloc: cpp: 356,508; ansic: 20,394; makefile: 16; sh: 2
file content (233 lines) | stat: -rw-r--r-- 12,180 bytes parent folder | download | duplicates (2)
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
#if defined(Hiro_FixedLayout)
struct FixedLayoutCell : sFixedLayoutCell {
  DeclareSharedObject(FixedLayoutCell)

  auto geometry() const { return self().geometry(); }
  auto setGeometry(Geometry geometry) { return self().setGeometry(geometry), *this; }
  auto setSizable(sSizable sizable) { return self().setSizable(sizable), *this; }
  auto sizable() const { return self().sizable(); }
};

struct FixedLayout : sFixedLayout {
  DeclareSharedSizable(FixedLayout)

  auto append(sSizable sizable, Geometry geometry) { return self().append(sizable, geometry), *this; }
  auto cell(uint position) const { return self().cell(position); }
  auto cell(sSizable sizable) const { return self().cell(sizable); }
  auto cells() const { return self().cells(); }
  auto cellCount() const { return self().cellCount(); }
  auto remove(sSizable sizable) { return self().remove(sizable), *this; }
  auto remove(sFixedLayoutCell cell) { return self().remove(cell), *this; }
  auto reset() { return self().reset(), *this; }
  auto resize() { return self().resize(), *this; }
};
#endif

#if defined(Hiro_HorizontalLayout)
struct HorizontalLayoutCell : sHorizontalLayoutCell {
  DeclareSharedObject(HorizontalLayoutCell)

  auto alignment() const { return self().alignment(); }
  auto collapsible() const { return self().collapsible(); }
  auto setAlignment(maybe<float> alignment = {}) { return self().setAlignment(alignment), *this; }
  auto setSizable(sSizable sizable) { return self().setSizable(sizable), *this; }
  auto setSize(Size size) { return self().setSize(size), *this; }
  auto setSpacing(float spacing = 5_sx) { return self().setSpacing(spacing), *this; }
  auto sizable() const { return self().sizable(); }
  auto size() const { return self().size(); }
  auto spacing() const { return self().spacing(); }
};

struct HorizontalLayout : sHorizontalLayout {
  DeclareSharedSizable(HorizontalLayout)

  auto alignment() const { return self().alignment(); }
  auto append(sSizable sizable, Size size, float spacing = 5_sx) { return self().append(sizable, size, spacing), *this; }
  auto cell(uint position) const { return self().cell(position); }
  auto cell(sSizable sizable) const { return self().cell(sizable); }
  auto cells() const { return self().cells(); }
  auto cellCount() const { return self().cellCount(); }
  auto remove(sSizable sizable) { return self().remove(sizable), *this; }
  auto remove(sHorizontalLayoutCell cell) { return self().remove(cell), *this; }
  auto reset() { return self().reset(), *this; }
  auto resize() { return self().resize(), *this; }
  auto setAlignment(maybe<float> alignment = {}) { return self().setAlignment(alignment), *this; }
  auto setPadding(float padding) { return self().setPadding({padding, padding, padding, padding}), *this; }
  auto setPadding(float x, float y) { return self().setPadding({x, y, x, y}), *this; }
  auto setPadding(Geometry padding = {}) { return self().setPadding(padding), *this; }
  auto setSpacing(float spacing = 5_sx) { return self().setSpacing(spacing), *this; }
};
#endif

#if defined(Hiro_VerticalLayout)
struct VerticalLayoutCell : sVerticalLayoutCell {
  DeclareSharedObject(VerticalLayoutCell)

  auto alignment() const { return self().alignment(); }
  auto collapsible() const { return self().collapsible(); }
  auto setAlignment(maybe<float> alignment = {}) { return self().setAlignment(alignment), *this; }
  auto setSizable(sSizable sizable) { return self().setSizable(sizable), *this; }
  auto setSize(Size size) { return self().setSize(size), *this; }
  auto setSpacing(float spacing = 5_sy) { return self().setSpacing(spacing), *this; }
  auto sizable() const { return self().sizable(); }
  auto size() const { return self().size(); }
  auto spacing() const { return self().spacing(); }
};

struct VerticalLayout : sVerticalLayout {
  DeclareSharedSizable(VerticalLayout)

  auto alignment() const { return self().alignment(); }
  auto append(sSizable sizable, Size size, float spacing = 5_sy) { return self().append(sizable, size, spacing), *this; }
  auto cell(uint position) const { return self().cell(position); }
  auto cell(sSizable sizable) const { return self().cell(sizable); }
  auto cells() const { return self().cells(); }
  auto cellCount() const { return self().cellCount(); }
  auto remove(sSizable sizable) { return self().remove(sizable), *this; }
  auto remove(sVerticalLayoutCell cell) { return self().remove(cell), *this; }
  auto reset() { return self().reset(), *this; }
  auto resize() { return self().resize(), *this; }
  auto setAlignment(maybe<float> alignment = {}) { return self().setAlignment(alignment), *this; }
  auto setPadding(float padding) { return self().setPadding({padding, padding, padding, padding}), *this; }
  auto setPadding(float x, float y) { return self().setPadding({x, y, x, y}), *this; }
  auto setPadding(Geometry padding = {}) { return self().setPadding(padding), *this; }
  auto setSpacing(float spacing = 5_sy) { return self().setSpacing(spacing), *this; }
};
#endif

#if defined(Hiro_TableLayout)
struct TableLayoutCell : sTableLayoutCell {
  DeclareSharedObject(TableLayoutCell)

  auto alignment() const { return self().alignment(); }
  auto setAlignment(Alignment alignment = {}) { return self().setAlignment(alignment), *this; }
  auto setSizable(sSizable sizable) { return self().setSizable(sizable), *this; }
  auto setSize(Size size) { return self().setSize(size), *this; }
  auto sizable() const { return self().sizable(); }
  auto size() const { return self().size(); }
};

struct TableLayoutColumn : sTableLayoutColumn {
  DeclareSharedObject(TableLayoutColumn)

  auto alignment() const { return self().alignment(); }
  auto setAlignment(Alignment alignment = {}) { return self().setAlignment(alignment), *this; }
  auto setSpacing(float spacing = 5_sx) { return self().setSpacing(spacing), *this; }
  auto spacing() const { return self().spacing(); }
};

struct TableLayoutRow : sTableLayoutRow {
  DeclareSharedObject(TableLayoutRow)

  auto alignment() const { return self().alignment(); }
  auto setAlignment(Alignment alignment = {}) { return self().setAlignment(alignment), *this; }
  auto setSpacing(float spacing = 5_sy) { return self().setSpacing(spacing), *this; }
  auto spacing() const { return self().spacing(); }
};

struct TableLayout : sTableLayout {
  DeclareSharedSizable(TableLayout)

  auto alignment() const { return self().alignment(); }
  auto append(sSizable sizable, Size size) { return self().append(sizable, size), *this; }
  auto cell(uint position) const { return self().cell(position); }
  auto cell(uint x, uint y) const { return self().cell(x, y); }
  auto cell(sSizable sizable) const { return self().cell(sizable); }
  auto cells() const { return self().cells(); }
  auto cellCount() const { return self().cellCount(); }
  auto column(uint position) const { return self().column(position); }
  auto columns() const { return self().columns(); }
  auto columnCount() const { return self().columnCount(); }
  auto padding() const { return self().padding(); }
  auto remove(sSizable sizable) { return self().remove(sizable), *this; }
  auto remove(sTableLayoutCell cell) { return self().remove(cell), *this; }
  auto reset() { return self().reset(), *this; }
  auto resize() { return self().resize(), *this; }
  auto row(uint position) const { return self().row(position); }
  auto rows() const { return self().rows(); }
  auto rowCount() const { return self().rowCount(); }
  auto setAlignment(Alignment alignment = {}) { return self().setAlignment(alignment), *this; }
  auto setPadding(float padding) { return self().setPadding({padding, padding, padding, padding}), *this; }
  auto setPadding(float x, float y) { return self().setPadding({x, y, x, y}), *this; }
  auto setPadding(Geometry padding = {}) { return self().setPadding(padding), *this; }
  auto setSize(Size size) { return self().setSize(size), *this; }
  auto size() const { return self().size(); }
};
#endif

#if defined(Hiro_HorizontalResizeGrip)
struct HorizontalResizeGrip : sHorizontalResizeGrip {
  DeclareSharedWidget(HorizontalResizeGrip)

  auto doActivate() const { return self().doActivate(); }
  auto doResize(int offset) const { return self().doResize(offset); }
  auto onActivate(const function<void ()>& callback) { return self().onActivate(callback), *this; }
  auto onResize(const function<void (int)>& callback) { return self().onResize(callback), *this; }
};
#endif

#if defined(Hiro_VerticalResizeGrip)
struct VerticalResizeGrip : sVerticalResizeGrip {
  DeclareSharedWidget(VerticalResizeGrip)

  auto doActivate() const { return self().doActivate(); }
  auto doResize(int offset) const { return self().doResize(offset); }
  auto onActivate(const function<void ()>& callback) { return self().onActivate(callback), *this; }
  auto onResize(const function<void (int)>& callback) { return self().onResize(callback), *this; }
};
#endif

#if defined(Hiro_ListView)
struct ListViewItem : sListViewItem {
  DeclareSharedObject(ListViewItem)

  auto alignment() const { return self().alignment(); }
  auto backgroundColor() const { return self().backgroundColor(); }
  auto checkable() const { return self().checkable(); }
  auto checked() const { return self().checked(); }
  auto foregroundColor() const { return self().foregroundColor(); }
  auto icon() const { return self().icon(); }
  auto reset() { return self().reset(), *this; }
  auto selected() const { return self().selected(); }
  auto setAlignment(Alignment alignment = {}) { return self().setAlignment(alignment), *this; }
  auto setBackgroundColor(Color color = {}) { return self().setBackgroundColor(color), *this; }
  auto setCheckable(bool checkable = true) { return self().setCheckable(checkable), *this; }
  auto setChecked(bool checked = true) { return self().setChecked(checked), *this; }
  auto setForegroundColor(Color color = {}) { return self().setForegroundColor(color), *this; }
  auto setIcon(const multiFactorImage& icon = {}) { return self().setIcon(icon), *this; }
  auto setSelected(bool selected = true) { return self().setSelected(selected), *this; }
  auto setText(const string& text = "") { return self().setText(text), *this; }
  auto text() const { return self().text(); }
};

struct ListView : sListView {
  DeclareSharedWidget(ListView)

  auto alignment() const { return self().alignment(); }
  auto append(sListViewItem item) { return self().append(item), *this; }
  auto backgroundColor() const { return self().backgroundColor(); }
  auto batchable() const { return self().batchable(); }
  auto batched() const { return self().batched(); }
  auto doActivate() const { return self().doActivate(); }
  auto doChange() const { return self().doChange(); }
  auto doContext() const { return self().doContext(); }
  auto doToggle(ListViewItem item) const { return self().doToggle(item); }
  auto foregroundColor() const { return self().foregroundColor(); }
  auto item(uint position) const { return self().item(position); }
  auto itemCount() const { return self().itemCount(); }
  auto items() const { return self().items(); }
  auto onActivate(const function<void ()>& callback = {}) { return self().onActivate(callback), *this; }
  auto onChange(const function<void ()>& callback = {}) { return self().onChange(callback), *this; }
  auto onContext(const function<void ()>& callback = {}) { return self().onContext(callback), *this; }
  auto onToggle(const function<void (ListViewItem)>& callback = {}) { return self().onToggle(callback), *this; }
  auto remove(sListViewItem item) { return self().remove(item), *this; }
  auto reset() { return self().reset(), *this; }
  auto resizeColumn() { return self().resizeColumn(), *this; }
  auto selectNone() { return self().selectNone(), *this; }
  auto selected() { return self().selected(); }
  auto setAlignment(Alignment alignment = {}) { return self().setAlignment(alignment), *this; }
  auto setBackgroundColor(Color color = {}) { return self().setBackgroundColor(color), *this; }
  auto setBatchable(bool batchable = true) { return self().setBatchable(batchable), *this; }
  auto setForegroundColor(Color color = {}) { return self().setForegroundColor(color), *this; }
};
#endif