diff options
Diffstat (limited to 'src/dimension.c')
-rw-r--r-- | src/dimension.c | 28 |
1 files changed, 28 insertions, 0 deletions
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 <stdlib.h> +#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; +} |