summaryrefslogtreecommitdiff
path: root/include/gui/pictureframe.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/gui/pictureframe.h')
-rw-r--r--include/gui/pictureframe.h52
1 files changed, 29 insertions, 23 deletions
diff --git a/include/gui/pictureframe.h b/include/gui/pictureframe.h
index 7b9644e..a070190 100644
--- a/include/gui/pictureframe.h
+++ b/include/gui/pictureframe.h
@@ -1,14 +1,17 @@
1#ifndef UPEM_MORPHING_PITUREFRAME 1#ifndef UPEM_MORPHING_PITUREFRAME
2#define UPEM_MORPHING_PITUREFRAME 2#define UPEM_MORPHING_PITUREFRAME
3 3
4#include <morpher/morphing.h> 4#include "morpher/morphing.h"
5#include <painter/canvas.h> 5#include "painter/canvas.h"
6#include "component.h" 6#include "component.h"
7
7/** 8/**
8 * File: pictureframe.h 9 * File: pictureframe.h
9 */ 10 */
10 11
12/*Needed storage point to share memory between the origin PictureFrame and the target PictureFrame. It ables to cancel the Add constraint functionality*/
11CartesianVector savedPoint; 13CartesianVector savedPoint;
14
12/** 15/**
13 * Type: CartesianMappingDivision 16 * Type: CartesianMappingDivision
14 * Type of functions needed to split CartesianMapping and keep only the CartesianVector needed, related to the type of PictureFrame involved 17 * Type of functions needed to split CartesianMapping and keep only the CartesianVector needed, related to the type of PictureFrame involved
@@ -50,24 +53,35 @@ CartesianVector pictureframe_origin_split(const CartesianMapping *cartesianMappi
50 */ 53 */
51CartesianVector pictureframe_target_split(const CartesianMapping *cartesianMapping); 54CartesianVector pictureframe_target_split(const CartesianMapping *cartesianMapping);
52 55
53bool pictureframe_is_selected(int x, int y, PictureFrame *pictureFrame);
54
55/** 56/**
56 * Function: pictureframe_conversion_to_origin 57 * Function: pictureframe_create
57 * Returns the relative coordinate on the picture corresponding to the input values 58 * Allocates and initializes the PictureFrame.
58 * 59 *
59 * Parameters: 60 * Parameters:
60 * x - value on x axis from the origin of the window to convert 61 * width - width of the current picture
61 * y - value on y axis from the origin of the window to convert 62 * height - height of the current picture
62 * *pictureFrame - pointer to the reference pictureframe that will give his relative coordinates 63 * x_pos - position of the button on x axis
64 * y_pos - position of the button on y axis
65 * cartesianMappingDivision - pointer of function needed to select the right CartesianVector inside the morphing's CartesianMapping
66 * *morphing - pointer to the morphing
67 * *canvas - pointer to the canvas
68 * clickHandler - pointer of function that will be loaded inside our pictureframe
69 *
70 * Returns:
71 * A pointer of PictureFrame
63 */ 72 */
64CartesianVector pictureframe_conversion_to_pic(int x, int y, PictureFrame *pictureFrame); 73PictureFrame *pictureframe_create(int width, int height, int x_pos, int y_pos,
74 CartesianMappingDivision cartesianMappingDivision, Morphing *morphing, Canvas *canvas,
75 ClickHandler clickHandler);
65 76
66CartesianVector pictureframe_conversion_to_origin(int x, int y, PictureFrame *pictureFrame); 77/**
67 78 * Function: pictureframe_destroy
68void pictureframe_init(PictureFrame *pictureFrame, int width, int height, int x_pos, int y_pos, 79 * Frees the current PictureFrame
69 CartesianMappingDivision cartesianMappingDivision, Morphing *morphing, Canvas *canvas, 80 *
70 ClickHandler clickHandler); 81 * Parameters:
82 * *pictureframe - pointer to the current PictureFrame
83 */
84void pictureframe_destroy(PictureFrame *pictureFrame);
71 85
72/** 86/**
73 * Function: pictureframe_draw_canvas 87 * Function: pictureframe_draw_canvas
@@ -78,14 +92,6 @@ void pictureframe_init(PictureFrame *pictureFrame, int width, int height, int x_
78 */ 92 */
79void pictureframe_draw_canvas(PictureFrame *pictureFrame); 93void pictureframe_draw_canvas(PictureFrame *pictureFrame);
80 94
81/**
82 * Function: pictureframe_print
83 * Prints the PictureFrame (The Canvas involved, plus the triangles and points of the Morphing)
84 *
85 * Parameters:
86 * *parameterSelf - pointer that will be casted into a PictureFrame to be printed
87 */
88void pictureframe_print(Component *parameterSelf);
89 95
90/** 96/**
91 * Function: pictureframe_click_handler_origin 97 * Function: pictureframe_click_handler_origin