aboutsummaryrefslogtreecommitdiff
path: root/src/layout.h
blob: 4b8cddda5c506ec00c43056348c2f363ba38ddd2 (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
29
30
31
32
33
34
#ifndef COMET_LAYOUT_H
#define COMET_LAYOUT_H

#include <cairo.h>
#include <pango/pangocairo.h>
#include <pango/pango-types.h>

#include "block.h"

typedef struct {
    PangoFontDescription *fontdesc;
    PangoContext *context;
    int x_offset;
    int width, height;
} layout_info_t;

typedef struct layout {
    block_t *block;
    int x, y;
    int x_padding, y_padding;
    int width, height;
    int text_width, text_height;
    PangoLayout *pl;
    int n_children;
    struct layout **children;
} layout_t;

layout_t *layout_create(block_t *block, layout_info_t info);

void layout_render(layout_t *layout, cairo_t *cr);

void layout_free(layout_t *layout);

#endif