From 45800d79fb2fd74542daeda29e2cb2467f46399a Mon Sep 17 00:00:00 2001 From: Adam NAILI Date: Tue, 12 Dec 2017 13:09:53 +0100 Subject: Reworking on the _GroupElement structure and updating doc --- include/gui/group.h | 41 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/include/gui/group.h b/include/gui/group.h index 1887bf6..88fffbc 100644 --- a/include/gui/group.h +++ b/include/gui/group.h @@ -9,15 +9,14 @@ /** * Struct: _GroupElement - * Nod of the linked list that is involved in the Group behavior + * Node of the linked list that is involved in the Group behavior * * Parameters: * *component - component * *sub_component - sub component - * *next - link to the next nod + * *next - link to the next node */ typedef struct _GroupElement { - Component *component; Component *sub_component; struct _GroupElement *next; } GroupElement; @@ -37,10 +36,46 @@ typedef struct { int padding; } Group; +/** + * Function: group_print + * Print method for a group (BETA VERSION). + * + * Parameters: + * *parameter - pointer that will be casted into a Group to print + */ +void group_print(void *parameter); + +/** + * Function: group_init + * Initializes fields of a Group that must be allocated before. + * + * Parameters: + * *group - group that must be initialized + * width - width of the current group + * height - height of the current group + * x_pos - position on the x axis from the upper left corner + * y_pos - position on the y axis from the upper left corner + * padding - space between each components + */ void group_init(Group *group, int width, int height, int x_pos, int y_pos, int padding); +/** + * Function: group_free + * Frees the resources held by the group like the linked list. + * + * Parameters: + * *group - group that must be freed + */ void group_free(Group *group); +/** + * Function: group_add_component + * Adds the component at the end of the chained list held by group_head. + * + * Parameters: + * *group - group in which we add the component + * *component - component which is added to the group + */ void group_add_component(Group *group, Component *component); #endif -- cgit v1.2.3