EasyGUI  Version v1.0
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...
 
#define GUI_LINKEDLIST_WIDGETSLISTNEXT(parent, current)   for ((current) = gui_linkedlist_widgetgetnext((parent), NULL); (current) != NULL; (current) = gui_linkedlist_widgetgetnext(NULL, (current)))
 
#define GUI_LINKEDLIST_WIDGETSLISTPREV(parent, current)   for ((current) = gui_linkedlist_widgetgetprev((parent), NULL); (current) != NULL; (current) = gui_linkedlist_widgetgetprev(NULL, (current)))
 

Functions

void gui_linkedlist_widgetadd (gui_handle_p 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_p parent, gui_handle_p h)
 Get next widget from current widget handle. More...
 
gui_handle_p gui_linkedlist_widgetgetprev (gui_handle_p 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

◆ gui_linkedlist_iswidgetfirst

#define gui_linkedlist_iswidgetfirst (   h)

Check if widget is first child element in linked list.

Note
The function is private and can be called only when GUI protection against multiple access is activated
Parameters
[in]hWidget handle
Returns
1 on success, 0 otherwise

◆ gui_linkedlist_iswidgetlast

#define gui_linkedlist_iswidgetlast (   h)

Check if widget is last child element in linked list.

Note
The function is private and can be called only when GUI protection against multiple access is activated
Parameters
[in]hWidget handle
Returns
1 on success, 0 otherwise

Function Documentation

◆ gui_linkedlist_widgetadd()

void gui_linkedlist_widgetadd ( gui_handle_p  parent,
gui_handle_p  h 
)

Add new widget to linked list of parent widget.

Note
This function is private and may be called only when OS protection is active
Parameters
[in]parentPointer to parent widget where to put this widget on list
[in]hWidget handle to add to list
See also
gui_linkedlist_widgetremove

◆ gui_linkedlist_widgetgetnext()

gui_handle_p gui_linkedlist_widgetgetnext ( gui_handle_p  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)
NULL NULL NULL
NULL != NULL Next widget of h if exists, NULL otherwise
!= NULL NULL First widget in parent list if exists, NULL otherwise
!= NULL != NULL Next widget of h if exists, first widget of parent if exists, NULL otherwise
This function is private and may be called only when OS protection is active
Parameters
[in]parentParent widget object for which you want to get first widget
[in]hWidget handle for which you want next widget
Returns
Previous widget on linked list on success, NULL otherwise
See also
gui_linkedlist_widgetgetprev

◆ gui_linkedlist_widgetgetprev()

gui_handle_p gui_linkedlist_widgetgetprev ( gui_handle_p  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)
NULL NULL NULL
NULL != NULL Previous widget of h if exists, NULL otherwise
!= NULL NULL Last widget in parent list if exists, NULL otherwise
!= NULL != NULL Previous widget of h if exists, last widget of parent if exists, NULL otherwise
This function is private and may be called only when OS protection is active
Parameters
[in]parentParent widget object for which you want to get first widget
[in]hWidget handle for which you want next widget
Returns
Next widget on linked list on success, NULL otherwise
See also
gui_linkedlist_widgetgetnext

◆ gui_linkedlist_widgetmovedown()

uint8_t gui_linkedlist_widgetmovedown ( gui_handle_p  h)

Move widget down for one in linked list.

Note
This function is private and may be called only when OS protection is active
Parameters
[in]hWidget handle to move down
Returns
1 on success, 0 otherwise
See also
gui_linkedlist_widgetmoveup

◆ gui_linkedlist_widgetmovetobottom()

uint8_t gui_linkedlist_widgetmovetobottom ( gui_handle_p  h)

Move widget to bottom in linked list of parent widget.

Note
This function is private and may be called only when OS protection is active
Parameters
[in]hWidget to move to bottom
Returns
Number of moves on linked list, 0 if move not available
See also
gui_linkedlist_widgetmovetotop

◆ gui_linkedlist_widgetmovetotop()

uint8_t gui_linkedlist_widgetmovetotop ( gui_handle_p  h)

Move widget to top in linked list of parent widget.

Note
This function is private and may be called only when OS protection is active
Parameters
[in]hWidget to move to top
Returns
Number of moves on linked list, 0 if move not available
See also
gui_linkedlist_widgetmovetobottom

◆ gui_linkedlist_widgetmoveup()

uint8_t gui_linkedlist_widgetmoveup ( gui_handle_p  h)

Move widget up for one in linked list.

Note
This function is private and may be called only when OS protection is active
Parameters
[in]hWidget handle to move up
Returns
1 on success, 0 otherwise
See also
gui_linkedlist_widgetmovedown

◆ gui_linkedlist_widgetremove()

void gui_linkedlist_widgetremove ( gui_handle_p  h)

Remove widget from linked list of parent widget.

Note
This function is private and may be called only when OS protection is active
Parameters
[in]hWidget handle to remove from linked list
See also
gui_linkedlist_widgetadd