From c805e42635f3935ccf0ce927143433b94c78a3e7 Mon Sep 17 00:00:00 2001 From: David Eklov Date: Sun, 10 Jul 2016 22:47:10 -0500 Subject: Extract workspace size computation from render_workspace_button() Also remove some unnecessary strtup()s and rename a few variables and functions. --- include/bar/bar.h | 3 +++ include/bar/render.h | 5 +++++ 2 files changed, 8 insertions(+) (limited to 'include') diff --git a/include/bar/bar.h b/include/bar/bar.h index c20efc55..a3c511d9 100644 --- a/include/bar/bar.h +++ b/include/bar/bar.h @@ -32,6 +32,9 @@ struct workspace { bool urgent; }; +/** Global bar state */ +extern struct bar swaybar; + /** * Setup bar. */ diff --git a/include/bar/render.h b/include/bar/render.h index 931a1cdd..114f43f4 100644 --- a/include/bar/render.h +++ b/include/bar/render.h @@ -14,4 +14,9 @@ void render(struct output *output, struct config *config, struct status_line *li */ void set_window_height(struct window *window, int height); +/** + * Compute the size of a workspace name + */ +void workspace_button_size(struct window *window, const char *workspace_name, int *width, int *height); + #endif /* _SWAYBAR_RENDER_H */ -- cgit v1.2.3-54-g00ecf