2016-01-23 20:55:01 +01:00
|
|
|
#ifndef _SWAYBAR_STATE_H
|
|
|
|
#define _SWAYBAR_STATE_H
|
|
|
|
|
|
|
|
#include "client/registry.h"
|
|
|
|
#include "client/window.h"
|
2016-01-24 01:03:08 +01:00
|
|
|
#include "list.h"
|
2016-01-23 20:55:01 +01:00
|
|
|
|
|
|
|
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;
|
2016-01-24 00:23:09 +01:00
|
|
|
char *name;
|
2016-01-23 20:55:01 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
struct workspace {
|
|
|
|
int num;
|
|
|
|
char *name;
|
|
|
|
bool focused;
|
|
|
|
bool visible;
|
|
|
|
bool urgent;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2016-01-24 02:19:08 +01:00
|
|
|
* Setup state.
|
2016-01-23 20:55:01 +01:00
|
|
|
*/
|
2016-01-24 02:19:08 +01:00
|
|
|
void state_setup(struct swaybar_state *state, const char *socket_path, const char *bar_id, int desired_output);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* State mainloop.
|
|
|
|
*/
|
|
|
|
void state_run(struct swaybar_state *state);
|
2016-01-23 20:55:01 +01:00
|
|
|
|
|
|
|
/**
|
2016-01-24 01:03:08 +01:00
|
|
|
* free workspace list.
|
2016-01-23 20:55:01 +01:00
|
|
|
*/
|
2016-01-24 01:03:08 +01:00
|
|
|
void free_workspaces(list_t *workspaces);
|
|
|
|
|
|
|
|
/**
|
2016-01-24 02:19:08 +01:00
|
|
|
* Teardown state.
|
2016-01-24 01:03:08 +01:00
|
|
|
*/
|
2016-01-24 02:19:08 +01:00
|
|
|
void state_teardown(struct swaybar_state *state);
|
2016-01-23 20:55:01 +01:00
|
|
|
|
|
|
|
#endif /* _SWAYBAR_STATE_H */
|