summaryrefslogtreecommitdiff
path: root/include/gui
diff options
context:
space:
mode:
authorpacien2017-12-04 16:21:26 +0100
committerpacien2017-12-04 16:21:26 +0100
commitcc1f6d08e843a2d80e7d536ff71535aaca15f318 (patch)
tree5291adbec612109da3a3641050dd9dc492093bb1 /include/gui
parentc202e46b001238de48b500c55f7392c53655d140 (diff)
downloadmorpher-cc1f6d08e843a2d80e7d536ff71535aaca15f318.tar.gz
Add GUI spec draft
Signed-off-by: pacien <pacien.trangirard@pacien.net>
Diffstat (limited to 'include/gui')
-rw-r--r--include/gui/button.h16
-rw-r--r--include/gui/group.h19
-rw-r--r--include/gui/pictureframe.h22
-rw-r--r--include/gui/textview.h20
-rw-r--r--include/gui/window.h26
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
8typedef struct {
9 Component component;
10} Button;
11
12void button_init(Button *button, char *text);
13
14void 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
8typedef struct {
9 Component component;
10 Component *sub_components;
11} Group;
12
13void group_init(Group *group, int padding);
14
15void group_free(Group *group);
16
17void 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
8typedef struct {
9 Component component;
10} PictureFrame;
11
12void pictureframe_init(PictureFrame *pictureFrame, int length);
13
14void pictureframe_free(PictureFrame *pictureFrame);
15
16void pictureframe_draw_canvas(PictureFrame *pictureFrame, Canvas *canvas);
17
18void pictureframe_draw_triangulation(PictureFrame *pictureFrame, void *triangulation);
19
20void 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
8typedef struct {
9 Component component;
10 int length;
11 char *text;
12} TextView;
13
14void textview_init(TextView *textview, int length);
15
16void textview_free(TextView *textview);
17
18void 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
8typedef void (*ClickHandler)(int x_pos, int y_pos);
9
10typedef struct {
11 int width, height;
12 ClickHandler click_handler;
13} Component;
14
15typedef struct {
16 int width, height;
17 Component *components;
18} Window;
19
20void window_init(Window *window, int width, int height, char *title);
21
22void window_free(Window *window);
23
24void window_add_component(Window *window, Component *component, int x_pos, int y_pos);
25
26#endif