summaryrefslogtreecommitdiff
path: root/lib/src/turnsmm/init.cpp
blob: 7ee48593efeda6b27b354844608ad1c4a7433a0b (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
/*
 * SPDX-FileCopyrightText: 2025 Felix Morgner <felix.morgner@gmail.com>
 * SPDX-License-Identifier: LGPL-2.1-only
 */

#include "turnsmm/init.hpp"

#include "turns-init.h"
#include "turnsmm/participant.hpp"
#include "turnsmm/private/participant_p.hpp"  // IWYU pragma: keep
#include "turnsmm/private/turn-order_p.hpp"   // IWYU pragma: keep
#include "turnsmm/turn-order.hpp"

#include <glib-object.h>

#include <glibmm/value.h>
#include <glibmm/wrap.h>

#define WRAP_CLASS(Name, name) Glib::wrap_register(turns_##name##_get_type(), &Name##_Class::wrap_new)
#define ENSURE_TYPE(Name) g_type_ensure(Name::get_type())

namespace Turns
{

  auto init() -> void
  {
    turns_init();

    WRAP_CLASS(Participant, participant);
    WRAP_CLASS(TurnOrder, turn_order);

    ENSURE_TYPE(Participant);
    ENSURE_TYPE(TurnOrder);
  }

}  // namespace Turns