axle OS
x86_32 UNIX-like hobby OS
src
gfx
lib
view.h
1
#ifndef VIEW_H
2
#define VIEW_H
3
4
#include <std/std_base.h>
5
#include <stdint.h>
6
#include <std/array_m.h>
7
#include "color.h"
8
#include "rect.h"
9
#include "bmp.h"
10
#include "label.h"
11
#include "window.h"
12
13
__BEGIN_DECLS
14
15
typedef
struct
view
{
16
//common
17
Rect
frame;
18
char
needs_redraw;
19
ca_layer* layer;
20
struct
view
*superview;
21
array_m
* subviews;
22
23
Color
background_color;
24
array_m
* labels;
25
array_m
* bmps;
26
array_m
* shaders;
27
array_m
* buttons;
28
} View;
29
30
View* create_view(
Rect
frame);
31
void
draw_view(View*
view
);
32
void
view_teardown(View*
view
);
33
34
void
set_background_color(View*
view
,
Color
color
);
35
void
set_frame(View*
view
,
Rect
frame);
36
void
set_alpha(View*
view
,
float
alpha);
37
38
void
add_subview(View*
view
, View* subview);
39
void
remove_subview(View*
view
, View* subview);
40
41
void
add_sublabel(View*
view
, Label*
label
);
42
void
remove_sublabel(View*
view
, Label* sublabel);
43
44
void
add_bmp(View*
view
, Bmp* bmp);
45
void
remove_bmp(View*
view
, Bmp* bmp);
46
47
typedef
struct
button
Button;
48
void
add_button(View*
view
, Button*
button
);
49
void
remove_button(View*
view
, Button*
button
);
50
51
void
mark_needs_redraw(View*
view
);
52
53
//convert frame to view's coordinate space
54
Rect
convert_frame(View*
view
,
Rect
frame);
55
56
__END_DECLS
57
58
#endif
label
Definition:
label.h:12
color
Definition:
color.h:7
button
Definition:
button.h:15
rect
Definition:
rect.h:14
array_m
Definition:
array_m.h:14
view
Definition:
view.h:15
Generated by
1.8.14