diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/pictureframe.c | 45 |
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 | |||
5 | CartesianVector pictureframe_origin_split(const CartesianMapping *cartesianMapping) { | ||
6 | |||
7 | } | ||
8 | |||
9 | CartesianVector pictureframe_target_split(const CartesianMapping *cartesianMapping) { | ||
10 | |||
11 | } | ||
12 | |||
13 | void 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 | |||
21 | void pictureframe_click_handler(int x_pos, int y_pos, Component *parameterSelf) { | ||
22 | printf("ClickHandler pictureframe activated \n"); | ||
23 | } | ||
24 | |||
25 | void 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 | ||