aboutsummaryrefslogtreecommitdiffstats
path: root/include/swaybar/status_line.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/swaybar/status_line.h')
-rw-r--r--include/swaybar/status_line.h32
1 files changed, 8 insertions, 24 deletions
diff --git a/include/swaybar/status_line.h b/include/swaybar/status_line.h
index 150267cd..d3eabdf6 100644
--- a/include/swaybar/status_line.h
+++ b/include/swaybar/status_line.h
@@ -1,5 +1,6 @@
1#ifndef _SWAYBAR_STATUS_LINE_H 1#ifndef _SWAYBAR_STATUS_LINE_H
2#define _SWAYBAR_STATUS_LINE_H 2#define _SWAYBAR_STATUS_LINE_H
3#include <json-c/json.h>
3#include <stdint.h> 4#include <stdint.h>
4#include <stdio.h> 5#include <stdio.h>
5#include <stdbool.h> 6#include <stdbool.h>
@@ -12,28 +13,6 @@ enum status_protocol {
12 PROTOCOL_I3BAR, 13 PROTOCOL_I3BAR,
13}; 14};
14 15
15struct text_protocol_state {
16 char *buffer;
17 size_t buffer_size;
18};
19
20enum json_node_type {
21 JSON_NODE_UNKNOWN,
22 JSON_NODE_ARRAY,
23 JSON_NODE_STRING,
24};
25
26struct i3bar_protocol_state {
27 bool click_events;
28 char *buffer;
29 size_t buffer_size;
30 size_t buffer_index;
31 const char *current_node;
32 bool escape;
33 size_t depth;
34 enum json_node_type nodes[16];
35};
36
37struct i3bar_block { 16struct i3bar_block {
38 struct wl_list link; 17 struct wl_list link;
39 int ref_count; 18 int ref_count;
@@ -63,8 +42,13 @@ struct status_line {
63 const char *text; 42 const char *text;
64 struct wl_list blocks; // i3bar_block::link 43 struct wl_list blocks; // i3bar_block::link
65 44
66 struct text_protocol_state text_state; 45 bool click_events;
67 struct i3bar_protocol_state i3bar_state; 46 char *buffer;
47 size_t buffer_size;
48 size_t buffer_index;
49 bool started;
50 bool expecting_comma;
51 json_tokener *tokener;
68}; 52};
69 53
70struct status_line *status_line_init(char *cmd); 54struct status_line *status_line_init(char *cmd);