8#ifndef GP_WIDGET_TATTR_H
9#define GP_WIDGET_TATTR_H
11#include <text/gp_text.h>
12#include <widgets/gp_widget_types.h>
13#include <widgets/gp_widget_render.h>
18 GP_TATTR_LARGE = 0x20,
25 GP_TATTR_CENTER = 0x02,
26 GP_TATTR_RIGHT = 0x03,
27 GP_TATTR_HALIGN = 0x03,
33static inline const gp_text_style *gp_widget_tattr_font(gp_widget_tattr attr,
const gp_widget_render_ctx *ctx)
35 if (attr & GP_TATTR_MONO) {
36 if (attr & GP_TATTR_BOLD)
37 return ctx->font_mono_bold;
39 return ctx->font_mono;
42 if (attr & GP_TATTR_BOLD) {
43 if (attr & GP_TATTR_LARGE)
44 return ctx->font_big_bold;
46 return ctx->font_bold;
49 if (attr & GP_TATTR_LARGE)
55static inline int gp_widget_tattr_halign(gp_widget_tattr attr)
57 return attr & GP_TATTR_HALIGN;
71int gp_widget_tattr_parse(
const char *attrs, gp_widget_tattr *tattr,
int flags);