diff options
author | Ryan Dwyer <RyanDwyer@users.noreply.github.com> | 2018-09-21 20:05:39 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-21 20:05:39 +1000 |
commit | 0798fadff2f2f74a7efd7c14c55737bac19de954 (patch) | |
tree | 86e1ab4983fec3586a8bbb0044216216e22cc1cb /include/swaybar/status_line.h | |
parent | 4289343e17615509fba5fe389d855f2292ba09bc (diff) | |
parent | fa4308c5abecaeef870aced574e9d05e24e62392 (diff) |
Merge branch 'master' into render-output-segfault
Diffstat (limited to 'include/swaybar/status_line.h')
-rw-r--r-- | include/swaybar/status_line.h | 32 |
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 @@ #ifndef _SWAYBAR_STATUS_LINE_H #define _SWAYBAR_STATUS_LINE_H +#include <json-c/json.h> #include <stdint.h> #include <stdio.h> #include <stdbool.h> @@ -12,28 +13,6 @@ enum status_protocol { PROTOCOL_I3BAR, }; -struct text_protocol_state { - char *buffer; - size_t buffer_size; -}; - -enum json_node_type { - JSON_NODE_UNKNOWN, - JSON_NODE_ARRAY, - JSON_NODE_STRING, -}; - -struct i3bar_protocol_state { - bool click_events; - char *buffer; - size_t buffer_size; - size_t buffer_index; - const char *current_node; - bool escape; - size_t depth; - enum json_node_type nodes[16]; -}; - struct i3bar_block { struct wl_list link; int ref_count; @@ -63,8 +42,13 @@ struct status_line { const char *text; struct wl_list blocks; // i3bar_block::link - struct text_protocol_state text_state; - struct i3bar_protocol_state i3bar_state; + bool click_events; + char *buffer; + size_t buffer_size; + size_t buffer_index; + bool started; + bool expecting_comma; + json_tokener *tokener; }; struct status_line *status_line_init(char *cmd); |