summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpacien2018-01-09 02:15:21 +0100
committerpacien2018-01-09 02:15:21 +0100
commit5beabe1a69e6dda3e139e95d24c3e9c8e027990a (patch)
tree6a4eb07cca4c6edfbfaddeac59fed99e4230f201 /src
parent5980fa86c1fc90849102bbc24679423f978e2a50 (diff)
downloadmorpher-5beabe1a69e6dda3e139e95d24c3e9c8e027990a.tar.gz
Sources and import cleanup
Signed-off-by: pacien <pacien.trangirard@pacien.net>
Diffstat (limited to 'src')
-rw-r--r--src/common/geom.c1
-rw-r--r--src/gui/button.c9
-rw-r--r--src/gui/component.c2
-rw-r--r--src/gui/group.c11
-rw-r--r--src/gui/gui.c7
-rw-r--r--src/gui/pictureframe.c8
-rw-r--r--src/gui/window.c8
7 files changed, 19 insertions, 27 deletions
diff --git a/src/common/geom.c b/src/common/geom.c
index eb35727..f903fe8 100644
--- a/src/common/geom.c
+++ b/src/common/geom.c
@@ -1,6 +1,5 @@
1#include "common/geom.h" 1#include "common/geom.h"
2#include <math.h> 2#include <math.h>
3#include <common/geom.h>
4#include "morpher/matrix.h" 3#include "morpher/matrix.h"
5 4
6static inline IntVector int_round(RealVector x) { 5static inline IntVector int_round(RealVector x) {
diff --git a/src/gui/button.c b/src/gui/button.c
index 35ac2ed..1ed5965 100644
--- a/src/gui/button.c
+++ b/src/gui/button.c
@@ -1,12 +1,11 @@
1#include "gui/button.h"
1#include <stdlib.h> 2#include <stdlib.h>
2#include <stdbool.h> 3#include <stdbool.h>
3#include <assert.h> 4#include <assert.h>
4#include <string.h> 5#include <string.h>
5#include "gui/button.h" 6#include <MLV/MLV_all.h>
6#include "MLV/MLV_all.h"
7#include "common/mem.h" 7#include "common/mem.h"
8 8
9
10static bool button_is_selected(int x, int y, Button *button) { 9static bool button_is_selected(int x, int y, Button *button) {
11 assert(button != NULL); 10 assert(button != NULL);
12 int x1 = button->component.x_pos; 11 int x1 = button->component.x_pos;
@@ -104,8 +103,8 @@ Button *button_create(const char *text, int sizeInterligne, int x_pos, int y_pos
104 return button; 103 return button;
105} 104}
106 105
107void button_destroy(Button *button){ 106void button_destroy(Button *button) {
108 assert(button != NULL); 107 assert(button != NULL);
109 free(button->label); 108 free(button->label);
110 free(button); 109 free(button);
111} \ No newline at end of file 110}
diff --git a/src/gui/component.c b/src/gui/component.c
index 3eb31c5..c45ea4f 100644
--- a/src/gui/component.c
+++ b/src/gui/component.c
@@ -1,4 +1,4 @@
1#include <gui/component.h> 1#include "gui/component.h"
2 2
3Mode mode = WAITING_BUTTON_SHOW; 3Mode mode = WAITING_BUTTON_SHOW;
4 4
diff --git a/src/gui/group.c b/src/gui/group.c
index af9abac..7f5adcd 100644
--- a/src/gui/group.c
+++ b/src/gui/group.c
@@ -1,10 +1,8 @@
1#include <stdlib.h> 1#include "gui/group.h"
2#include <gui/group.h>
3#include <common/mem.h>
4#include <assert.h> 2#include <assert.h>
5#include <gui/component.h> 3#include <stdlib.h>
6#include "MLV/MLV_shape.h" 4#include <MLV/MLV_shape.h>
7#include "MLV/MLV_window.h" 5#include "common/mem.h"
8 6
9void group_print(Component *parameterSelf) { 7void group_print(Component *parameterSelf) {
10 assert(parameterSelf != NULL); 8 assert(parameterSelf != NULL);
@@ -84,4 +82,3 @@ void group_add_component(Group *group, Component *component) {
84 82
85 } 83 }
86} 84}
87
diff --git a/src/gui/gui.c b/src/gui/gui.c
index ced2661..bf73bdb 100644
--- a/src/gui/gui.c
+++ b/src/gui/gui.c
@@ -1,8 +1,7 @@
1#include "gui/window.h"
2#include "gui/gui.h" 1#include "gui/gui.h"
2#include <MLV/MLV_all.h>
3#include "gui/window.h"
3#include "common/mem.h" 4#include "common/mem.h"
4#include "MLV/MLV_all.h"
5
6 5
7GUI *gui_create(const char *fpath1, const char *fpath2) { 6GUI *gui_create(const char *fpath1, const char *fpath2) {
8 GUI *gui = malloc_or_die(sizeof(GUI)); 7 GUI *gui = malloc_or_die(sizeof(GUI));
@@ -134,4 +133,4 @@ void gui_destroy(GUI *gui) {
134 133
135 pictureframe_destroy(gui->pictureFrame1); 134 pictureframe_destroy(gui->pictureFrame1);
136 pictureframe_destroy(gui->pictureFrame2); 135 pictureframe_destroy(gui->pictureFrame2);
137} \ No newline at end of file 136}
diff --git a/src/gui/pictureframe.c b/src/gui/pictureframe.c
index 53a0ed3..c012ece 100644
--- a/src/gui/pictureframe.c
+++ b/src/gui/pictureframe.c
@@ -1,7 +1,7 @@
1#include "gui/pictureframe.h"
1#include <assert.h> 2#include <assert.h>
3#include <MLV/MLV_all.h>
2#include "common/mem.h" 4#include "common/mem.h"
3#include "gui/pictureframe.h"
4#include "MLV/MLV_all.h"
5 5
6static bool pictureframe_is_selected(int x, int y, PictureFrame *pictureFrame) { 6static bool pictureframe_is_selected(int x, int y, PictureFrame *pictureFrame) {
7 assert(pictureFrame != NULL); 7 assert(pictureFrame != NULL);
@@ -116,6 +116,6 @@ PictureFrame *pictureframe_create(int width, int height, int x_pos, int y_pos,
116 return pictureFrame; 116 return pictureFrame;
117} 117}
118 118
119void pictureframe_destroy(PictureFrame *pictureFrame){ 119void pictureframe_destroy(PictureFrame *pictureFrame) {
120 free(pictureFrame); 120 free(pictureFrame);
121} \ No newline at end of file 121}
diff --git a/src/gui/window.c b/src/gui/window.c
index 1859f58..e4eacea 100644
--- a/src/gui/window.c
+++ b/src/gui/window.c
@@ -1,11 +1,9 @@
1#include <stdlib.h>
2#include <assert.h>
3#include "gui/window.h" 1#include "gui/window.h"
4#include "MLV/MLV_all.h" 2#include <assert.h>
3#include <MLV/MLV_all.h>
5#include "painter/rasterizer.h" 4#include "painter/rasterizer.h"
6#include "common/mem.h" 5#include "common/mem.h"
7 6
8
9Window *window_create(int width, int height, char *title) { 7Window *window_create(int width, int height, char *title) {
10 assert(width > 0); 8 assert(width > 0);
11 assert(height > 0); 9 assert(height > 0);
@@ -83,4 +81,4 @@ void window_rendering(Window *window, PictureFrame *pictureFrame1, Canvas *canva
83 } 81 }
84 mode = EXITING; 82 mode = EXITING;
85 MLV_wait_seconds(15); 83 MLV_wait_seconds(15);
86} \ No newline at end of file 84}