axle OS
x86_32 UNIX-like hobby OS
button.h
1 #ifndef BUTTON_H
2 #define BUTTON_H
3 
4 #include <std/std_base.h>
5 #include <stdint.h>
6 #include "gfx.h"
7 #include "color.h"
8 #include "rect.h"
9 #include "ca_layer.h"
10 #include "label.h"
11 #include <stdbool.h>
12 
13 __BEGIN_DECLS
14 
15 typedef struct button {
16  //common
17  Rect frame;
18  char needs_redraw;
19  ca_layer* layer;
20  struct view* superview;
21  event_handler mousedown_handler;
22  event_handler mouseup_handler;
23 
24  bool toggled;
25  Label* label;
26 } Button;
27 
28 Button* create_button(Rect frame, char* text);
29 void draw_button(ca_layer* dest, Button* button);
30 
31 void button_handle_click();
32 
33 //internal functions to process clicks on buttons
34 //should only be used by window manager to inform button of state change
35 void button_handle_mousedown(Button* button);
36 void button_handle_mouseup(Button* button);
37 
38 __END_DECLS
39 
40 #endif
Definition: label.h:12
Definition: button.h:15
Definition: rect.h:14
Definition: view.h:15