summaryrefslogtreecommitdiff
path: root/src/gmdocument.h
blob: dfad1d468b41252d9cb09a7a9f77f60c9443ba15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#pragma once

#include "gemini.h"
#include <the_Foundation/object.h>
#include <the_Foundation/rect.h>
#include <the_Foundation/string.h>

iDeclareType(GmRun)

struct Impl_GmRun {
    iRangecc text;
    iRect bounds; /* advance metrics */
    uint8_t font;
    uint8_t color;
    uint16_t linkId;
};

iDeclareType(GmDocument)
iDeclareClass(GmDocument)

iDeclareObjectConstruction(GmDocument)

void    setWidth_GmDocument     (iGmDocument *, int width);
void    setSource_GmDocument    (iGmDocument *, const iString *source, int width);

typedef void (*iGmDocumentRenderFunc)(void *, const iGmRun *);

void    render_GmDocument       (const iGmDocument *, iRangei visRangeY, iGmDocumentRenderFunc render, void *);