aboutsummaryrefslogtreecommitdiff
path: root/src/widget.c
blob: 412d7f810dc0e27c4f3d97c254a05e03cb34702b (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
29
30
31
32
33
34
/* See LICENSE file for copyright and license details. */

#include <stdlib.h>
#include "widget.h"

void
cherry_widget_draw(CherryWidget *widget)
{
}

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();
	widget->draw = cherry_widget_draw;

	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);
}