EasyGUI  v0.1
Platform independent GUI Library
Widget linked list

Linked list related to widgets. More...

Macros

#define gui_linkedlist_iswidgetfirst(h)
 Check if widget is first child element in linked list. More...
 
#define gui_linkedlist_iswidgetlast(h)
 Check if widget is last child element in linked list. More...
 

Functions

void gui_linkedlist_widgetadd (GUI_HANDLE_ROOT_t *parent, GUI_HANDLE_p h)
 Add new widget to linked list of parent widget. More...
 
void gui_linkedlist_widgetremove (GUI_HANDLE_p h)
 Remove widget from linked list of parent widget. More...
 
uint8_t gui_linkedlist_widgetmoveup (GUI_HANDLE_p h)
 Move widget up for one in linked list. More...
 
uint8_t gui_linkedlist_widgetmovedown (GUI_HANDLE_p h)
 Move widget down for one in linked list. More...
 
GUI_HANDLE_p gui_linkedlist_widgetgetnext (GUI_HANDLE_ROOT_t *parent, GUI_HANDLE_p h)
 Get next widget from current widget handle. More...
 
GUI_HANDLE_p gui_linkedlist_widgetgetprev (GUI_HANDLE_ROOT_t *parent, GUI_HANDLE_p h)
 Get previous widget from current widget handle. More...
 
uint8_t gui_linkedlist_widgetmovetobottom (GUI_HANDLE_p h)
 Move widget to bottom in linked list of parent widget. More...
 
uint8_t gui_linkedlist_widgetmovetotop (GUI_HANDLE_p h)
 Move widget to top in linked list of parent widget. More...
 

Detailed Description

Linked list related to widgets.

Each widget can only be on one linked list at a time and it has static allocation of GUI_LinkedList_t structure, which simplifies linked list API management without need to allocate additinal link structure

Macro Definition Documentation

#define gui_linkedlist_iswidgetfirst (   h)

Check if widget is first child element in linked list.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in]hWidget handle
Return values
1Widget is first child
0Widget is not first child
See also
gui_linkedlist_iswidgetlast
#define gui_linkedlist_iswidgetlast (   h)

Check if widget is last child element in linked list.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in]hWidget handle
Return values
1Widget is last child
0Widget is not last child
See also
gui_linkedlist_iswidgetfirst

Function Documentation

void gui_linkedlist_widgetadd ( GUI_HANDLE_ROOT_t root,
GUI_HANDLE_p  h 
)

Add new widget to linked list of parent widget.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in]*rootPointer to parent widget where to put this widget on list
[in]hWidget handle to add to list
Return values
None
See also
gui_linkedlist_widgetremove
GUI_HANDLE_p gui_linkedlist_widgetgetnext ( GUI_HANDLE_ROOT_t parent,
GUI_HANDLE_p  h 
)

Get next widget from current widget handle.

Note
With combination of input parameters, function acts different:
parent h gui_linkedlist_widgetgetnext(parent, h)
0 0 0
0 > 0 Next widget of h if exists, 0 otherwise
> 0 0 First widget in parent list if exists, 0 otherwise
> 0 > 0 Next widget of h if exists, first widget of parent if exists, 0 otherwise
Since this function is private, it can only be used by user inside GUI library
//Get all widgets of parent widget from first to last
//Parent object must have GUI_HANDLE_ROOT_t data type
void LoopWidgets(GUI_HANDLE_p parent) {
GUI_HANDLE_p h; //Value holding widgets of parent
for (h = gui_linkedlist_widgetgetnext((GUI_HANDLE_ROOT_t *)parent, NULL); h; h = gui_linkedlist_widgetgetnext(NULL, h)) {
//Loop through each widget of parent
}
}
Parameters
[in]*parentParent widget object for which you want to get first widget
[in]hWidget handle for which you want next widget
Return values
>0: Next widget in linked list
0No widget in linked list anymore
See also
gui_linkedlist_widgetgetprev
GUI_HANDLE_p gui_linkedlist_widgetgetprev ( GUI_HANDLE_ROOT_t parent,
GUI_HANDLE_p  h 
)

Get previous widget from current widget handle.

Note
With combination of input parameters, function acts different:
parent h gui_linkedlist_widgetgetprev(parent, h)
0 0 0
0 > 0 Previous widget of h if exists, 0 otherwise
> 0 0 Last widget in parent list if exists, 0 otherwise
> 0 > 0 Previous widget of h if exists, last widget of parent if exists, 0 otherwise
Since this function is private, it can only be used by user inside GUI library
//Get all widgets of parent widget in reverse order from last to first
//Parent object must have GUI_HANDLE_ROOT_t data type
void LoopWidgets(GUI_HANDLE_p parent) {
GUI_HANDLE_p h; //Value holding widgets of parent
//Loop through each widget of parent
}
}
Parameters
[in]*parentParent widget object for which you want to get first widget
[in]hWidget handle for which you want next widget
Return values
>0: Next widget in linked list
0No widget in linked list anymore
See also
gui_linkedlist_widgetgetnext
uint8_t gui_linkedlist_widgetmovedown ( GUI_HANDLE_p  h)

Move widget down for one in linked list.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in]hWidget handle to move down
Return values
1Move has been successful
0Move was not successful. Widget is on bottom and cannot be moved
See also
gui_linkedlist_widgetmoveup
uint8_t gui_linkedlist_widgetmovetobottom ( GUI_HANDLE_p  h)

Move widget to bottom in linked list of parent widget.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in]hWidget to move to bottom
Return values
1Widget moved to bottom
0Widget is already at bottom
See also
gui_linkedlist_widgetmovetotop
uint8_t gui_linkedlist_widgetmovetotop ( GUI_HANDLE_p  h)

Move widget to top in linked list of parent widget.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in]hWidget to move to top
Return values
1Widget moved to top
0Widget is already on top
See also
gui_linkedlist_widgetmovetobottom
uint8_t gui_linkedlist_widgetmoveup ( GUI_HANDLE_p  h)

Move widget up for one in linked list.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in]hWidget handle to move up
Return values
1Move has been successful
0Move was not successful. Widget is on top and cannot be moved
See also
gui_linkedlist_widgetmovedown
void gui_linkedlist_widgetremove ( GUI_HANDLE_p  h)

Remove widget from linked list of parent widget.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in]hWidget handle to remove from linked list
Return values
None
See also
gui_linkedlist_widgetadd