From f36b910104dd6b34d42659eaa0cf63ae8b0dcc58 Mon Sep 17 00:00:00 2001 From: Alessandro Iezzi Date: Mon, 29 May 2023 22:54:23 +0200 Subject: Add new functions to CherryWidget --- src/widget.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'src/widget.c') diff --git a/src/widget.c b/src/widget.c index 6cf1b62..ccb59f1 100644 --- a/src/widget.c +++ b/src/widget.c @@ -31,8 +31,41 @@ cherry_widget_get_dimension(CherryWidget *widget, int *width, int *height) { *height = widget->height; } +void +cherry_widget_set_dimension(CherryWidget *widget, int width, int height) +{ + widget->width = width; + widget->height = height; +} + void cherry_widget_add_component(CherryWidget *parent, CherryWidget *child) { clist_add(&parent->widgets, child); } + +int +cherry_widget_is_visible(CherryWidget *widget) +{ + return widget->visible; +} + +void +cherry_widget_set_visible(CherryWidget *widget, int visible) +{ + widget->visible = visible; +} + +void +cherry_widget_get_position(CherryWidget *widget, int *x, int *y) +{ + *x = widget->x; + *y = widget->y; +} + +void +cherry_widget_set_position(CherryWidget *widget, int x, int y) +{ + widget->x = x; + widget->y = y; +} -- cgit v1.2.3