From e1373af3fdded57ab4636f7e15235ccfaea27784 Mon Sep 17 00:00:00 2001 From: Alessandro Iezzi Date: Wed, 17 May 2023 11:44:41 +0200 Subject: Add dimension.c and dimension.h --- src/dimension.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/dimension.c (limited to 'src/dimension.c') diff --git a/src/dimension.c b/src/dimension.c new file mode 100644 index 0000000..aa273e8 --- /dev/null +++ b/src/dimension.c @@ -0,0 +1,28 @@ +/* See LICENSE file for copyright and license details. */ + +#include +#include "dimension.h" + +CherryDimension * +cherry_dimension_new(void) +{ + CherryDimension *dim = malloc(sizeof(*dim)); + if (dim == NULL) return NULL; + + cherry_dimension_set_width(dim, 0); + cherry_dimension_set_height(dim, 0); + + return dim; +} + +void +cherry_dimension_set_width(CherryDimension *d, int width) +{ + d->width = width; +} + +void +cherry_dimension_set_height(CherryDimension *d, int height) +{ + d->height = height; +} -- cgit v1.2.3