summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAdam NAILI2017-12-28 16:22:43 +0100
committerAdam NAILI2017-12-28 16:22:43 +0100
commitaaf57e5ee1e0cf74afdbdf56293f1afd7e79e6b0 (patch)
tree6526fefe48549d97368aa882d862bbf468426c9e /src/gui
parent46fecbfedfc61658caeb721565fd36f49c0d3db9 (diff)
downloadmorpher-aaf57e5ee1e0cf74afdbdf56293f1afd7e79e6b0.tar.gz
Reworking signatures of pictureframe function, beginning of implementation, debug tests
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/pictureframe.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/gui/pictureframe.c b/src/gui/pictureframe.c
new file mode 100644
index 0000000..543ba4c
--- /dev/null
+++ b/src/gui/pictureframe.c
@@ -0,0 +1,45 @@
1#include <assert.h>
2#include <gui/pictureframe.h>
3#include <MLV/MLV_all.h>
4
5CartesianVector pictureframe_origin_split(const CartesianMapping *cartesianMapping) {
6
7}
8
9CartesianVector pictureframe_target_split(const CartesianMapping *cartesianMapping) {
10
11}
12
13void pictureframe_print(Component *parameterSelf) {
14 PictureFrame *self = (PictureFrame *) parameterSelf;
15 /*DEBUG*/
16 MLV_draw_filled_rectangle(self->component.x_pos, self->component.y_pos, self->component.width, self->component.height,
17 MLV_COLOR_RED);
18 /**/
19}
20
21void pictureframe_click_handler(int x_pos, int y_pos, Component *parameterSelf) {
22 printf("ClickHandler pictureframe activated \n");
23}
24
25void pictureframe_init(PictureFrame *pictureFrame, int width, int height, int x_pos, int y_pos,
26 CartesianMappingDivision cartesianMappingDivision, Morphing *morphing, Canvas *canvas) {
27 assert(pictureFrame != NULL);
28 assert(width > 0);
29 assert(height > 0);
30 assert(x_pos >= 0);
31 assert(y_pos >= 0);
32 assert(cartesianMappingDivision != NULL);
33 assert(morphing != NULL);
34 assert(canvas != NULL);
35 pictureFrame->component.width = width;
36 pictureFrame->component.height = height;
37 pictureFrame->component.x_pos = x_pos;
38 pictureFrame->component.y_pos = y_pos;
39 pictureFrame->component.activated = true;
40 pictureFrame->component.print_method = pictureframe_print;
41 pictureFrame->component.click_handler = pictureframe_click_handler;
42 pictureFrame->morphing = morphing;
43 pictureFrame->canvas = canvas;
44 pictureFrame->cartesianMappingDivision = cartesianMappingDivision;
45} \ No newline at end of file