summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAdam NAILI2017-12-06 21:02:36 +0100
committerAdam NAILI2017-12-06 21:02:36 +0100
commit0a52cd20ba690303958c29e94ef526442789effa (patch)
treeb0eaf2ea781e4ac370b8b0b5d0a15e9979d64f80 /include
parentcc1f6d08e843a2d80e7d536ff71535aaca15f318 (diff)
downloadmorpher-0a52cd20ba690303958c29e94ef526442789effa.tar.gz
Update doc on window.h
Diffstat (limited to 'include')
-rw-r--r--include/gui/window.h44
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
8typedef void (*ClickHandler)(int x_pos, int y_pos); 12typedef void (*ClickHandler)(int x_pos, int y_pos);
9 13/**
14 * Type: Component
15 * Abstract component that handles clicks.
16 */
10typedef struct { 17typedef 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 */
15typedef struct { 25typedef 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 */
20void window_init(Window *window, int width, int height, char *title); 39void 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 */
22void window_free(Window *window); 47void 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 */
24void window_add_component(Window *window, Component *component, int x_pos, int y_pos); 58void window_add_component(Window *window, Component *component, int x_pos, int y_pos);
25 59
26#endif 60#endif