aboutsummaryrefslogtreecommitdiff
path: root/src/widget.c
blob: e734cb6ee88710e7a24d48ca434a7dbc9e763aa9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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);
}