Introduce sway_text_buffer

This is a helper on top of a wlr_scene_buffer that will handle text
rendering for us.
This commit is contained in:
Alexander Orzechowski 2022-10-17 15:26:27 -04:00 committed by Kirill Primak
parent fdc2053bfe
commit f9fc1ff7a8
3 changed files with 366 additions and 0 deletions

View file

@ -0,0 +1,25 @@
#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];
struct wlr_scene_node *node;
};
struct sway_text_node *sway_text_node_create(struct wlr_scene_tree *parent,
char *text, const float *color, bool pango_markup);
void sway_text_node_set_color(struct sway_text_node *node, const float *color);
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);
#endif