diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/pango.h | 14 | ||||
-rw-r--r-- | include/sway/commands.h | 1 | ||||
-rw-r--r-- | include/sway/config.h | 4 | ||||
-rw-r--r-- | include/sway/tree/view.h | 2 | ||||
-rw-r--r-- | include/swaybar/event_loop.h | 4 | ||||
-rw-r--r-- | include/swaybar/status_line.h | 32 |
6 files changed, 19 insertions, 38 deletions
diff --git a/include/pango.h b/include/pango.h index 09a535a5..6ab83c16 100644 --- a/include/pango.h +++ b/include/pango.h | |||
@@ -6,17 +6,13 @@ | |||
6 | #include <cairo/cairo.h> | 6 | #include <cairo/cairo.h> |
7 | #include <pango/pangocairo.h> | 7 | #include <pango/pangocairo.h> |
8 | 8 | ||
9 | /* Utility function which escape characters a & < > ' ". | 9 | /** |
10 | * Utility function which escape characters a & < > ' ". | ||
10 | * | 11 | * |
11 | * If the dest parameter is NULL, then the function returns the length of | 12 | * The function returns the length of the escaped string, optionally writing the |
12 | * of the escaped src string. The dest_length doesn't matter. | 13 | * escaped string to dest if provided. |
13 | * | ||
14 | * If the dest parameter is not NULL then the fuction escapes the src string | ||
15 | * an puts the escaped string in dest and returns the lenght of the escaped string. | ||
16 | * The dest_length parameter is the size of dest array. If the size of dest is not | ||
17 | * enough, then the function returns -1. | ||
18 | */ | 14 | */ |
19 | int escape_markup_text(const char *src, char *dest, int dest_length); | 15 | size_t escape_markup_text(const char *src, char *dest); |
20 | PangoLayout *get_pango_layout(cairo_t *cairo, const char *font, | 16 | PangoLayout *get_pango_layout(cairo_t *cairo, const char *font, |
21 | const char *text, double scale, bool markup); | 17 | const char *text, double scale, bool markup); |
22 | void get_text_size(cairo_t *cairo, const char *font, int *width, int *height, | 18 | void get_text_size(cairo_t *cairo, const char *font, int *width, int *height, |
diff --git a/include/sway/commands.h b/include/sway/commands.h index e51b12fd..226cf932 100644 --- a/include/sway/commands.h +++ b/include/sway/commands.h | |||
@@ -103,6 +103,7 @@ sway_cmd cmd_client_urgent; | |||
103 | sway_cmd cmd_client_placeholder; | 103 | sway_cmd cmd_client_placeholder; |
104 | sway_cmd cmd_client_background; | 104 | sway_cmd cmd_client_background; |
105 | sway_cmd cmd_commands; | 105 | sway_cmd cmd_commands; |
106 | sway_cmd cmd_create_output; | ||
106 | sway_cmd cmd_debuglog; | 107 | sway_cmd cmd_debuglog; |
107 | sway_cmd cmd_default_border; | 108 | sway_cmd cmd_default_border; |
108 | sway_cmd cmd_default_floating_border; | 109 | sway_cmd cmd_default_floating_border; |
diff --git a/include/sway/config.h b/include/sway/config.h index b53c1f1f..36d78ec6 100644 --- a/include/sway/config.h +++ b/include/sway/config.h | |||
@@ -512,9 +512,7 @@ void free_sway_binding(struct sway_binding *sb); | |||
512 | 512 | ||
513 | void seat_execute_command(struct sway_seat *seat, struct sway_binding *binding); | 513 | void seat_execute_command(struct sway_seat *seat, struct sway_binding *binding); |
514 | 514 | ||
515 | void load_swaybars(); | 515 | void load_swaybars(void); |
516 | |||
517 | void invoke_swaybar(struct bar_config *bar); | ||
518 | 516 | ||
519 | void terminate_swaybg(pid_t pid); | 517 | void terminate_swaybg(pid_t pid); |
520 | 518 | ||
diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index 439dc1bf..d10251dd 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h | |||
@@ -61,6 +61,8 @@ struct sway_view { | |||
61 | struct sway_container *container; // NULL if unmapped and transactions finished | 61 | struct sway_container *container; // NULL if unmapped and transactions finished |
62 | struct wlr_surface *surface; // NULL for unmapped views | 62 | struct wlr_surface *surface; // NULL for unmapped views |
63 | 63 | ||
64 | pid_t pid; | ||
65 | |||
64 | // Geometry of the view itself (excludes borders) in layout coordinates | 66 | // Geometry of the view itself (excludes borders) in layout coordinates |
65 | double x, y; | 67 | double x, y; |
66 | int width, height; | 68 | int width, height; |
diff --git a/include/swaybar/event_loop.h b/include/swaybar/event_loop.h index 99f6ed36..47be5b79 100644 --- a/include/swaybar/event_loop.h +++ b/include/swaybar/event_loop.h | |||
@@ -19,8 +19,8 @@ bool remove_event(int fd); | |||
19 | bool remove_timer(timer_t timer); | 19 | bool remove_timer(timer_t timer); |
20 | 20 | ||
21 | // Blocks and returns after sending callbacks | 21 | // Blocks and returns after sending callbacks |
22 | void event_loop_poll(); | 22 | void event_loop_poll(void); |
23 | 23 | ||
24 | void init_event_loop(); | 24 | void init_event_loop(void); |
25 | 25 | ||
26 | #endif | 26 | #endif |
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 | ||
15 | struct text_protocol_state { | ||
16 | char *buffer; | ||
17 | size_t buffer_size; | ||
18 | }; | ||
19 | |||
20 | enum json_node_type { | ||
21 | JSON_NODE_UNKNOWN, | ||
22 | JSON_NODE_ARRAY, | ||
23 | JSON_NODE_STRING, | ||
24 | }; | ||
25 | |||
26 | struct 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 | |||
37 | struct i3bar_block { | 16 | struct 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 | ||
70 | struct status_line *status_line_init(char *cmd); | 54 | struct status_line *status_line_init(char *cmd); |