summaryrefslogtreecommitdiff
path: root/include/river.h
blob: e8576a310dbf469a64cc6caa981076e056c4f935 (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
#ifndef ASTAL_RIVER_H
#define ASTAL_RIVER_H

#include <glib-object.h>

G_BEGIN_DECLS

#define ASTAL_RIVER_TYPE_OUTPUT (astal_river_output_get_type())

G_DECLARE_FINAL_TYPE(AstalRiverOutput, astal_river_output, ASTAL_RIVER, OUTPUT, GObject)

/**
 * astal_river_output_get_nid
 * @self: the AstalRiverOutput object
 *
 * Returns: the id of the output
 */
guint astal_river_output_get_id(AstalRiverOutput *self);

/**
 * astal_river_output_get_name
 * @self: the AstalRiverOutput object
 *
 * Returns: (transfer none) (nullable): the name of the output
 */
gchar *astal_river_output_get_name(AstalRiverOutput *self);

/**
 * astal_river_output_get_layout_name
 * @self: the AstalRiverOutput object
 *
 * Returns: (transfer none) (nullable): the currently used layout name of the output
 */
gchar *astal_river_output_get_layout_name(AstalRiverOutput *self);

/**
 * astal_river_output_get_focused_view
 * @self: the AstalRiverOutput object
 *
 * Returns: (transfer none) (nullable): the focused view on the output
 */
gchar *astal_river_output_get_focused_view(AstalRiverOutput *self);

/**
 * astal_river_output_get_focused_tags
 * @self: the AstalRiverOutput object
 *
 * Returns: the focused tags of the output
 */
guint astal_river_output_get_focused_tags(AstalRiverOutput *self);

/**
 * astal_river_output_get_urgent_tags
 * @self: the AstalRiverOutput object
 *
 * Returns: the urgent tags of the output
 */
guint astal_river_output_get_urgent_tags(AstalRiverOutput *self);

/**
 * astal_river_output_get_occupied_tags
 * @self: the AstalRiverOutput object
 *
 * Returns: the occupied tags of the output
 */
guint astal_river_output_get_occupied_tags(AstalRiverOutput *self);

#define ASTAL_RIVER_TYPE_RIVER (astal_river_river_get_type())

G_DECLARE_FINAL_TYPE(AstalRiverRiver, astal_river_river, ASTAL_RIVER, RIVER, GObject)

/**
 * astal_river_river_new
 *
 * Returns: (nullable): a newly created connection to river
 */
AstalRiverRiver *astal_river_river_new();

/**
 * astal_river_river_get_default
 *
 * Returns: (nullable) (transfer none): gets the default River object.
 */
AstalRiverRiver *astal_river_river_get_default();
/**
 * astal_river_river_get_outputs
 * @self: the AstalRiverRiver object
 *
 * Returns: (transfer none) (element-type AstalRiver.Output): a list of all outputs
 *
 */
GList *astal_river_river_get_outputs(AstalRiverRiver *self);

/**
 * astal_river_river_get_output
 * @self: the AstalRiverRiver object
 * @name: the name of the output
 *
 * Returns: (transfer none) (nullable): the output with the given name or null
 */
AstalRiverOutput *astal_river_river_get_output(AstalRiverRiver *self, gchar *name);

/**
 * astal_river_river_get_focused_view
 * @self: the AstalRiverOutput object
 *
 * Returns: (transfer none) (nullable): the currently focused view
 */
gchar *astal_river_river_get_focused_view(AstalRiverRiver *self);

/**
 * astal_river_river_get_focused_output
 * @self: the AstalRiverOutput object
 *
 * Returns: (transfer none) (nullable): the name of the currently focused output
 */
gchar *astal_river_river_get_focused_output(AstalRiverRiver *self);

/**
 * astal_river_river_get_mode
 * @self: the AstalRiverOutput object
 *
 * Returns: (transfer none) (nullable): the currently active mode
 */
gchar *astal_river_river_get_mode(AstalRiverRiver *self);

/**
 * AstalRiverCommandCallback:
 * @success: a #gboolean.
 * @msg: a string.
 *
 * A callback function that gets a #GObject, a #gboolean, and a string.
 */
typedef void (*AstalRiverCommandCallback)(gboolean success, const gchar *msg);

/**
 * astal_river_river_run_command_async:
 * @self: the AstalRiverRiver object
 * @length: the length of the cmd array
 * @cmd: (array length=length): the command to execute
 * @callback: (scope async) (nullable): the callback to invoke.
 *
 * Calls the given callback with the provided parameters.
 */
void astal_river_river_run_command_async(AstalRiverRiver *self, gint length, const gchar **cmd,
                                         AstalRiverCommandCallback callback);

G_END_DECLS

#endif  // !ASTAL_RIVER_H