aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLibravatar Alexander Orzechowski <alex@ozal.ski>2023-11-23 10:08:28 -0500
committerLibravatar Kirill Primak <vyivel@eclair.cafe>2024-01-18 18:36:54 +0300
commit946fc8094559801bc4be629368ac31025d28165a (patch)
treee320c34a26f9a515b24c7526a9c863408efd799c /include
parentrenderer: Remove in favor of scene_graph (diff)
downloadsway-946fc8094559801bc4be629368ac31025d28165a.tar.gz
sway-946fc8094559801bc4be629368ac31025d28165a.tar.zst
sway-946fc8094559801bc4be629368ac31025d28165a.zip
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.h28
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 @@
1#ifndef _SWAY_BUFFER_H
2#define _SWAY_BUFFER_H
3#include <wlr/types/wlr_scene.h>
4
5struct sway_text_node {
6 int width;
7 int max_width;
8 int height;
9 int baseline;
10 bool pango_markup;
11 float color[4];
12 float background[4];
13
14 struct wlr_scene_node *node;
15};
16
17struct sway_text_node *sway_text_node_create(struct wlr_scene_tree *parent,
18 char *text, float color[4], bool pango_markup);
19
20void sway_text_node_set_color(struct sway_text_node *node, float color[4]);
21
22void sway_text_node_set_text(struct sway_text_node *node, char *text);
23
24void sway_text_node_set_max_width(struct sway_text_node *node, int max_width);
25
26void sway_text_node_set_background(struct sway_text_node *node, float background[4]);
27
28#endif