aboutsummaryrefslogtreecommitdiffstats
path: root/swaybar/state.h
blob: e09807d0c43694512145e7aa75734054b43121f1 (plain) (blame)
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
#ifndef _SWAYBAR_STATE_H
#define _SWAYBAR_STATE_H

#include "client/registry.h"
#include "client/window.h"
#include "list.h"

struct swaybar_state {
	struct swaybar_config *config;
	struct status_line *status;
	struct output *output;
	/* list_t *outputs; */

	int ipc_event_socketfd;
	int ipc_socketfd;
	int status_read_fd;
	pid_t status_command_pid;
};

struct output {
	struct window *window;
	struct registry *registry;
	list_t *workspaces;
	char *name;
};

struct workspace {
	int num;
	char *name;
	bool focused;
	bool visible;
	bool urgent;
};

/**
 * Initialize state.
 */
struct swaybar_state *init_state();

/**
 * free workspace list.
 */
void free_workspaces(list_t *workspaces);

/**
 * Free state struct.
 */
void free_state(struct swaybar_state *state);

#endif /* _SWAYBAR_STATE_H */