From 5beabe1a69e6dda3e139e95d24c3e9c8e027990a Mon Sep 17 00:00:00 2001 From: pacien Date: Tue, 9 Jan 2018 02:15:21 +0100 Subject: Sources and import cleanup Signed-off-by: pacien --- include/common/time.h | 2 +- include/gui/button.h | 8 +++----- include/gui/component.h | 2 +- include/gui/group.h | 3 +-- include/gui/pictureframe.h | 8 +++++--- include/gui/textview.h | 3 ++- include/gui/window.h | 8 ++++---- src/common/geom.c | 1 - src/gui/button.c | 9 ++++----- src/gui/component.c | 2 +- src/gui/group.c | 11 ++++------- src/gui/gui.c | 7 +++---- src/gui/pictureframe.c | 8 ++++---- src/gui/window.c | 8 +++----- 14 files changed, 36 insertions(+), 44 deletions(-) diff --git a/include/common/time.h b/include/common/time.h index bd50533..3024cde 100644 --- a/include/common/time.h +++ b/include/common/time.h @@ -11,7 +11,7 @@ * Pacien TRAN-GIRARD */ -#include "geom.h" +#include "common/geom.h" /** * Constants: Time vectors diff --git a/include/gui/button.h b/include/gui/button.h index c447328..1b82a7f 100644 --- a/include/gui/button.h +++ b/include/gui/button.h @@ -1,5 +1,6 @@ #ifndef UPEM_MORPHING_BUTTON #define UPEM_MORPHING_BUTTON + /** * File: button.h * Buttons handling @@ -8,7 +9,7 @@ * Adam NAILI */ -#include "component.h" +#include "gui/component.h" /** * Struct: Button @@ -39,8 +40,7 @@ typedef struct { * Returns: * A pointer of Button */ -Button * -button_create(const char *text, int sizeInterligne, int x_pos, int y_pos, ClickHandler clickHandler); +Button *button_create(const char *text, int sizeInterligne, int x_pos, int y_pos, ClickHandler clickHandler); /** * Function: button_destroy @@ -95,7 +95,6 @@ void button_click_exit(int x, int y, Component *parameterSelf); */ void button_click_none(int x, int y, Component *parameterSelf); - /** * Function: button_click_more_frame * Multiplies by two the number of frames to create when rendering. @@ -129,5 +128,4 @@ void button_click_less_frame(int x, int y, Component *parameterSelf); */ void button_click_rendering(int x, int y, Component *parameterSelf); - #endif diff --git a/include/gui/component.h b/include/gui/component.h index f545bbc..895e9ba 100644 --- a/include/gui/component.h +++ b/include/gui/component.h @@ -67,4 +67,4 @@ typedef struct Component { PrintMethod print_method; } Component; -#endif //UPEM_C_COMPONENT_H +#endif diff --git a/include/gui/group.h b/include/gui/group.h index 1006c74..19dd319 100644 --- a/include/gui/group.h +++ b/include/gui/group.h @@ -9,7 +9,7 @@ * Adam NAILI */ -#include "component.h" +#include "gui/component.h" /** * Struct: _GroupElement @@ -93,5 +93,4 @@ void group_free(Group *group); */ void group_add_component(Group *group, Component *component); - #endif diff --git a/include/gui/pictureframe.h b/include/gui/pictureframe.h index f6edbf6..0432b1c 100644 --- a/include/gui/pictureframe.h +++ b/include/gui/pictureframe.h @@ -8,11 +8,14 @@ * Adam NAILI */ +#include "gui/component.h" #include "morpher/morphing.h" #include "painter/canvas.h" -#include "component.h" -/*Needed storage point to share memory between the origin PictureFrame and the target PictureFrame. It ables to cancel the Add constraint functionality*/ +/* + * Needed storage point to share memory between the origin PictureFrame and the target PictureFrame. + * It ables to cancel the Add constraint functionality + */ CartesianVector savedPoint; /** @@ -118,5 +121,4 @@ void pictureframe_click_handler_origin(int x_pos, int y_pos, Component *paramete */ void pictureframe_click_handler_target(int x_pos, int y_pos, Component *parameterSelf); - #endif diff --git a/include/gui/textview.h b/include/gui/textview.h index 91106c0..ff41e7e 100644 --- a/include/gui/textview.h +++ b/include/gui/textview.h @@ -7,7 +7,8 @@ * Author: * Adam NAILI */ -#include "component.h" + +#include "gui/component.h" typedef struct { Component component; diff --git a/include/gui/window.h b/include/gui/window.h index 612da28..c3da3e4 100644 --- a/include/gui/window.h +++ b/include/gui/window.h @@ -9,10 +9,10 @@ * Adam NAILI */ -#include "MLV/MLV_keyboard.h" -#include "group.h" -#include "button.h" -#include "pictureframe.h" +#include +#include "gui/group.h" +#include "gui/button.h" +#include "gui/pictureframe.h" /** * Struct: Window 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 @@ #include "common/geom.h" #include -#include #include "morpher/matrix.h" static 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 @@ +#include "gui/button.h" #include #include #include #include -#include "gui/button.h" -#include "MLV/MLV_all.h" +#include #include "common/mem.h" - static bool button_is_selected(int x, int y, Button *button) { assert(button != NULL); int x1 = button->component.x_pos; @@ -104,8 +103,8 @@ Button *button_create(const char *text, int sizeInterligne, int x_pos, int y_pos return button; } -void button_destroy(Button *button){ +void button_destroy(Button *button) { assert(button != NULL); free(button->label); free(button); -} \ No newline at end of file +} 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 @@ -#include +#include "gui/component.h" Mode mode = WAITING_BUTTON_SHOW; 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 @@ -#include -#include -#include +#include "gui/group.h" #include -#include -#include "MLV/MLV_shape.h" -#include "MLV/MLV_window.h" +#include +#include +#include "common/mem.h" void group_print(Component *parameterSelf) { assert(parameterSelf != NULL); @@ -84,4 +82,3 @@ void group_add_component(Group *group, Component *component) { } } - 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 @@ -#include "gui/window.h" #include "gui/gui.h" +#include +#include "gui/window.h" #include "common/mem.h" -#include "MLV/MLV_all.h" - GUI *gui_create(const char *fpath1, const char *fpath2) { GUI *gui = malloc_or_die(sizeof(GUI)); @@ -134,4 +133,4 @@ void gui_destroy(GUI *gui) { pictureframe_destroy(gui->pictureFrame1); pictureframe_destroy(gui->pictureFrame2); -} \ No newline at end of file +} 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 @@ +#include "gui/pictureframe.h" #include +#include #include "common/mem.h" -#include "gui/pictureframe.h" -#include "MLV/MLV_all.h" static bool pictureframe_is_selected(int x, int y, PictureFrame *pictureFrame) { assert(pictureFrame != NULL); @@ -116,6 +116,6 @@ PictureFrame *pictureframe_create(int width, int height, int x_pos, int y_pos, return pictureFrame; } -void pictureframe_destroy(PictureFrame *pictureFrame){ +void pictureframe_destroy(PictureFrame *pictureFrame) { free(pictureFrame); -} \ No newline at end of file +} 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 @@ -#include -#include #include "gui/window.h" -#include "MLV/MLV_all.h" +#include +#include #include "painter/rasterizer.h" #include "common/mem.h" - Window *window_create(int width, int height, char *title) { assert(width > 0); assert(height > 0); @@ -83,4 +81,4 @@ void window_rendering(Window *window, PictureFrame *pictureFrame1, Canvas *canva } mode = EXITING; MLV_wait_seconds(15); -} \ No newline at end of file +} -- cgit v1.2.3