GFXprim
2D bitmap graphics library with emphasis on speed and correctness
|
Utils for markup parsers. More...
#include <utils/gp_markup.h>
Go to the source code of this file.
Data Structures | |
struct | gp_markup_builder |
A markup builder. More... | |
Typedefs | |
typedef struct gp_markup_builder | gp_markup_builder |
A markup builder. | |
Functions | |
static void | gp_markup_builder_glyph (gp_markup_builder *self, uint32_t glyph, uint8_t fmt, uint16_t fg_color) |
Appends a markup glyph. | |
static void | gp_markup_builder_space (gp_markup_builder *self, uint8_t fmt) |
Appends a markup space. | |
static void | gp_markup_builder_newline (gp_markup_builder *self) |
Appends a markup newline. | |
static void | gp_markup_builder_hline (gp_markup_builder *self) |
Appends a markup horizontal line. | |
static void | gp_markup_builder_finish (gp_markup_builder *self) |
Finishes a markup. | |
static gp_markup * | gp_markup_builder_alloc (gp_markup_builder *self) |
Allocates a buffer for a markup. | |
Utils for markup parsers.
These functions are designed so that the parser runs twice, the first run computers number of glyphs, then the parser allocates a buffer for the output and then finaly the markup is parsed into the allocated buffer.
Definition in file gp_markup_builder.h.
|
inlinestatic |
Allocates a buffer for a markup.
self | A markup builder. |
Definition at line 133 of file gp_markup_builder.h.
References gp_markup::glyphs.
|
inlinestatic |
Finishes a markup.
self | A markup builder. |
Definition at line 115 of file gp_markup_builder.h.
References gp_markup_glyph::fmt, and gp_markup_glyph::glyph.
|
inlinestatic |
Appends a markup glyph.
self | A markup builder. |
glyph | An unicode glyph. |
fmt | A glyph format enum gp_markup_flags. |
fg_color | A glyph color. |
Definition at line 36 of file gp_markup_builder.h.
References gp_markup_glyph::fg_color, gp_markup_glyph::fmt, and gp_markup_glyph::glyph.
|
inlinestatic |
Appends a markup horizontal line.
self | A markup builder. |
Definition at line 98 of file gp_markup_builder.h.
References gp_markup_glyph::fmt, gp_markup_glyph::glyph, and GP_MARKUP_STRIKE.
|
inlinestatic |
Appends a markup newline.
self | A markup builder. |
Definition at line 81 of file gp_markup_builder.h.
References gp_markup_glyph::fmt, and gp_markup_glyph::glyph.
|
inlinestatic |
Appends a markup space.
self | A markup builder. |
fmt | A glyph format enum gp_markup_flags. |
Definition at line 56 of file gp_markup_builder.h.
References gp_markup_glyph::fmt, and gp_markup_glyph::glyph.