From 0a52cd20ba690303958c29e94ef526442789effa Mon Sep 17 00:00:00 2001 From: Adam NAILI Date: Wed, 6 Dec 2017 21:02:36 +0100 Subject: Update doc on window.h --- include/gui/window.h | 44 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 5 deletions(-) (limited to 'include') 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 @@ /** * File: window.h + * Windows and components handling. + * + * See also: + * The famous OS */ typedef void (*ClickHandler)(int x_pos, int y_pos); - +/** + * Type: Component + * Abstract component that handles clicks. + */ typedef struct { int width, height; ClickHandler click_handler; } Component; - +/** + * Type: Window + * Supports and handles components. + */ typedef struct { int width, height; Component *components; } Window; - +/** + * Function: window_init + * Initializes a window. + * + * Parameters: + * *window - pointer to the input window + * width - width of the window to initialize + * height - height of the window to initialize + * *title - title of the actual window + */ void window_init(Window *window, int width, int height, char *title); - +/** + * Function: window_free + * Frees the resources supported by the window and the window itself. + * + * Parameters: + * *window - pointer to the input window + */ void window_free(Window *window); - +/** + * Function: window_add_component + * Adds components to the current window at the position specified in x and y. + * + * Parameters: + * *window - pointer to the input window + * *component - pointer to the input component + * x_pos - coordinate on x axis to place the component + * y_pos - coordinate on y axis to place the component + */ void window_add_component(Window *window, Component *component, int x_pos, int y_pos); #endif -- cgit v1.2.3