GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
include
utils
gp_markup.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: LGPL-2.1-or-later
2
/*
3
* Copyright (C) 2022-2023 Cyril Hrubis <metan@ucw.cz>
4
*/
5
11
#ifndef UTILS_GP_MARKUP_H
12
#define UTILS_GP_MARKUP_H
13
14
#include <stdint.h>
15
#include <stddef.h>
16
22
enum
gp_markup_flags
{
24
GP_MARKUP_BOLD
= 0x01,
26
GP_MARKUP_LARGE
= 0x02,
28
GP_MARKUP_MONO
= 0x04,
30
GP_MARKUP_SUB
= 0x08,
32
GP_MARKUP_SUP
= 0x10,
34
GP_MARKUP_UNDERLINE
= 0x20,
36
GP_MARKUP_STRIKE
= 0x40,
37
};
38
44
enum
gp_markup_color
{
46
GP_MARKUP_DEFAULT
= 0x00,
47
/* 16 colors */
48
GP_MARKUP_RED,
49
GP_MARKUP_GREEN,
50
GP_MARKUP_YELLOW,
51
GP_MARKUP_BLUE,
52
GP_MARKUP_MAGENTA,
53
GP_MARKUP_CYAN,
54
GP_MARKUP_GRAY,
55
GP_MARKUP_BR_RED,
56
GP_MARKUP_BR_GREEN,
57
GP_MARKUP_BR_YELLOW,
58
GP_MARKUP_BR_BLUE,
59
GP_MARKUP_BR_MAGENTA,
60
GP_MARKUP_BR_CYAN,
61
GP_MARKUP_WHITE,
62
};
63
67
typedef
struct
gp_markup_glyph
{
69
uint32_t
glyph
;
75
uint16_t
fmt
;
76
union
{
82
uint16_t
fg_color
;
83
int16_t space_padd;
84
};
85
}
gp_markup_glyph
;
86
97
typedef
struct
gp_markup
{
103
uint32_t
glyph_cnt
;
109
gp_markup_glyph
glyphs
[];
110
}
gp_markup
;
111
117
void
gp_markup_dump
(
gp_markup
*self);
118
119
#endif
/* UTILS_GP_MARKUP_H */
gp_markup_color
gp_markup_color
A markup color.
Definition
gp_markup.h:44
GP_MARKUP_DEFAULT
@ GP_MARKUP_DEFAULT
Definition
gp_markup.h:46
gp_markup_flags
gp_markup_flags
Markup format flags.
Definition
gp_markup.h:22
GP_MARKUP_SUP
@ GP_MARKUP_SUP
Definition
gp_markup.h:32
GP_MARKUP_SUB
@ GP_MARKUP_SUB
Definition
gp_markup.h:30
GP_MARKUP_BOLD
@ GP_MARKUP_BOLD
Definition
gp_markup.h:24
GP_MARKUP_MONO
@ GP_MARKUP_MONO
Definition
gp_markup.h:28
GP_MARKUP_LARGE
@ GP_MARKUP_LARGE
Definition
gp_markup.h:26
GP_MARKUP_STRIKE
@ GP_MARKUP_STRIKE
Definition
gp_markup.h:36
GP_MARKUP_UNDERLINE
@ GP_MARKUP_UNDERLINE
Definition
gp_markup.h:34
gp_markup_dump
void gp_markup_dump(gp_markup *self)
Dumps markup into the stdout, this is just for debugging.
gp_markup_glyph
A markup glyph.
Definition
gp_markup.h:67
gp_markup_glyph::fmt
uint16_t fmt
A text format.
Definition
gp_markup.h:75
gp_markup_glyph::glyph
uint32_t glyph
An unicode glyph.
Definition
gp_markup.h:69
gp_markup_glyph::fg_color
uint16_t fg_color
A text color.
Definition
gp_markup.h:82
gp_markup
A text markup.
Definition
gp_markup.h:97
gp_markup::glyph_cnt
uint32_t glyph_cnt
Number of glyphs.
Definition
gp_markup.h:103
gp_markup::glyphs
gp_markup_glyph glyphs[]
An array of glyphs.
Definition
gp_markup.h:109
Generated by
1.9.8