aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlessandro Iezzi <aiezzi@alessandroiezzi.it>2023-05-29 22:52:57 +0200
committerAlessandro Iezzi <aiezzi@alessandroiezzi.it>2023-05-29 22:52:57 +0200
commit5797c9c8f631d87aac9d2d080e0e5eb7fea67c36 (patch)
tree9908903fe9b70f277ce6809eb5199b3ef060d476 /src
parent33b5b26cf52b6a64b291b98908dee6e664218536 (diff)
downloadcherry-5797c9c8f631d87aac9d2d080e0e5eb7fea67c36.tar.gz
cherry-5797c9c8f631d87aac9d2d080e0e5eb7fea67c36.zip
Replace CherryDimension with width and height
Diffstat (limited to 'src')
-rw-r--r--src/widget.c10
-rw-r--r--src/widget.h4
2 files changed, 8 insertions, 6 deletions
diff --git a/src/widget.c b/src/widget.c
index 8d6e91f..6cf1b62 100644
--- a/src/widget.c
+++ b/src/widget.c
@@ -17,16 +17,18 @@ cherry_widget_new(void)
widget->x = 0;
widget->y = 0;
widget->widgets = clist_create();
- widget->dimension = cherry_dimension_new();
+ widget->width = 0;
+ widget->height = 0;
widget->visible = 0;
widget->draw = cherry_widget_draw;
return widget;
}
-CherryDimension *
-cherry_widget_get_dimension(CherryWidget *comp) {
- return comp->dimension;
+void
+cherry_widget_get_dimension(CherryWidget *widget, int *width, int *height) {
+ *width = widget->width;
+ *height = widget->height;
}
void
diff --git a/src/widget.h b/src/widget.h
index 41fff22..c7cc757 100644
--- a/src/widget.h
+++ b/src/widget.h
@@ -9,7 +9,7 @@
/* The parent of all widgets */
typedef struct CherryWidget {
int x, y; /* Coordinates */
- CherryDimension *dimension; /* Size of the widget */
+ int width, height; /* Size of the widget */
int visible; /* Is this visible? */
list_t widgets; /* A list of children widgets */
int drawn; /* Set to 1 when draw() is called */
@@ -23,6 +23,6 @@ typedef struct CherryWidget {
} CherryWidget;
CherryWidget *cherry_widget_new(void);
-CherryDimension *cherry_widget_get_dimension(CherryWidget *);
+void cherry_widget_get_dimension(CherryWidget *, int *, int *);
#endif /* __CHERRY_WIDGET_H__ */