From 2f3d8ebc9b5e10e56bed5da316f5ef098dda0997 Mon Sep 17 00:00:00 2001 From: Adam NAILI Date: Wed, 3 Jan 2018 19:40:51 +0100 Subject: Updating documentation, cleaning includes, updating report --- include/gui/window.h | 62 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 25 deletions(-) (limited to 'include/gui/window.h') diff --git a/include/gui/window.h b/include/gui/window.h index 10f0e74..e6b14dc 100644 --- a/include/gui/window.h +++ b/include/gui/window.h @@ -1,20 +1,15 @@ #ifndef UPEM_MORPHING_WINDOW #define UPEM_MORPHING_WINDOW +#include "MLV/MLV_keyboard.h" +#include "group.h" +#include "button.h" +#include "pictureframe.h" /** * File: window.h * Windows and components handling. - * - * See also: - * The famous OS */ -#include -#include "group.h" -#include "component.h" -#include "button.h" -#include "pictureframe.h" - /** * Struct: Window * Supports and handles components. @@ -34,25 +29,26 @@ typedef struct { } Window; /** - * Function: window_init - * Initializes a window. + * Function: window_create + * Allocates and initializes a window. * * Parameters: - * *window - pointer to the input window * width - width of the window to initialize * height - height of the window to initialize * *title - title of the actual window + * Returns: + * A pointer to a Window */ -void window_init(Window *window, int width, int height, char *title); +Window *window_create(int width, int height, char *title); /** - * Function: window_free + * Function: window_destroy * Frees the resources supported by the window and the window itself. * * Parameters: * *window - pointer to the input window */ -void window_free(Window *window); +void window_destroy(Window *window); /** * Function: window_add_button @@ -74,15 +70,6 @@ void window_add_button(Window *window, Button *button); */ void window_add_pictureframe(Window *window, PictureFrame *pictureFrame); -/** - * Function: window_create - * Initializes the resources to create a window. - * - * Parameters: - * *window - pointer to the input window - */ -void window_create(Window *window); - /** * Function: window_print_buttons * Prints all the buttons to the screen @@ -101,9 +88,34 @@ void window_print_buttons(Window *window); */ void window_print_pictureframes(Window *window); +/** + * Function: window_click_keyboard_handler + * Handles click and keyboard. + * + * Parameters: + * *window - pointer to the current window + * *keyboardButton - code of the keyboard key that is pushed or released + * *keyboardModifier - mode of the keyboard when a key is push or released + * *unicode - character coded in unicode of the letter obtained by combining the code and the mode + * *mouse_x - coordinate on the X axis of the mouse + * *mouse_y - coordinate on the Y axis of the mouse + */ void window_click_keyboard_handler(Window *window, MLV_Keyboard_button *keyboardButton, MLV_Keyboard_modifier *keyboardModifier, int *unicode, int *mouse_x, int *mouse_y); -void window_rendering(Window *window,PictureFrame *pictureFrame1,Canvas *canvasSrc, Canvas *canvasTarget, Morphing *morphing); + +/** + * Function: window_rendering + * Launches the rendering on the pictureframe origin. + * + * Parameters: + * *window - pointer to the current window + * *pictureFrame1 - pointer to the origin PictureFrame + * *canvasSrc - pointer to the source Canvas + * *canvasTarget - pointer to the target Canvas + * *morphing - pointer to the Morphing that will makes the transformation + */ +void window_rendering(Window *window, PictureFrame *pictureFrame1, Canvas *canvasSrc, Canvas *canvasTarget, + Morphing *morphing); #endif -- cgit v1.2.3