diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-07-21 22:26:40 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-07-21 22:26:40 +0300 |
commit | 896c024b4ff1a44affe3d749e09e7b7e8c31970c (patch) | |
tree | 78f8c81d30b5ac0d8143fd142b40a82ab7db4508 /src/gmdocument.h | |
parent | d623d42d937d8e7f90deda3f49fe1eb680a7b15e (diff) |
Added GmDocument; very basic layout and render
Diffstat (limited to 'src/gmdocument.h')
-rw-r--r-- | src/gmdocument.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/gmdocument.h b/src/gmdocument.h new file mode 100644 index 00000000..dfad1d46 --- /dev/null +++ b/src/gmdocument.h | |||
@@ -0,0 +1,28 @@ | |||
1 | #pragma once | ||
2 | |||
3 | #include "gemini.h" | ||
4 | #include <the_Foundation/object.h> | ||
5 | #include <the_Foundation/rect.h> | ||
6 | #include <the_Foundation/string.h> | ||
7 | |||
8 | iDeclareType(GmRun) | ||
9 | |||
10 | struct Impl_GmRun { | ||
11 | iRangecc text; | ||
12 | iRect bounds; /* advance metrics */ | ||
13 | uint8_t font; | ||
14 | uint8_t color; | ||
15 | uint16_t linkId; | ||
16 | }; | ||
17 | |||
18 | iDeclareType(GmDocument) | ||
19 | iDeclareClass(GmDocument) | ||
20 | |||
21 | iDeclareObjectConstruction(GmDocument) | ||
22 | |||
23 | void setWidth_GmDocument (iGmDocument *, int width); | ||
24 | void setSource_GmDocument (iGmDocument *, const iString *source, int width); | ||
25 | |||
26 | typedef void (*iGmDocumentRenderFunc)(void *, const iGmRun *); | ||
27 | |||
28 | void render_GmDocument (const iGmDocument *, iRangei visRangeY, iGmDocumentRenderFunc render, void *); | ||