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
|
#include "turnsmm/turn-order.hpp"
#include "turns-turn-order.h"
#include "turnsmm/enum_helpers.hpp"
#include "turnsmm/participant.hpp"
#include "turnsmm/private/turn-order_p.hpp"
#include <glibmm/class.h>
#include <glibmm/object.h>
#include <glibmm/objectbase.h>
#include <glibmm/private/object_p.h>
#include <glibmm/propertyproxy.h>
#include <glibmm/refptr.h>
#include <glibmm/wrap.h>
#include <giomm/listmodel.h>
#include <glib-object.h>
#include <bit>
#include <cstddef>
namespace Turns
{
namespace
{
auto constinit _class = TurnOrder_Class{};
} // namespace
auto TurnOrder_Class::init() -> Glib::Class const &
{
if (!gtype_)
{
class_init_func_ = &class_init_function;
gtype_ = turns_turn_order_get_type();
}
return *this;
}
auto TurnOrder_Class::class_init_function(void * gclass, void * data) -> void
{
auto const klass = static_cast<BaseClassType *>(gclass);
CppClassParent::class_init_function(klass, data);
}
auto TurnOrder_Class::wrap_new(GObject * object) -> Glib::ObjectBase *
{
return new TurnOrder(TURNS_TURN_ORDER(object));
}
auto TurnOrder::get_base_type() -> GType
{
return turns_turn_order_get_type();
}
auto TurnOrder::get_type() -> GType
{
return _class.init().get_type();
}
TurnOrder::TurnOrder()
: Glib::ObjectBase{nullptr}
, Glib::Object{Glib::ConstructParams{_class.init()}}
{
static_assert(enum_matches<SortMode::Descending, TURNS_TURN_ORDER_SORT_MODE_DESCENDING>);
static_assert(enum_matches<SortMode::Ascending, TURNS_TURN_ORDER_SORT_MODE_ASCENDING>);
}
auto TurnOrder::gobj() noexcept -> BaseObjectType *
{
return std::bit_cast<BaseObjectType *>(gobject_);
}
auto TurnOrder::gobj() const -> BaseObjectType const *
{
return std::bit_cast<BaseObjectType const *>(gobject_);
}
auto TurnOrder::gobj_copy() noexcept -> BaseObjectType *
{
reference();
return gobj();
}
auto TurnOrder::add(Glib::RefPtr<Participant> const & participant) noexcept -> void
{
return turns_turn_order_add(unwrap(this), unwrap(participant));
}
auto TurnOrder::get_participant_count() const noexcept -> std::size_t
{
return turns_turn_order_get_participant_count(unwrap(this));
}
auto TurnOrder::get_running() const noexcept -> bool
{
return turns_turn_order_get_running(unwrap(this));
}
auto TurnOrder::property_running() const noexcept -> Glib::PropertyProxy_ReadOnly<bool>
{
return {this, "running"};
}
auto TurnOrder::get_sort_mode() const noexcept -> SortMode
{
return static_cast<SortMode>(turns_turn_order_get_sort_mode(unwrap(this)));
}
auto TurnOrder::set_sort_mode(SortMode value) noexcept -> void
{
turns_turn_order_set_sort_mode(unwrap(this), static_cast<TurnsTurnOrderSortMode>(value));
}
auto TurnOrder::property_sort_mode() noexcept -> Glib::PropertyProxy<SortMode>
{
return {this, "sort_mode"};
}
auto TurnOrder::property_sort_mode() const noexcept -> Glib::PropertyProxy_ReadOnly<SortMode>
{
return {this, "sort_mode"};
}
TurnOrder::TurnOrder(BaseObjectType * gobj)
: Glib::Object(G_OBJECT(gobj))
{
}
} // namespace Turns
namespace Glib
{
auto Value<Turns ::TurnOrder ::SortMode>::value_type() -> GType
{
return turns_turn_order_sort_mode_get_type();
}
auto wrap(TurnsTurnOrder * object, bool copy) -> Glib::RefPtr<Turns::TurnOrder>
{
return Glib::make_refptr_for_instance<Turns::TurnOrder>(dynamic_cast<Turns::TurnOrder *>(Glib::wrap_auto(G_OBJECT(object), copy)));
}
} // namespace Glib
|