aboutsummaryrefslogtreecommitdiff
path: root/src/button.h
blob: 7def0b3f2a9c4f8ef1bafd6173311868532f84b3 (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
#ifndef COMET_BUTTON_H
#define COMET_BUTTON_H

#include <stdbool.h>
#include <pango/pangocairo.h>

// TODO: Generic button shapes/actions

typedef struct Button Button;

typedef void (* ButtonAction)(Button *btn);

typedef struct {
    double r, g, b, a;
} Color;

struct Button {
    ButtonAction action;
    char *text;
    PangoAlignment align;
    Color background;
    Color foreground;
    Color stroke;
};

Button *button_create(const char *text, PangoAlignment align);

void button_set_colors(Button *btn, Color background, Color foreground, Color stroke);

void button_set_action(Button *btn, ButtonAction action);

void button_destroy(Button *btn);

#endif

// vim: ts=4 sw=4 et