diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2023-11-23 10:08:28 -0500 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2023-11-23 10:08:28 -0500 |
| commit | f5381c88477802c39705eb35fcee8a8e61f4961a (patch) | |
| tree | e320c34a26f9a515b24c7526a9c863408efd799c /include | |
| parent | 20d9151640473b992d76fcc27b338ae719d00a05 (diff) | |
Introduce sway_text_node
This is a helper on top of a wlr_scene_buffer that will handle text
rendering for us.
Diffstat (limited to 'include')
| -rw-r--r-- | include/sway/sway_text_node.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/include/sway/sway_text_node.h b/include/sway/sway_text_node.h new file mode 100644 index 00000000..0d4209bb --- /dev/null +++ b/include/sway/sway_text_node.h @@ -0,0 +1,28 @@ +#ifndef _SWAY_BUFFER_H +#define _SWAY_BUFFER_H +#include <wlr/types/wlr_scene.h> + +struct sway_text_node { + int width; + int max_width; + int height; + int baseline; + bool pango_markup; + float color[4]; + float background[4]; + + struct wlr_scene_node *node; +}; + +struct sway_text_node *sway_text_node_create(struct wlr_scene_tree *parent, + char *text, float color[4], bool pango_markup); + +void sway_text_node_set_color(struct sway_text_node *node, float color[4]); + +void sway_text_node_set_text(struct sway_text_node *node, char *text); + +void sway_text_node_set_max_width(struct sway_text_node *node, int max_width); + +void sway_text_node_set_background(struct sway_text_node *node, float background[4]); + +#endif |
