aboutsummaryrefslogtreecommitdiff
path: root/src/draw.h
blob: 26bda6b15eb358582909c95e44a4e0ef24955c2d (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
35
36
37
38
39
40
41
42
43
44
#ifndef COMET_DRAW_H
#define COMET_DRAW_H

#include <glib.h>
#include <pango/pango-font.h>
#include <pango/pangocairo.h>

#include "window.h"
#include "button.h"

// The one who draws ('o')7

typedef struct {
    PangoFontDescription *desc;
    int height;
    int left_pad;
    int right_pad;
    int top_pad;
    int line_w;
    Color background;
    GList *layouts;
} Drawer;

typedef struct {
    Button *btn;
    int x, y;
    int width, height;
    int text_w, text_h;
    PangoLayout *pl;
} Layout;

Drawer *draw_create(const char *font, int height, int left_pad, int right_pad, int top_pad, int line_w);

void draw_compute_layout(Drawer *draw, Window *win, GList *btns);

void draw_paint(Drawer *draw, Window *win);

void draw_set_background(Drawer *draw, Color background);

void draw_destroy(Drawer *draw);

#endif

// vim: ts=4 sw=4 et