diff options
Diffstat (limited to 'src/button.h')
| -rw-r--r-- | src/button.h | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/src/button.h b/src/button.h deleted file mode 100644 index 4b6c834..0000000 --- a/src/button.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef COMET_BUTTON_H -#define COMET_BUTTON_H - -#include <stdbool.h> -#include <glib.h> -#include <pango/pangocairo.h> - -#include "draw.h" -#include "animate.h" - -// For pointers only -#define CAST(ptr, type) ((type *)ptr) - -typedef struct Button Button; - -typedef void (* ButtonAction)(Button *btn); - -struct Button { - bool simple; - int x_pad; - int y_pad; - PangoAlignment align; - Color color; - Color line_color; - int line_width; - int max_width; - int min_width; - // TODO: Make animations not depend on the button - Animation *anim; -}; - -typedef struct { - Button btn; - Color text_color; - char *text; - ButtonAction action; - gpointer data; -} ButtonSimple; - -typedef struct { - Button btn; - GList *children; -} ButtonGroup; - -// NOTE: For the moment all button specific functions take a generic button -// pointer and assert the right type, so the check should be done by the caller - -Button *button_simple_create(PangoAlignment align, Color color); - -// Takes ownership of text -void button_simple_set_text(Button *btn, char *text, Color text_color); - -const char *button_simple_get_text(Button *btn); - -void button_simple_set_action(Button *btn, ButtonAction action, gpointer data); - -ButtonAction button_simple_get_action(Button *btn); - -Button *button_group_create(PangoAlignment align, Color color); - -void button_group_append(Button *btn, Button *child); - -void button_set_padding(Button *btn, int x_pad, int y_pad); - -bool button_set_animation(Button *btn, Animation *anim); - -void button_set_line(Button *btn, Color line_color, int line_width); - -void button_set_width(Button *btn, int max, int min); - -Button *button_copy(Button *btn); - -void button_destroy(Button *btn); - -#endif - -// vim: ts=4 sw=4 et |
