summaryrefslogtreecommitdiff
path: root/src/gmdocument.h
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-07-21 22:26:40 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-07-21 22:26:40 +0300
commit896c024b4ff1a44affe3d749e09e7b7e8c31970c (patch)
tree78f8c81d30b5ac0d8143fd142b40a82ab7db4508 /src/gmdocument.h
parentd623d42d937d8e7f90deda3f49fe1eb680a7b15e (diff)
Added GmDocument; very basic layout and render
Diffstat (limited to 'src/gmdocument.h')
-rw-r--r--src/gmdocument.h28
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
8iDeclareType(GmRun)
9
10struct Impl_GmRun {
11 iRangecc text;
12 iRect bounds; /* advance metrics */
13 uint8_t font;
14 uint8_t color;
15 uint16_t linkId;
16};
17
18iDeclareType(GmDocument)
19iDeclareClass(GmDocument)
20
21iDeclareObjectConstruction(GmDocument)
22
23void setWidth_GmDocument (iGmDocument *, int width);
24void setSource_GmDocument (iGmDocument *, const iString *source, int width);
25
26typedef void (*iGmDocumentRenderFunc)(void *, const iGmRun *);
27
28void render_GmDocument (const iGmDocument *, iRangei visRangeY, iGmDocumentRenderFunc render, void *);