blob: f9406f1688025df2d2d925afa3ba8288f185babf (
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
|
#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;
gpointer action_data;
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, gpointer data);
void button_destroy(Button *btn);
#endif
// vim: ts=4 sw=4 et
|