diff options
author | pacien | 2017-12-04 16:21:26 +0100 |
---|---|---|
committer | pacien | 2017-12-04 16:21:26 +0100 |
commit | cc1f6d08e843a2d80e7d536ff71535aaca15f318 (patch) | |
tree | 5291adbec612109da3a3641050dd9dc492093bb1 | |
parent | c202e46b001238de48b500c55f7392c53655d140 (diff) | |
download | morpher-cc1f6d08e843a2d80e7d536ff71535aaca15f318.tar.gz |
Add GUI spec draft
Signed-off-by: pacien <pacien.trangirard@pacien.net>
-rw-r--r-- | include/gui/button.h | 16 | ||||
-rw-r--r-- | include/gui/group.h | 19 | ||||
-rw-r--r-- | include/gui/pictureframe.h | 22 | ||||
-rw-r--r-- | include/gui/textview.h | 20 | ||||
-rw-r--r-- | include/gui/window.h | 26 |
5 files changed, 103 insertions, 0 deletions
diff --git a/include/gui/button.h b/include/gui/button.h new file mode 100644 index 0000000..62f75a3 --- /dev/null +++ b/include/gui/button.h | |||
@@ -0,0 +1,16 @@ | |||
1 | #ifndef UPEM_MORPHING_BUTTON | ||
2 | #define UPEM_MORPHING_BUTTON | ||
3 | |||
4 | /** | ||
5 | * File: button.h | ||
6 | */ | ||
7 | |||
8 | typedef struct { | ||
9 | Component component; | ||
10 | } Button; | ||
11 | |||
12 | void button_init(Button *button, char *text); | ||
13 | |||
14 | void button_free(Button *button); | ||
15 | |||
16 | #endif | ||
diff --git a/include/gui/group.h b/include/gui/group.h new file mode 100644 index 0000000..6914d55 --- /dev/null +++ b/include/gui/group.h | |||
@@ -0,0 +1,19 @@ | |||
1 | #ifndef UPEM_MORPHING_GROUP | ||
2 | #define UPEM_MORPHING_GROUP | ||
3 | |||
4 | /** | ||
5 | * File: group.h | ||
6 | */ | ||
7 | |||
8 | typedef struct { | ||
9 | Component component; | ||
10 | Component *sub_components; | ||
11 | } Group; | ||
12 | |||
13 | void group_init(Group *group, int padding); | ||
14 | |||
15 | void group_free(Group *group); | ||
16 | |||
17 | void group_add_component(Group *group, Component *component); | ||
18 | |||
19 | #endif | ||
diff --git a/include/gui/pictureframe.h b/include/gui/pictureframe.h new file mode 100644 index 0000000..59aaf3b --- /dev/null +++ b/include/gui/pictureframe.h | |||
@@ -0,0 +1,22 @@ | |||
1 | #ifndef UPEM_MORPHING_PITUREFRAME | ||
2 | #define UPEM_MORPHING_PITUREFRAME | ||
3 | |||
4 | /** | ||
5 | * File: pictureframe.h | ||
6 | */ | ||
7 | |||
8 | typedef struct { | ||
9 | Component component; | ||
10 | } PictureFrame; | ||
11 | |||
12 | void pictureframe_init(PictureFrame *pictureFrame, int length); | ||
13 | |||
14 | void pictureframe_free(PictureFrame *pictureFrame); | ||
15 | |||
16 | void pictureframe_draw_canvas(PictureFrame *pictureFrame, Canvas *canvas); | ||
17 | |||
18 | void pictureframe_draw_triangulation(PictureFrame *pictureFrame, void *triangulation); | ||
19 | |||
20 | void pictureframe_draw_point(PictureFrame *pictureFrame, int x_pos, int y_pos); | ||
21 | |||
22 | #endif | ||
diff --git a/include/gui/textview.h b/include/gui/textview.h new file mode 100644 index 0000000..7a07eb3 --- /dev/null +++ b/include/gui/textview.h | |||
@@ -0,0 +1,20 @@ | |||
1 | #ifndef UPEM_MORPHING_TEXTVIEW | ||
2 | #define UPEM_MORPHING_TEXTVIEW | ||
3 | |||
4 | /** | ||
5 | * File: textview.h | ||
6 | */ | ||
7 | |||
8 | typedef struct { | ||
9 | Component component; | ||
10 | int length; | ||
11 | char *text; | ||
12 | } TextView; | ||
13 | |||
14 | void textview_init(TextView *textview, int length); | ||
15 | |||
16 | void textview_free(TextView *textview); | ||
17 | |||
18 | void textview_set_text(TextView *textView, char *text); | ||
19 | |||
20 | #endif | ||
diff --git a/include/gui/window.h b/include/gui/window.h new file mode 100644 index 0000000..9394c84 --- /dev/null +++ b/include/gui/window.h | |||
@@ -0,0 +1,26 @@ | |||
1 | #ifndef UPEM_MORPHING_WINDOW | ||
2 | #define UPEM_MORPHING_WINDOW | ||
3 | |||
4 | /** | ||
5 | * File: window.h | ||
6 | */ | ||
7 | |||
8 | typedef void (*ClickHandler)(int x_pos, int y_pos); | ||
9 | |||
10 | typedef struct { | ||
11 | int width, height; | ||
12 | ClickHandler click_handler; | ||
13 | } Component; | ||
14 | |||
15 | typedef struct { | ||
16 | int width, height; | ||
17 | Component *components; | ||
18 | } Window; | ||
19 | |||
20 | void window_init(Window *window, int width, int height, char *title); | ||
21 | |||
22 | void window_free(Window *window); | ||
23 | |||
24 | void window_add_component(Window *window, Component *component, int x_pos, int y_pos); | ||
25 | |||
26 | #endif | ||