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
|
#ifndef TURNS_PARTICIPANT_H
#define TURNS_PARTICIPANT_H
#include <glib-object.h>
#include <glib.h>
G_BEGIN_DECLS
typedef enum
{
TURNS_PARTICIPANT_DISPOSITION_NEUTRAL,
TURNS_PARTICIPANT_DISPOSITION_FRIENDLY,
TURNS_PARTICIPANT_DISPOSITION_HOSTILE,
TURNS_PARTICIPANT_DISPOSITION_SECRET,
} TurnsParticipantDisposition;
GType turns_participant_disposition_get_type(void) G_GNUC_CONST;
#define TURNS_TYPE_PARTICIPANT_DISPOSITION (turns_participant_disposition_get_type())
#define TURNS_TYPE_PARTICIPANT turns_participant_get_type()
G_DECLARE_FINAL_TYPE(TurnsParticipant, turns_participant, TURNS, PARTICIPANT, GObject)
/**
* @brief Construct a new Participant.
*
* This functions constructs a default initialized instance, meaning:
* - @p name is the empty string
* - @p priority is 0.0f
* - @p disposition is Disposition.Neutral.
*/
TurnsParticipant * turns_participant_new(void) G_GNUC_WARN_UNUSED_RESULT;
/**
* @brief Construct a new Participant with the given values.
*
* @param name The name of the new instance. The value *must not* be NULL.
* @param priority The priority of the new instance.
* @param disposition The disposition of the new instance.
*/
TurnsParticipant *
turns_participant_new_with(gchar const * name, gfloat priority, TurnsParticipantDisposition disposition) G_GNUC_WARN_UNUSED_RESULT;
/**
* @brief Get the active state of a participant.
*
* @param self A Participant instance. The value *must not* be NULL.
* @return The active state of the instance.
*/
gboolean turns_participant_get_active(TurnsParticipant const * self);
/**
* @brief Get the defeated state of a participant.
*
* @param self A Participant instance. The value *must not* be NULL.
* @return The defeated state of the instance.
*/
gboolean turns_participant_get_defeated(TurnsParticipant const * self);
/**
* @brief Get the disposition of a participant.
*
* @param self A Participant instance. The value *must not* be NULL.
* @return The disposition of the instance.
*/
TurnsParticipantDisposition turns_participant_get_disposition(TurnsParticipant const * self);
/**
* @brief Get the name of a participant.
*
* @param self A Participant instance. The value *must not* be NULL.
* @return The name of the instance. The data is owned by the instance.
*/
gchar const * turns_participant_get_name(TurnsParticipant const * self);
/**
* @brief Get the priority of a participant.
*
* @param self A Participant instance. The value *must not* be NULL.
* @return The priority of the instance.
*/
gfloat turns_participant_get_priority(TurnsParticipant const * self);
/**
* @brief Set the active state of a participant.
*
* @param self A Participant instance. The value *must not* be NULL.
* @return The new active state.
*/
void turns_participant_set_active(TurnsParticipant * self, gboolean value);
/**
* @brief Set the defeated state of a participant.
*
* @param self A Participant instance. The value *must not* be NULL.
* @param value The new defeated state.
*/
void turns_participant_set_defeated(TurnsParticipant * self, gboolean value);
/**
* @brief Set the disposition of a participant.
*
* @param self A Participant instance. The value *must not* be NULL.
* @param value The new disposition.
*/
void turns_participant_set_disposition(TurnsParticipant * self, TurnsParticipantDisposition value);
/**
* @brief Set the name of a participant.
*
* @param self A Participant instance. The value *must not* be NULL.
* @param value The new name. The data is owned by the caller of the method.
*/
void turns_participant_set_name(TurnsParticipant * self, gchar const * value);
/**
* @brief Set the priority of a participant.
*
* @param self A Participant instance. The value *must not* be NULL.
* @param value The new priority.
*/
void turns_participant_set_priority(TurnsParticipant * self, gfloat value);
G_END_DECLS
#endif
|