diff options
Diffstat (limited to 'include/gui/window.h')
-rw-r--r-- | include/gui/window.h | 44 |
1 files changed, 39 insertions, 5 deletions
diff --git a/include/gui/window.h b/include/gui/window.h index 9394c84..defc6f7 100644 --- a/include/gui/window.h +++ b/include/gui/window.h | |||
@@ -3,24 +3,58 @@ | |||
3 | 3 | ||
4 | /** | 4 | /** |
5 | * File: window.h | 5 | * File: window.h |
6 | * Windows and components handling. | ||
7 | * | ||
8 | * See also: | ||
9 | * The famous OS | ||
6 | */ | 10 | */ |
7 | 11 | ||
8 | typedef void (*ClickHandler)(int x_pos, int y_pos); | 12 | typedef void (*ClickHandler)(int x_pos, int y_pos); |
9 | 13 | /** | |
14 | * Type: Component | ||
15 | * Abstract component that handles clicks. | ||
16 | */ | ||
10 | typedef struct { | 17 | typedef struct { |
11 | int width, height; | 18 | int width, height; |
12 | ClickHandler click_handler; | 19 | ClickHandler click_handler; |
13 | } Component; | 20 | } Component; |
14 | 21 | /** | |
22 | * Type: Window | ||
23 | * Supports and handles components. | ||
24 | */ | ||
15 | typedef struct { | 25 | typedef struct { |
16 | int width, height; | 26 | int width, height; |
17 | Component *components; | 27 | Component *components; |
18 | } Window; | 28 | } Window; |
19 | 29 | /** | |
30 | * Function: window_init | ||
31 | * Initializes a window. | ||
32 | * | ||
33 | * Parameters: | ||
34 | * *window - pointer to the input window | ||
35 | * width - width of the window to initialize | ||
36 | * height - height of the window to initialize | ||
37 | * *title - title of the actual window | ||
38 | */ | ||
20 | void window_init(Window *window, int width, int height, char *title); | 39 | void window_init(Window *window, int width, int height, char *title); |
21 | 40 | /** | |
41 | * Function: window_free | ||
42 | * Frees the resources supported by the window and the window itself. | ||
43 | * | ||
44 | * Parameters: | ||
45 | * *window - pointer to the input window | ||
46 | */ | ||
22 | void window_free(Window *window); | 47 | void window_free(Window *window); |
23 | 48 | /** | |
49 | * Function: window_add_component | ||
50 | * Adds components to the current window at the position specified in x and y. | ||
51 | * | ||
52 | * Parameters: | ||
53 | * *window - pointer to the input window | ||
54 | * *component - pointer to the input component | ||
55 | * x_pos - coordinate on x axis to place the component | ||
56 | * y_pos - coordinate on y axis to place the component | ||
57 | */ | ||
24 | void window_add_component(Window *window, Component *component, int x_pos, int y_pos); | 58 | void window_add_component(Window *window, Component *component, int x_pos, int y_pos); |
25 | 59 | ||
26 | #endif | 60 | #endif |