summaryrefslogtreecommitdiff
path: root/include/gui/component.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/gui/component.h')
-rw-r--r--include/gui/component.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/include/gui/component.h b/include/gui/component.h
new file mode 100644
index 0000000..d61b713
--- /dev/null
+++ b/include/gui/component.h
@@ -0,0 +1,45 @@
1#ifndef UPEM_C_COMPONENT_H
2#define UPEM_C_COMPONENT_H
3
4/**
5 * File: component.h
6 * Windows and components handling.
7 *
8 * See also:
9 * The famous OS
10 */
11
12#include "group.h"
13
14/**
15 * Type: ClickHandler
16 * Type of functions that handle mouse's clicks.
17 */
18typedef void (*ClickHandler)(int x_pos, int y_pos);
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 * Struct: Component
28 * Represents an abstract module handling clicks and a way to be print on the screen.
29 *
30 * Fields:
31 * width - width of the component
32 * height - height of the component
33 * x_pos - position on the x axis from the origin meant to be placed in top left
34 * y_pos - position on the y axis from the origin meant to be placed in top left
35 * click_handler - pointer of function that is called on mouse click
36 * print_method - pointer of function that handle the component's print
37 */
38typedef struct {
39 int width, height;
40 int x_pos, y_pos;
41 ClickHandler click_handler;
42 PrintMethod print_method;
43} Component;
44
45#endif //UPEM_C_COMPONENT_H