diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/border.h | 11 | ||||
-rw-r--r-- | include/client/pango.h | 10 | ||||
-rw-r--r-- | include/config.h | 30 | ||||
-rw-r--r-- | include/container.h | 18 |
4 files changed, 63 insertions, 6 deletions
diff --git a/include/border.h b/include/border.h new file mode 100644 index 00000000..85c656e0 --- /dev/null +++ b/include/border.h | |||
@@ -0,0 +1,11 @@ | |||
1 | #ifndef _SWAY_BORDER_H | ||
2 | #define _SWAY_BORDER_H | ||
3 | #include <wlc/wlc.h> | ||
4 | #include "container.h" | ||
5 | |||
6 | void render_view_borders(wlc_handle view); | ||
7 | void update_view_border(swayc_t *view); | ||
8 | void map_update_view_border(swayc_t *view, void *data); | ||
9 | int get_font_text_height(const char *font); | ||
10 | |||
11 | #endif | ||
diff --git a/include/client/pango.h b/include/client/pango.h index e25a2211..97c31e38 100644 --- a/include/client/pango.h +++ b/include/client/pango.h | |||
@@ -1,12 +1,12 @@ | |||
1 | #ifndef _SWAY_CLIENT_PANGO_H | 1 | #ifndef _SWAY_CLIENT_PANGO_H |
2 | #define _SWAY_CLIENT_PANGO_H | 2 | #define _SWAY_CLIENT_PANGO_H |
3 | 3 | ||
4 | #include "client/window.h" | 4 | #include <cairo/cairo.h> |
5 | #include "client/buffer.h" | 5 | #include <pango/pangocairo.h> |
6 | #include <stdarg.h> | 6 | #include <stdarg.h> |
7 | 7 | ||
8 | PangoLayout *get_pango_layout(struct window *window, struct buffer *buffer, const char *text); | 8 | PangoLayout *get_pango_layout(cairo_t *cairo, const char *font, const char *text); |
9 | void get_text_size(struct window *window, int *width, int *height, const char *fmt, ...); | 9 | void get_text_size(cairo_t *cairo, const char *font, int *width, int *height, const char *fmt, ...); |
10 | void pango_printf(struct window *window, const char *fmt, ...); | 10 | void pango_printf(cairo_t *cairo, const char *font, const char *fmt, ...); |
11 | 11 | ||
12 | #endif | 12 | #endif |
diff --git a/include/config.h b/include/config.h index 4bcf55e8..fb84423c 100644 --- a/include/config.h +++ b/include/config.h | |||
@@ -148,6 +148,21 @@ struct bar_config { | |||
148 | } colors; | 148 | } colors; |
149 | }; | 149 | }; |
150 | 150 | ||
151 | struct border_colors { | ||
152 | uint32_t border; | ||
153 | uint32_t background; | ||
154 | uint32_t text; | ||
155 | uint32_t indicator; | ||
156 | uint32_t child_border; | ||
157 | }; | ||
158 | |||
159 | enum edge_border_types { | ||
160 | E_NONE, /**< Don't hide edge borders */ | ||
161 | E_VERTICAL, /**< hide vertical edge borders */ | ||
162 | E_HORIZONTAL, /**< hide horizontal edge borders */ | ||
163 | E_BOTH /**< hide vertical and horizontal edge borders */ | ||
164 | }; | ||
165 | |||
151 | /** | 166 | /** |
152 | * The configuration struct. The result of loading a config file. | 167 | * The configuration struct. The result of loading a config file. |
153 | */ | 168 | */ |
@@ -169,6 +184,7 @@ struct sway_config { | |||
169 | enum swayc_layouts default_orientation; | 184 | enum swayc_layouts default_orientation; |
170 | enum swayc_layouts default_layout; | 185 | enum swayc_layouts default_layout; |
171 | char *font; | 186 | char *font; |
187 | int font_height; | ||
172 | 188 | ||
173 | // Flags | 189 | // Flags |
174 | bool focus_follows_mouse; | 190 | bool focus_follows_mouse; |
@@ -187,6 +203,20 @@ struct sway_config { | |||
187 | 203 | ||
188 | list_t *config_chain; | 204 | list_t *config_chain; |
189 | const char *current_config; | 205 | const char *current_config; |
206 | |||
207 | enum swayc_border_types border; | ||
208 | int border_thickness; | ||
209 | enum edge_border_types hide_edge_borders; | ||
210 | |||
211 | // border colors | ||
212 | struct { | ||
213 | struct border_colors focused; | ||
214 | struct border_colors focused_inactive; | ||
215 | struct border_colors unfocused; | ||
216 | struct border_colors urgent; | ||
217 | struct border_colors placeholder; | ||
218 | uint32_t background; | ||
219 | } border_colors; | ||
190 | }; | 220 | }; |
191 | 221 | ||
192 | /** | 222 | /** |
diff --git a/include/container.h b/include/container.h index a96beab9..26da851e 100644 --- a/include/container.h +++ b/include/container.h | |||
@@ -8,7 +8,7 @@ typedef struct sway_container swayc_t; | |||
8 | 8 | ||
9 | /** | 9 | /** |
10 | * Different kinds of containers. | 10 | * Different kinds of containers. |
11 | * | 11 | * |
12 | * This enum is in order. A container will never be inside of a container below | 12 | * This enum is in order. A container will never be inside of a container below |
13 | * it on this list. | 13 | * it on this list. |
14 | */ | 14 | */ |
@@ -36,6 +36,12 @@ enum swayc_layouts { | |||
36 | L_LAYOUTS, | 36 | L_LAYOUTS, |
37 | }; | 37 | }; |
38 | 38 | ||
39 | enum swayc_border_types { | ||
40 | B_NONE, /**< No border */ | ||
41 | B_PIXEL, /**< 1px border */ | ||
42 | B_NORMAL /**< Normal border with title bar */ | ||
43 | }; | ||
44 | |||
39 | /** | 45 | /** |
40 | * Stores information about a container. | 46 | * Stores information about a container. |
41 | * | 47 | * |
@@ -109,6 +115,16 @@ struct sway_container { | |||
109 | * If this container's children include a fullscreen view, this is that view. | 115 | * If this container's children include a fullscreen view, this is that view. |
110 | */ | 116 | */ |
111 | struct sway_container *fullscreen; | 117 | struct sway_container *fullscreen; |
118 | /** | ||
119 | * If this container is a view, this may be set to the window's decoration | ||
120 | * buffer (or NULL). | ||
121 | */ | ||
122 | unsigned char *border; | ||
123 | enum swayc_border_types border_type; | ||
124 | struct wlc_geometry border_geometry; | ||
125 | struct wlc_geometry title_bar_geometry; | ||
126 | struct wlc_geometry actual_geometry; | ||
127 | int border_thickness; | ||
112 | }; | 128 | }; |
113 | 129 | ||
114 | enum visibility_mask { | 130 | enum visibility_mask { |