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 @@ +#ifndef _SWAY_BORDER_H +#define _SWAY_BORDER_H +#include <wlc/wlc.h> +#include "container.h" + +void render_view_borders(wlc_handle view); +void update_view_border(swayc_t *view); +void map_update_view_border(swayc_t *view, void *data); +int get_font_text_height(const char *font); + +#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 @@ #ifndef _SWAY_CLIENT_PANGO_H #define _SWAY_CLIENT_PANGO_H -#include "client/window.h" -#include "client/buffer.h" +#include <cairo/cairo.h> +#include <pango/pangocairo.h> #include <stdarg.h> -PangoLayout *get_pango_layout(struct window *window, struct buffer *buffer, const char *text); -void get_text_size(struct window *window, int *width, int *height, const char *fmt, ...); -void pango_printf(struct window *window, const char *fmt, ...); +PangoLayout *get_pango_layout(cairo_t *cairo, const char *font, const char *text); +void get_text_size(cairo_t *cairo, const char *font, int *width, int *height, const char *fmt, ...); +void pango_printf(cairo_t *cairo, const char *font, const char *fmt, ...); #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 { } colors; }; +struct border_colors { + uint32_t border; + uint32_t background; + uint32_t text; + uint32_t indicator; + uint32_t child_border; +}; + +enum edge_border_types { + E_NONE, /**< Don't hide edge borders */ + E_VERTICAL, /**< hide vertical edge borders */ + E_HORIZONTAL, /**< hide horizontal edge borders */ + E_BOTH /**< hide vertical and horizontal edge borders */ +}; + /** * The configuration struct. The result of loading a config file. */ @@ -169,6 +184,7 @@ struct sway_config { enum swayc_layouts default_orientation; enum swayc_layouts default_layout; char *font; + int font_height; // Flags bool focus_follows_mouse; @@ -187,6 +203,20 @@ struct sway_config { list_t *config_chain; const char *current_config; + + enum swayc_border_types border; + int border_thickness; + enum edge_border_types hide_edge_borders; + + // border colors + struct { + struct border_colors focused; + struct border_colors focused_inactive; + struct border_colors unfocused; + struct border_colors urgent; + struct border_colors placeholder; + uint32_t background; + } border_colors; }; /** 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; /** * Different kinds of containers. - * + * * This enum is in order. A container will never be inside of a container below * it on this list. */ @@ -36,6 +36,12 @@ enum swayc_layouts { L_LAYOUTS, }; +enum swayc_border_types { + B_NONE, /**< No border */ + B_PIXEL, /**< 1px border */ + B_NORMAL /**< Normal border with title bar */ +}; + /** * Stores information about a container. * @@ -109,6 +115,16 @@ struct sway_container { * If this container's children include a fullscreen view, this is that view. */ struct sway_container *fullscreen; + /** + * If this container is a view, this may be set to the window's decoration + * buffer (or NULL). + */ + unsigned char *border; + enum swayc_border_types border_type; + struct wlc_geometry border_geometry; + struct wlc_geometry title_bar_geometry; + struct wlc_geometry actual_geometry; + int border_thickness; }; enum visibility_mask { |