diff options
author | 2023-05-25 22:36:03 +0200 | |
---|---|---|
committer | 2023-05-25 22:36:03 +0200 | |
commit | 8373306fd753fad74e9d51061825544e5ae794e4 (patch) | |
tree | cb835e492fb1284f647d44c14b5d14af5e2bfac7 | |
parent | a4382713e7ba7b3651b2cb321034009f6f8bb525 (diff) | |
download | cherry-8373306fd753fad74e9d51061825544e5ae794e4.tar.gz cherry-8373306fd753fad74e9d51061825544e5ae794e4.zip |
Add widget.c
-rw-r--r-- | src/widget.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/widget.c b/src/widget.c new file mode 100644 index 0000000..e734cb6 --- /dev/null +++ b/src/widget.c @@ -0,0 +1,28 @@ +/* See LICENSE file for copyright and license details. */ + +#include <stdlib.h> +#include "widget.h" + +CherryWidget * +cherry_widget_new(void) +{ + CherryWidget *comp = malloc(sizeof(*comp)); + comp->x = 0; + comp->y = 0; + comp->components = clist_create(); + comp->draw = NULL; + comp->dimension = cherry_dimension_new(); + + return comp; +} + +CherryDimension * +cherry_widget_get_dimension(CherryWidget *comp) { + return comp->dimension; +} + +void +cherry_widget_add_component(CherryWidget *parent, CherryWidget *child) +{ + clist_add(&parent->components, child); +} |