diff options
author | Adam NAILI | 2018-01-09 12:48:19 +0100 |
---|---|---|
committer | Adam NAILI | 2018-01-09 12:48:19 +0100 |
commit | 02d84427f1c70b2e410b733adae22f2d33ad0f73 (patch) | |
tree | 0fe286c9378968a0aebccf67ee8911869f882452 | |
parent | dbfc65079ae57bab49fd98f887766897f82f7a69 (diff) | |
download | morpher-02d84427f1c70b2e410b733adae22f2d33ad0f73.tar.gz |
Deleting test files from GUI that require human action and can't be to others computers due to paths
-rw-r--r-- | test/gui/button.c | 30 | ||||
-rw-r--r-- | test/gui/group.c | 39 | ||||
-rw-r--r-- | test/gui/pictureframe.c | 105 | ||||
-rw-r--r-- | test/gui/window.c | 15 |
4 files changed, 0 insertions, 189 deletions
diff --git a/test/gui/button.c b/test/gui/button.c deleted file mode 100644 index a436c75..0000000 --- a/test/gui/button.c +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | #include <gui/group.h> | ||
2 | #include <gui/window.h> | ||
3 | #include <gui/button.h> | ||
4 | #include <gui/component.h> | ||
5 | #include "MLV/MLV_all.h" | ||
6 | |||
7 | |||
8 | static void test_button() { | ||
9 | /* Window window; | ||
10 | window_init(&window, 1000, 512, "Coucou"); | ||
11 | window_create(&window); | ||
12 | Button button1; | ||
13 | button_init(&button1, "OK", 10, 500, 256, button_click_test); | ||
14 | button1.component.print_method(&button1); | ||
15 | int mouse_x; | ||
16 | int mouse_y; | ||
17 | while (1) { | ||
18 | if (MLV_get_mouse_button_state(MLV_BUTTON_LEFT) == MLV_PRESSED) { | ||
19 | MLV_get_mouse_position(&mouse_x, &mouse_y); | ||
20 | button1.component.click_handler(mouse_x, mouse_y, &(button1.component)); | ||
21 | } | ||
22 | }*/ | ||
23 | /*MLV_wait_seconds(10); | ||
24 | window_destroy(&window);*/ | ||
25 | } | ||
26 | |||
27 | int main() { | ||
28 | test_button(); | ||
29 | return 0; | ||
30 | } \ No newline at end of file | ||
diff --git a/test/gui/group.c b/test/gui/group.c deleted file mode 100644 index b645d26..0000000 --- a/test/gui/group.c +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | #include <gui/group.h> | ||
2 | #include <gui/window.h> | ||
3 | #include "MLV/MLV_all.h" | ||
4 | |||
5 | |||
6 | static void test_group() { | ||
7 | /*Window window; | ||
8 | window_init(&window, 1000, 512, "Coucou"); | ||
9 | window_create(&window); | ||
10 | |||
11 | Button button1; | ||
12 | Button button2; | ||
13 | Button button3; | ||
14 | |||
15 | button_init(&button1, "OK", 10, 500, 256, button_click_test); | ||
16 | button_init(&button2,"Bouton magique",10, 500,290, button_click_test); | ||
17 | button_init(&button3,"Très lonnggggg boooouttttooooon",10,0,0,button_click_test); | ||
18 | |||
19 | window_add_button(&window,&button1); | ||
20 | window_add_button(&window,&button2); | ||
21 | window_add_button(&window,&button3); | ||
22 | |||
23 | window_print_buttons(&window); | ||
24 | int mouse_x; | ||
25 | int mouse_y; | ||
26 | while(1){ | ||
27 | if (MLV_get_mouse_button_state(MLV_BUTTON_LEFT) == MLV_PRESSED) { | ||
28 | MLV_get_mouse_position(&mouse_x, &mouse_y); | ||
29 | group_click_handler(mouse_x,mouse_y,&(window.group_buttons->component)); | ||
30 | } | ||
31 | } | ||
32 | MLV_wait_seconds(15); | ||
33 | window_destroy(&window);*/ | ||
34 | } | ||
35 | |||
36 | int main() { | ||
37 | test_group(); | ||
38 | return 0; | ||
39 | } \ No newline at end of file | ||
diff --git a/test/gui/pictureframe.c b/test/gui/pictureframe.c deleted file mode 100644 index f1d90df..0000000 --- a/test/gui/pictureframe.c +++ /dev/null | |||
@@ -1,105 +0,0 @@ | |||
1 | #include "gui/component.h" | ||
2 | #include "gui/window.h" | ||
3 | #include "common/mem.h" | ||
4 | |||
5 | extern Mode mode; | ||
6 | |||
7 | static void test_pictureframe() { | ||
8 | Window *window = window_create(1005, 512, "Coucou"); | ||
9 | |||
10 | sprintf(labelFrame, "%03d frames", frame); | ||
11 | Button *button1 = button_create("Add constraint point", 10, 0, 0, button_click_add_constraint); | ||
12 | Button *button2 = button_create("Show/Hide", 10, 0, 0, button_click_show_hide); | ||
13 | Button *button3 = button_create("Start rendering", 10, 0, 0, button_click_rendering); | ||
14 | Button *button4 = button_create("<<<", 10, 0, 0, button_click_less_frame); | ||
15 | Button *button5 = button_create(labelFrame, 10, 0, 0, button_click_none); | ||
16 | Button *button6 = button_create(">>>", 10, 0, 0, button_click_more_frame); | ||
17 | Button *button7 = button_create("Exit", 10, 0, 0, button_click_exit); | ||
18 | |||
19 | |||
20 | Morphing *morphing = morphing_create(500, 250); | ||
21 | Canvas *canvasSrc = canvas_create_from_image("/home/adam/Images/goku.png"); | ||
22 | Canvas *canvasTarget = canvas_create_from_image("/home/adam/Images/marty.jpg"); | ||
23 | |||
24 | PictureFrame *pictureFrame1 = pictureframe_create(500, 250, 0, 0, pictureframe_origin_split, morphing, canvasSrc, | ||
25 | pictureframe_click_handler_origin); | ||
26 | PictureFrame *pictureFrame2 = pictureframe_create(500, 250, 0, 0, pictureframe_target_split, morphing, canvasTarget, | ||
27 | pictureframe_click_handler_target); | ||
28 | |||
29 | window_add_pictureframe(window, pictureFrame1); | ||
30 | window_add_pictureframe(window, pictureFrame2); | ||
31 | |||
32 | window_add_button(window, button1); | ||
33 | window_add_button(window, button2); | ||
34 | window_add_button(window, button3); | ||
35 | window_add_button(window, button4); | ||
36 | window_add_button(window, button5); | ||
37 | window_add_button(window, button6); | ||
38 | window_add_button(window, button7); | ||
39 | |||
40 | |||
41 | window_print_buttons(window); | ||
42 | window_print_pictureframes(window); | ||
43 | |||
44 | MLV_Keyboard_button keyboardButton; | ||
45 | MLV_Keyboard_modifier keyboardModifier; | ||
46 | int unicode; | ||
47 | int mouse_x; | ||
48 | int mouse_y; | ||
49 | |||
50 | while (mode != EXITING) { | ||
51 | window_click_keyboard_handler(window, &keyboardButton, &keyboardModifier, &unicode, &mouse_x, &mouse_y); | ||
52 | switch (mode) { | ||
53 | case PRINTING: | ||
54 | window_print_pictureframes(window); | ||
55 | mode = WAITING_BUTTON_SHOW; | ||
56 | break; | ||
57 | case WAITING_BUTTON_SHOW: | ||
58 | window_print_pictureframes(window); | ||
59 | break; | ||
60 | case WAITING_BUTTON_HIDE: | ||
61 | window_print_pictureframes(window); | ||
62 | break; | ||
63 | case PRINTING_BUTTONS: | ||
64 | free(button5->label); | ||
65 | button5->label = malloc_or_die(sizeof(char) * (strlen(labelFrame) + 1)); | ||
66 | strcpy(button5->label, labelFrame); | ||
67 | window_print_buttons(window); | ||
68 | mode = WAITING_BUTTON_SHOW; | ||
69 | break; | ||
70 | case RENDERING: | ||
71 | window_rendering(window, pictureFrame1, canvasSrc, canvasTarget, morphing); | ||
72 | break; | ||
73 | case INSERT_TARGET: | ||
74 | if (keyboardButton == MLV_KEYBOARD_ESCAPE) { | ||
75 | window_print_pictureframes(window); | ||
76 | mode = WAITING_BUTTON_SHOW; | ||
77 | } | ||
78 | break; | ||
79 | default: | ||
80 | break; | ||
81 | } | ||
82 | } | ||
83 | |||
84 | button_destroy(button1); | ||
85 | button_destroy(button2); | ||
86 | button_destroy(button3); | ||
87 | button_destroy(button4); | ||
88 | button_destroy(button5); | ||
89 | button_destroy(button6); | ||
90 | button_destroy(button7); | ||
91 | |||
92 | pictureframe_destroy(pictureFrame1); | ||
93 | pictureframe_destroy(pictureFrame2); | ||
94 | |||
95 | canvas_destroy(canvasSrc); | ||
96 | canvas_destroy(canvasTarget); | ||
97 | morphing_destroy(morphing); | ||
98 | |||
99 | window_destroy(window); | ||
100 | } | ||
101 | |||
102 | int main() { | ||
103 | test_pictureframe(); | ||
104 | return 0; | ||
105 | } \ No newline at end of file | ||
diff --git a/test/gui/window.c b/test/gui/window.c deleted file mode 100644 index 3156989..0000000 --- a/test/gui/window.c +++ /dev/null | |||
@@ -1,15 +0,0 @@ | |||
1 | #include "gui/window.h" | ||
2 | #include "MLV/MLV_all.h" | ||
3 | |||
4 | static void test_window() { | ||
5 | /*Window window; | ||
6 | window_init(&window, 1000, 512, "Coucou"); | ||
7 | window_create(&window); | ||
8 | MLV_wait_seconds(150); | ||
9 | window_destroy(&window);*/ | ||
10 | } | ||
11 | |||
12 | int main() { | ||
13 | test_window(); | ||
14 | return 0; | ||
15 | } \ No newline at end of file | ||