aboutsummaryrefslogtreecommitdiff
path: root/src/widget.c
blob: fabc67dfaca093d251035ee2ef1f55e9156e0b4e (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 *widget = malloc(sizeof(*widget));
	widget->x = 0;
	widget->y = 0;
	widget->widgets = clist_create();
	widget->draw = NULL;
	widget->dimension = cherry_dimension_new();

	return widget;
}

CherryDimension *
cherry_widget_get_dimension(CherryWidget *comp) {
	return comp->dimension;
}

void
cherry_widget_add_component(CherryWidget *parent, CherryWidget *child)
{
	clist_add(&parent->widgets, child);
}