summaryrefslogtreecommitdiff
path: root/include/gui/window.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/gui/window.h')
-rw-r--r--include/gui/window.h58
1 files changed, 55 insertions, 3 deletions
diff --git a/include/gui/window.h b/include/gui/window.h
index 9394c84..6ccf00a 100644
--- a/include/gui/window.h
+++ b/include/gui/window.h
@@ -3,24 +3,76 @@
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
12#include "group.h"
13
14/**
15 * Type: ClickHandler
16 * Type of functions that handle mouse's clicks.
17 */
8typedef void (*ClickHandler)(int x_pos, int y_pos); 18typedef void (*ClickHandler)(int x_pos, int y_pos);
9 19
20/**
21 * Type: PrintMethod
22 * Type of functions that will be used to print our component. This must be initialized by the initialization function of the component.
23 */
24typedef void (*PrintMethod)(void);
25
26/**
27 * Type: Component
28 * Abstract component that handles clicks.
29 */
10typedef struct { 30typedef struct {
11 int width, height; 31 int width, height;
32 int x_pos, y_pos;
12 ClickHandler click_handler; 33 ClickHandler click_handler;
34 PrintMethod print_method;
13} Component; 35} Component;
14 36/**
37 * Type: Window
38 * Supports and handles components.
39 */
15typedef struct { 40typedef struct {
16 int width, height; 41 int width, height;
17 Component *components; 42 Group *group_buttons;
43 Group *group_images;
18} Window; 44} Window;
19 45
46/**
47 * Function: window_init
48 * Initializes a window.
49 *
50 * Parameters:
51 * *window - pointer to the input window
52 * width - width of the window to initialize
53 * height - height of the window to initialize
54 * *title - title of the actual window
55 */
20void window_init(Window *window, int width, int height, char *title); 56void window_init(Window *window, int width, int height, char *title);
21 57
58/**
59 * Function: window_free
60 * Frees the resources supported by the window and the window itself.
61 *
62 * Parameters:
63 * *window - pointer to the input window
64 */
22void window_free(Window *window); 65void window_free(Window *window);
23 66
24void window_add_component(Window *window, Component *component, int x_pos, int y_pos); 67/**
68 * Function: window_add_component
69 * Adds components to the current window at the position specified in x and y.
70 *
71 * Parameters:
72 * *window - pointer to the input window
73 * *component - pointer to the input component
74 */
75void window_add_component(Window *window, Component *component);
76
25 77
26#endif 78#endif