aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/pango.h14
-rw-r--r--include/sway/commands.h1
-rw-r--r--include/sway/config.h4
-rw-r--r--include/sway/tree/view.h2
-rw-r--r--include/swaybar/event_loop.h4
-rw-r--r--include/swaybar/status_line.h32
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 @@
#include <cairo/cairo.h>
#include <pango/pangocairo.h>
-/* Utility function which escape characters a & < > ' ".
+/**
+ * Utility function which escape characters a & < > ' ".
*
- * If the dest parameter is NULL, then the function returns the length of
- * of the escaped src string. The dest_length doesn't matter.
- *
- * If the dest parameter is not NULL then the fuction escapes the src string
- * an puts the escaped string in dest and returns the lenght of the escaped string.
- * The dest_length parameter is the size of dest array. If the size of dest is not
- * enough, then the function returns -1.
+ * The function returns the length of the escaped string, optionally writing the
+ * escaped string to dest if provided.
*/
-int escape_markup_text(const char *src, char *dest, int dest_length);
+size_t escape_markup_text(const char *src, char *dest);
PangoLayout *get_pango_layout(cairo_t *cairo, const char *font,
const char *text, double scale, bool markup);
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;
sway_cmd cmd_client_placeholder;
sway_cmd cmd_client_background;
sway_cmd cmd_commands;
+sway_cmd cmd_create_output;
sway_cmd cmd_debuglog;
sway_cmd cmd_default_border;
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);
void seat_execute_command(struct sway_seat *seat, struct sway_binding *binding);
-void load_swaybars();
-
-void invoke_swaybar(struct bar_config *bar);
+void load_swaybars(void);
void terminate_swaybg(pid_t pid);
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 {
struct sway_container *container; // NULL if unmapped and transactions finished
struct wlr_surface *surface; // NULL for unmapped views
+ pid_t pid;
+
// Geometry of the view itself (excludes borders) in layout coordinates
double x, y;
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);
bool remove_timer(timer_t timer);
// Blocks and returns after sending callbacks
-void event_loop_poll();
+void event_loop_poll(void);
-void init_event_loop();
+void init_event_loop(void);
#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 @@
#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);