diff options
Diffstat (limited to 'include/swaybar')
-rw-r--r-- | include/swaybar/status_line.h | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/include/swaybar/status_line.h b/include/swaybar/status_line.h index 857948a5..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,23 +13,6 @@ enum status_protocol { | |||
12 | PROTOCOL_I3BAR, | 13 | PROTOCOL_I3BAR, |
13 | }; | 14 | }; |
14 | 15 | ||
15 | enum json_node_type { | ||
16 | JSON_NODE_UNKNOWN, | ||
17 | JSON_NODE_ARRAY, | ||
18 | JSON_NODE_STRING, | ||
19 | }; | ||
20 | |||
21 | struct i3bar_protocol_state { | ||
22 | bool click_events; | ||
23 | char *buffer; | ||
24 | size_t buffer_size; | ||
25 | size_t buffer_index; | ||
26 | const char *current_node; | ||
27 | bool escape; | ||
28 | size_t depth; | ||
29 | enum json_node_type nodes[16]; | ||
30 | }; | ||
31 | |||
32 | struct i3bar_block { | 16 | struct i3bar_block { |
33 | struct wl_list link; | 17 | struct wl_list link; |
34 | int ref_count; | 18 | int ref_count; |
@@ -58,9 +42,13 @@ struct status_line { | |||
58 | const char *text; | 42 | const char *text; |
59 | struct wl_list blocks; // i3bar_block::link | 43 | struct wl_list blocks; // i3bar_block::link |
60 | 44 | ||
45 | bool click_events; | ||
61 | char *buffer; | 46 | char *buffer; |
62 | size_t buffer_size; | 47 | size_t buffer_size; |
63 | struct i3bar_protocol_state i3bar_state; | 48 | size_t buffer_index; |
49 | bool started; | ||
50 | bool expecting_comma; | ||
51 | json_tokener *tokener; | ||
64 | }; | 52 | }; |
65 | 53 | ||
66 | struct status_line *status_line_init(char *cmd); | 54 | struct status_line *status_line_init(char *cmd); |