EasyGUI  v0.1
Platform independent GUI Library
Private functions

Private widget functions and enumerations. More...

Macros

#define GUI_WIDGET_FOOTPRINT
 Widget footprint value.
 
#define gui_widget_iswidget__(h)
 Checks if inserted pointer is valid widget. More...
 
#define gui_widget_getrelativex__(h)
 Get widget relative X position according to parent widget. More...
 
#define gui_widget_getrelativey__(h)
 Get widget relative Y position according to parent widget. More...
 
#define gui_widget_getpaddingtop__(h)
 Get widget top padding as 8-bit value. More...
 
#define gui_widget_getpaddingright__(h)
 Get widget right padding as 8-bit value. More...
 
#define gui_widget_getpaddingbottom__(h)
 Get widget bottom padding as 8-bit value. More...
 
#define gui_widget_getpaddingleft__(h)
 Get widget left padding as 8-bit value. More...
 
#define gui_widget_setpaddingtop__(h, x)
 Set top padding on widget. More...
 
#define gui_widget_setpaddingright__(h, x)
 Set right padding on widget. More...
 
#define gui_widget_setpaddingbottom__(h, x)
 Set bottom padding on widget. More...
 
#define gui_widget_setpaddingleft__(h, x)
 Set left padding on widget. More...
 
#define gui_widget_setpaddingtopbottom__(h, x)
 Set top and bottom paddings on widget. More...
 
#define gui_widget_setpaddingleftright__(h, x)
 Set left and right paddings on widget. More...
 
#define gui_widget_setpadding__(h, x)
 Set all paddings on widget. More...
 
#define gui_widget_getid__(h)
 Get widget ID. More...
 
#define gui_widget_getflag__(h, flag)
 Get widget flag(s) More...
 
#define gui_widget_getcoreflag__(h, flag)
 Get widget core flag(s) More...
 
#define gui_widget_setflag__(h, flag)
 Set widget flag(s) More...
 
#define gui_widget_clrflag__(h, flag)
 Clear widget flag(s) More...
 
#define gui_widget_isexpanded__(h)
 Checks if widget is expanded to maximum relative to parent widget. More...
 
#define gui_widget_is3d__(h)
 Checks if widget has enabled 3D mode. More...
 
#define gui_widget_getparent__(h)
 Get pointer to parent widget. More...
 
#define gui_widget_callback__(h, cmd, param, result)
 Process widget callback with command, parameters and result pointers. More...
 
#define gui_widget_getcolor__(h, index)
 Get widget colors from list of colors It takes colors from allocated memory if exists or from default widget setup for default. More...
 
#define gui_widget_getinnerwidth__(h)
 Get inner width (total width - padding left - padding right) More...
 
#define gui_widget_getinnerheight__(h)
 Get inner height (total height - padding top - padding bottom) More...
 
#define gui_widget_getparentwidth__(h)
 Returns width of parent element. If parent does not exists, it returns LCD width. More...
 
#define gui_widget_getparentheight__(h)
 Returns height of parent element. If parent does not exists, it returns LCD height. More...
 
#define gui_widget_getparentinnerwidth__(h)
 Returns inner width of parent element. If parent does not exists, it returns LCD width. More...
 
#define gui_widget_getparentinnerheight__(h)
 Returns inner height of parent element. If parent does not exists, it returns LCD height. More...
 
#define gui_widget_isvisible__(h)
 Check if widget is visible in any way, either with transparency or hidden flag. More...
 
#define gui_widget_ishidden__(h)
 Check if widget is hidden. More...
 
#define gui_widget_allowchildren__(h)
 Check if widget allows children widgets. More...
 
#define gui_widget_isdialogbase__(h)
 Check if widget is base for dialog. More...
 
#define gui_widget_isfocused__(h)
 Checks if widget handle is currently in focus. More...
 
#define gui_widget_isactive__(h)
 Checks if widget handle is currently active. More...
 
#define gui_widget_istransparent__(h)    (gui_widget_isvisible__(h) && gui_widget_gettransparency__(h) < 0xFF)
 Check is widget has transparency. More...
 
#define gui_widget_gettransparency__(h)
 Get widget transparency value. More...
 
#define gui_widget_getzindex__(h)
 Get z-index value from widget. More...
 

Functions

GUI_iDim_t gui_widget_getabsolutex__ (GUI_HANDLE_p h)
 Get absolute X position on LCD for specific widget. More...
 
GUI_iDim_t gui_widget_getabsolutey__ (GUI_HANDLE_p h)
 Get absolute Y position on LCD for specific widget. More...
 
GUI_iDim_t gui_widget_getparentabsolutex__ (GUI_HANDLE_p h)
 Get absolute inner X position of parent widget. More...
 
GUI_iDim_t gui_widget_getparentabsolutey__ (GUI_HANDLE_p h)
 Get absolute inner Y position of parent widget. More...
 
uint8_t gui_widget_invalidate__ (GUI_HANDLE_p h)
 Invalidate widget for redraw. More...
 
uint8_t gui_widget_invalidatewithparent__ (GUI_HANDLE_p h)
 Invalidate widget and parent widget for redraw. More...
 
uint8_t gui_widget_setinvalidatewithparent__ (GUI_HANDLE_p h, uint8_t value)
 Set if parent widget should be invalidated when we invalidate primary widget. More...
 
uint8_t gui_widget_setposition__ (GUI_HANDLE_p h, GUI_iDim_t x, GUI_iDim_t y)
 Set widget position relative to parent object in units of pixels. More...
 
uint8_t gui_widget_setpositionpercent__ (GUI_HANDLE_p h, float x, float y)
 Set widget position relative to parent object in units of percent. More...
 
uint8_t gui_widget_setxposition__ (GUI_HANDLE_p h, GUI_iDim_t x)
 Set widget X position relative to parent object in units of pixels. More...
 
uint8_t gui_widget_setxpositionpercent__ (GUI_HANDLE_p h, float x)
 Set widget X position relative to parent object in units of percent. More...
 
uint8_t gui_widget_setyposition__ (GUI_HANDLE_p h, GUI_iDim_t y)
 Set widget Y position relative to parent object in units of pixels. More...
 
uint8_t gui_widget_setypositionpercent__ (GUI_HANDLE_p h, float y)
 Set widget Y position relative to parent object in units of percent. More...
 
uint8_t gui_widget_setsize__ (GUI_HANDLE_p h, GUI_Dim_t wi, GUI_Dim_t hi)
 Set widget size in units of pixels. More...
 
uint8_t gui_widget_setsizepercent__ (GUI_HANDLE_p h, float wi, float hi)
 Set widget size in units of percent. More...
 
uint8_t gui_widget_setwidth__ (GUI_HANDLE_p h, GUI_Dim_t width)
 Set width of widget in units of pixels. More...
 
uint8_t gui_widget_setheight__ (GUI_HANDLE_p h, GUI_Dim_t height)
 Set height of widget in units of pixels. More...
 
uint8_t gui_widget_setwidthpercent__ (GUI_HANDLE_p h, float width)
 Set width of widget in percentage relative to parent widget. More...
 
uint8_t gui_widget_setheightpercent__ (GUI_HANDLE_p h, float height)
 Set height of widget in percentage relative to parent widget. More...
 
uint8_t gui_widget_set3dstyle__ (GUI_HANDLE_p h, uint8_t enable)
 Set 3D mode on widget. More...
 
uint8_t gui_widget_setfont__ (GUI_HANDLE_p h, const GUI_FONT_t *font)
 Set font used for widget drawing. More...
 
uint8_t gui_widget_settext__ (GUI_HANDLE_p h, const GUI_Char *text)
 Set text for widget. More...
 
const GUI_Chargui_widget_gettext__ (GUI_HANDLE_p h)
 Get text from widget. More...
 
const GUI_FONT_tgui_widget_getfont__ (GUI_HANDLE_p h)
 Get font from widget. More...
 
uint8_t gui_widget_alloctextmemory__ (GUI_HANDLE_p h, uint32_t size)
 Allocate text memory for widget. More...
 
uint8_t gui_widget_freetextmemory__ (GUI_HANDLE_p h)
 Free text memory for widget. More...
 
void * gui_widget_create__ (const GUI_WIDGET_t *widget, GUI_ID_t id, GUI_iDim_t x, GUI_iDim_t y, GUI_Dim_t width, GUI_Dim_t height, GUI_HANDLE_p parent, GUI_WIDGET_CALLBACK_t cb, uint16_t flags)
 Create new widget and add it to linked list to parent object. More...
 
uint8_t gui_widget_remove__ (GUI_HANDLE_p h)
 Remove widget and all of its children widgets. More...
 
uint8_t gui_widget_show__ (GUI_HANDLE_p h)
 Show widget from visible area. More...
 
uint8_t gui_widget_hide__ (GUI_HANDLE_p h)
 Hide widget from visible area. More...
 
uint8_t gui_widget_toggleexpanded__ (GUI_HANDLE_p h)
 Toggle expandend (maximized) mode of widget (mostly of windows) More...
 
uint8_t gui_widget_setexpanded__ (GUI_HANDLE_p h, uint8_t state)
 Set expandend mode on widget. When enabled, widget will be at X,Y = 0,0 relative to parent and will have width,height = 100%,100%. More...
 
uint8_t gui_widget_ischildof__ (GUI_HANDLE_p h, GUI_HANDLE_p parent)
 Check if widget is children of parent. More...
 
uint8_t gui_widget_isfontandtextset__ (GUI_HANDLE_p h)
 Check if widget has set font and text. More...
 
uint8_t gui_widget_processtextkey__ (GUI_HANDLE_p h, __GUI_KeyboardData_t *key)
 Process text key (add character, remove it, move cursor, etc) More...
 
uint8_t gui_widget_setcolor__ (GUI_HANDLE_p h, uint8_t index, GUI_Color_t color)
 Set color to widget specific index. More...
 
GUI_HANDLE_p gui_widget_getbyid__ (GUI_ID_t id)
 Get first widget handle by ID. More...
 
uint8_t gui_widget_settransparency__ (GUI_HANDLE_p h, uint8_t trans)
 Set transparency level to widget. More...
 
uint8_t gui_widget_setzindex__ (GUI_HANDLE_p h, int32_t zindex)
 Set z-Index for widgets on the same level. This feature applies on widgets which are not dialogs. More...
 
GUI_Dim_t gui_widget_getwidth__ (GUI_HANDLE_p h)
 Get total width of widget in units of pixels Function returns width of widget according to current widget setup (expanded, fill, percent, etc.) More...
 
GUI_Dim_t gui_widget_getheight__ (GUI_HANDLE_p h)
 Get total height of widget Function returns height of widget according to current widget setup (expanded, fill, percent, etc.) More...
 
uint8_t gui_widget_setuserdata__ (GUI_HANDLE_p h, void *data)
 Set custom user data to widget. More...
 
void * gui_widget_getuserdata__ (GUI_HANDLE_p h)
 Get custom user data from widget previously set with gui_widget_setuserdata. More...
 
uint8_t gui_widget_setparam__ (GUI_HANDLE_p h, uint16_t cfg, const void *data, uint8_t invalidate, uint8_t invalidateparent)
 Set widget parameter in OS secure way. More...
 
uint8_t gui_widget_getparam__ (GUI_HANDLE_p h, uint16_t cfg, void *data)
 

Detailed Description

Private widget functions and enumerations.

Note
Since they are not thread safe, they can only be used when inside GUI library. It means they can be used in custom widget implementations where thread safety is guaranteed

Macro Definition Documentation

#define gui_widget_allowchildren__ (   h)

Check if widget allows children widgets.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
Return values
1Widget allows children widgets
0Widget does not allow children widgets
#define gui_widget_callback__ (   h,
  cmd,
  param,
  result 
)

Process widget callback with command, parameters and result pointers.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
[in]cmdCallback command. This parameter can be a value of GUI_WC_t enumeration
[in]paramPointer to parameters if any for this command
[out]resultPointer to result pointer where calback can store result
Return values
1Command processed by widget
0Command was not processed by widget
#define gui_widget_clrflag__ (   h,
  flag 
)

Clear widget flag(s)

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
[in]flagFlag(s) to clear
See also
__gui_widget_setflag, __gui_widget_getflag
#define gui_widget_getcolor__ (   h,
  index 
)

Get widget colors from list of colors It takes colors from allocated memory if exists or from default widget setup for default.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
[in]indexColor index from color array for specific widget
Return values
Colorindex
#define gui_widget_getcoreflag__ (   h,
  flag 
)

Get widget core flag(s)

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
[in]flagFlag(s) to check
Return values
0None flag is set
>0: At least one flag is set
See also
__gui_widget_setflag, __gui_widget_clrflag
#define gui_widget_getflag__ (   h,
  flag 
)

Get widget flag(s)

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
[in]flagFlag(s) to check
Return values
0None flag is set
>0: At least one flag is set
See also
__gui_widget_setflag, __gui_widget_clrflag
#define gui_widget_getid__ (   h)

Get widget ID.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
Return values
WidgetID
#define gui_widget_getinnerheight__ (   h)

Get inner height (total height - padding top - padding bottom)

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in]hPointer to GUI_HANDLE_p structure
Return values
Innerheight in units of pixels
See also
__gui_widget_getinnerwidth
#define gui_widget_getinnerwidth__ (   h)

Get inner width (total width - padding left - padding right)

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in]hPointer to GUI_HANDLE_p structure
Return values
Heightin units of pixels
See also
__gui_widget_getinnerheight
#define gui_widget_getpaddingbottom__ (   h)

Get widget bottom padding as 8-bit value.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in]hWidget handle
Return values
Paddingin units of pixels
#define gui_widget_getpaddingleft__ (   h)

Get widget left padding as 8-bit value.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in]hWidget handle
Return values
Paddingin units of pixels
#define gui_widget_getpaddingright__ (   h)

Get widget right padding as 8-bit value.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in]hWidget handle
Return values
Paddingin units of pixels
#define gui_widget_getpaddingtop__ (   h)

Get widget top padding as 8-bit value.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in]hWidget handle
Return values
Paddingin units of pixels
#define gui_widget_getparent__ (   h)

Get pointer to parent widget.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
Return values
Pointerto parent widget
#define gui_widget_getparentheight__ (   h)

Returns height of parent element. If parent does not exists, it returns LCD height.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
Return values
Parentheight in units of pixels
See also
__gui_widget_getparentwidth
#define gui_widget_getparentinnerheight__ (   h)

Returns inner height of parent element. If parent does not exists, it returns LCD height.

Note
Since this function is private, it can only be used by user inside GUI library
It returns inner height = total height - padding top - padding bottom
Parameters
[in,out]hWidget handle
Return values
Parentheight in units of pixels
See also
__gui_widget_getparentinnerwidth
#define gui_widget_getparentinnerwidth__ (   h)

Returns inner width of parent element. If parent does not exists, it returns LCD width.

Note
Since this function is private, it can only be used by user inside GUI library
It returns inner width = total width - padding left - padding right
Parameters
[in]hPointer to GUI_HANDLE_p structure
Return values
Parentwidth in units of pixels
See also
__gui_widget_getparentinnerheight
#define gui_widget_getparentwidth__ (   h)

Returns width of parent element. If parent does not exists, it returns LCD width.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in]hPointer to GUI_HANDLE_p structure
Return values
Parentwidth in units of pixels
See also
__gui_widget_getparentheight
#define gui_widget_getrelativex__ (   h)

Get widget relative X position according to parent widget.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
Return values
RelativeX according to parent widget
#define gui_widget_getrelativey__ (   h)

Get widget relative Y position according to parent widget.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
Return values
RelativeY according to parent widget
#define gui_widget_gettransparency__ (   h)

Get widget transparency value.

Note
Value between 0 and 0xFF is used:
  • 0x00: Widget is hidden
  • 0xFF: Widget is fully visible
  • between: Widget has transparency value
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
Return values
Trasparencyvalue
See also
__gui_widget_settransparency
#define gui_widget_getzindex__ (   h)

Get z-index value from widget.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
Return values
z-indexvalue
#define gui_widget_is3d__ (   h)

Checks if widget has enabled 3D mode.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
Return values
1Widget has 3D mode
0Widget doesn't have 3D mode
#define gui_widget_isactive__ (   h)

Checks if widget handle is currently active.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
Return values
Statuswhether widget is active or not
See also
__gui_widget_isfocused
#define gui_widget_isdialogbase__ (   h)

Check if widget is base for dialog.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
Return values
1Widget is dialog base
0Widget is not dialog
#define gui_widget_isexpanded__ (   h)

Checks if widget is expanded to maximum relative to parent widget.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
Return values
1Widget is expandend
0Widget is not expanded
#define gui_widget_isfocused__ (   h)

Checks if widget handle is currently in focus.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
Return values
Statuswhether widget is in focus or not
See also
__gui_widget_isactive
#define gui_widget_ishidden__ (   h)

Check if widget is hidden.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
Return values
1Widget is hidden
0Widget is not hidden
See also
__gui_widget_isvisible
#define gui_widget_istransparent__ (   h)    (gui_widget_isvisible__(h) && gui_widget_gettransparency__(h) < 0xFF)

Check is widget has transparency.

Note
Check if widget is visible and transparency is not set to 1 (full view)
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
Return values
1Widget is visible and has transparency
0Widget is either hidden or with no transparency
#define gui_widget_isvisible__ (   h)

Check if widget is visible in any way, either with transparency or hidden flag.

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

Checks if inserted pointer is valid widget.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in]hInput pointer to test for widget
Return values
1Pointer is widget
0Pointer is not widget
#define gui_widget_setflag__ (   h,
  flag 
)

Set widget flag(s)

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
[in]flagFlag(s) to set
See also
__gui_widget_getflag, __gui_widget_clrflag
#define gui_widget_setpadding__ (   h,
 
)

Set all paddings on widget.

Note
Padding is used mainly for internal purpose only to set value for children widgets where X or Y position is inside parent widget (ex. Window has padding to set top line with text and buttons)
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
[in]xPadding in byte format
Return values
None
#define gui_widget_setpaddingbottom__ (   h,
 
)

Set bottom padding on widget.

Note
Padding is used mainly for internal purpose only to set value for children widgets where X or Y position is inside parent widget (ex. Window has padding to set top line with text and buttons)
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
[in]xPadding in byte format
Return values
None
#define gui_widget_setpaddingleft__ (   h,
 
)

Set left padding on widget.

Note
Padding is used mainly for internal purpose only to set value for children widgets where X or Y position is inside parent widget (ex. Window has padding to set top line with text and buttons)
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
[in]xPadding in byte format
Return values
None
#define gui_widget_setpaddingleftright__ (   h,
 
)

Set left and right paddings on widget.

Note
Padding is used mainly for internal purpose only to set value for children widgets where X or Y position is inside parent widget (ex. Window has padding to set top line with text and buttons)
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
[in]xPadding in byte format
Return values
None
#define gui_widget_setpaddingright__ (   h,
 
)

Set right padding on widget.

Note
Padding is used mainly for internal purpose only to set value for children widgets where X or Y position is inside parent widget (ex. Window has padding to set top line with text and buttons)
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
[in]xPadding in byte format
Return values
None
#define gui_widget_setpaddingtop__ (   h,
 
)

Set top padding on widget.

Note
Padding is used mainly for internal purpose only to set value for children widgets where X or Y position is inside parent widget (ex. Window has padding to set top line with text and buttons)
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
[in]xPadding in byte format
Return values
None
#define gui_widget_setpaddingtopbottom__ (   h,
 
)

Set top and bottom paddings on widget.

Note
Padding is used mainly for internal purpose only to set value for children widgets where X or Y position is inside parent widget (ex. Window has padding to set top line with text and buttons)
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
[in]xPadding in byte format
Return values
None

Function Documentation

uint8_t gui_widget_alloctextmemory__ ( GUI_HANDLE_p  h,
uint32_t  size 
)

Allocate text memory for widget.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
[in]sizeNumber of bytes to allocate
Return values
1Successful
0Failed
See also
gui_widget_freetextmemory__, gui_widget_alloctextmemory, gui_widget_freetextmemory
void* gui_widget_create__ ( const GUI_WIDGET_t widget,
GUI_ID_t  id,
GUI_iDim_t  x,
GUI_iDim_t  y,
GUI_Dim_t  width,
GUI_Dim_t  height,
GUI_HANDLE_p  parent,
GUI_WIDGET_CALLBACK_t  cb,
uint16_t  flags 
)

Create new widget and add it to linked list to parent object.

Widget create and remove management

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in]*widgetPointer to GUI_WIDGET_t structure with widget description
[in]idWidget unique ID to use for identity for callback processing
[in]xWidget X position relative to parent widget
[in]yWidget Y position relative to parent widget
[in]widthWidget width in units of pixels
[in]heightWidget height in uints of pixels
[in]parentParent widget handle. Set to NULL to use current active parent widget
[in]cbWidget callback function. Set to NULL to use default widget specific callback
[in]flagsFlags for create procedure
Return values
>0: Pointer to allocated memory for widget with default settings
0Widget creation failed
See also
__gui_widget_remove

Allocation size check:

  • Size must be at least for widget size
  • If widget supports children widgets, size must be for at least parent handle structure

Parent window check

  • Dialog's parent widget is desktop widget
  • If flag for parent desktop is set, parent widget is also desktop
  • Otherwise parent widget passed as parameter is used if it supports children widgets
uint8_t gui_widget_freetextmemory__ ( GUI_HANDLE_p  h)

Free text memory for widget.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
Return values
1Successful
0Failed
See also
__gui_widget_alloctextmemory, gui_widget_alloctextmemory, gui_widget_freetextmemory
GUI_iDim_t gui_widget_getabsolutex__ ( GUI_HANDLE_p  h)

Get absolute X position on LCD for specific widget.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
Return values
Xposition on LCD
GUI_iDim_t gui_widget_getabsolutey__ ( GUI_HANDLE_p  h)

Get absolute Y position on LCD for specific widget.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
Return values
Yposition on LCD
GUI_HANDLE_p gui_widget_getbyid__ ( GUI_ID_t  id)

Get first widget handle by ID.

Note
If multiple widgets have the same ID, first found will be used
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]idWidget ID to search for
Return values
>0: Widget handle when widget found
0Widget not found
const GUI_FONT_t* gui_widget_getfont__ ( GUI_HANDLE_p  h)

Get font from widget.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
Return values
Pointerto font used for widget
GUI_Dim_t gui_widget_getheight__ ( GUI_HANDLE_p  h)

Get total height of widget Function returns height of widget according to current widget setup (expanded, fill, percent, etc.)

Note
Since this function is private, it can only be used by user inside GUI library
Even if percentage height is used, function will always return value in pixels
Parameters
[in]hPointer to GUI_HANDLE_p structure
Return values
Totalheight in units of pixels
See also
__gui_widget_getinnerheight
GUI_iDim_t gui_widget_getparentabsolutex__ ( GUI_HANDLE_p  h)

Get absolute inner X position of parent widget.

Note
This function returns inner X position in absolute form. Imagine parent absolute X is 10, and left padding is 2. Function returns 12.
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle for which parent should be calculated
Return values
Parentabsolute inner X position
GUI_iDim_t gui_widget_getparentabsolutey__ ( GUI_HANDLE_p  h)

Get absolute inner Y position of parent widget.

Note
This function returns inner Y position in absolute form. Imagine parent absolute Y is 10, and top padding is 2. Function returns 12.
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle for which parent should be calculated
Return values
Parentabsolute inner Y position
const GUI_Char* gui_widget_gettext__ ( GUI_HANDLE_p  h)

Get text from widget.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
Return values
Pointerto text from widget
void* gui_widget_getuserdata__ ( GUI_HANDLE_p  h)

Get custom user data from widget previously set with gui_widget_setuserdata.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
Return values
Pointerto user data
See also
__gui_widget_setuserdata
GUI_Dim_t gui_widget_getwidth__ ( GUI_HANDLE_p  h)

Get total width of widget in units of pixels Function returns width of widget according to current widget setup (expanded, fill, percent, etc.)

Note
Since this function is private, it can only be used by user inside GUI library
Even if percentage width is used, function will always return value in pixels
Parameters
[in]hPointer to GUI_HANDLE_p structure
Return values
Totalwidth in units of pixels
See also
__gui_widget_getinnerwidth
uint8_t gui_widget_hide__ ( GUI_HANDLE_p  h)

Hide widget from visible area.

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

TODO: Check if active/focused widget is maybe children of this widget

uint8_t gui_widget_invalidate__ ( GUI_HANDLE_p  h)

Invalidate widget for redraw.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
Return values
1Successful
0Failed
uint8_t gui_widget_invalidatewithparent__ ( GUI_HANDLE_p  h)

Invalidate widget and parent widget for redraw.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
Return values
1Successful
0Failed
uint8_t gui_widget_ischildof__ ( GUI_HANDLE_p  h,
GUI_HANDLE_p  parent 
)

Check if widget is children of parent.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in]hWidget handle to test
[in]parentParent widget handle to test if is parent
Return values
1Widget handle is in tree of parent handle
0Widget handle is not in tree of parent handle
uint8_t gui_widget_isfontandtextset__ ( GUI_HANDLE_p  h)

Check if widget has set font and text.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in]hWidget handle
Return values
1Widget has font and text set
0Widget does not have font or text set
uint8_t gui_widget_processtextkey__ ( GUI_HANDLE_p  h,
__GUI_KeyboardData_t kb 
)

Process text key (add character, remove it, move cursor, etc)

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
[in]*kbPointer to __GUI_KeyboardData_t structure
Return values
1Key processed
0Key not processed
uint8_t gui_widget_remove__ ( GUI_HANDLE_p  h)

Remove widget and all of its children widgets.

Function checks widget and all its children if they can be deleted. If so, flag for delete will be set and procedure will be executed later when all other processing is done

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
*hWidget handle to remove
Return values
0Failed
1Success
See also
__gui_widget_create, gui_widget_remove
uint8_t gui_widget_set3dstyle__ ( GUI_HANDLE_p  h,
uint8_t  enable 
)

Set 3D mode on widget.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
[in]enableValue to enable, either 1 or 0
Return values
1Successful
0Failed
uint8_t gui_widget_setcolor__ ( GUI_HANDLE_p  h,
uint8_t  index,
GUI_Color_t  color 
)

Set color to widget specific index.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
[in]indexIndex in array of colors
[in]colorActual color code to set
Return values
1Color was set ok
0Color was not set
uint8_t gui_widget_setexpanded__ ( GUI_HANDLE_p  h,
uint8_t  state 
)

Set expandend mode on widget. When enabled, widget will be at X,Y = 0,0 relative to parent and will have width,height = 100%,100%.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
[in]stateState for expanded mode
Return values
1Widget expandend status set ok
0Widget expandend status was not set
uint8_t gui_widget_setfont__ ( GUI_HANDLE_p  h,
const GUI_FONT_t font 
)

Set font used for widget drawing.

Widget text and font management

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
[in]*fontPointer to GUI_FONT_t structure with font information
Return values
1Successful
0Failed
uint8_t gui_widget_setheight__ ( GUI_HANDLE_p  h,
GUI_Dim_t  height 
)

Set height of widget in units of pixels.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
[in]heightHeight in units of pixels
Return values
1Successful
1Failed
See also
gui_widget_setwidth, gui_widget_setwidthpercent, gui_widget_setheightpercent
uint8_t gui_widget_setheightpercent__ ( GUI_HANDLE_p  h,
float  height 
)

Set height of widget in percentage relative to parent widget.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
[in]heightHeight in percentage
Return values
1Successful
1Failed
See also
gui_widget_setwidth, gui_widget_setheight, gui_widget_setwidthpercent
uint8_t gui_widget_setinvalidatewithparent__ ( GUI_HANDLE_p  h,
uint8_t  value 
)

Set if parent widget should be invalidated when we invalidate primary widget.

Note
Since this function is private, it can only be used by user inside GUI library
Useful for widgets where there is no background: Transparent images, textview, slider, etc
Parameters
[in]hWidget handle
[in]valueValue either to enable or disable. 0 = disable, > 0 = enable
Return values
1Value was set ok
0Value was not set
uint8_t gui_widget_setparam__ ( GUI_HANDLE_p  h,
uint16_t  cfg,
const void *  data,
uint8_t  invalidate,
uint8_t  invalidateparent 
)

Set widget parameter in OS secure way.

Parameters
[in,out]hWidget handle
[in]cfgConfiguration to use, passed later to callback function
[in]*dataCustom data to pass later to configuration callback
[in]invalidateFlag if widget should be invalidated after parameter change
[in]invalidateparentchange if parent widget should be invalidated after parameter change
Return values
Pointerto user data
See also
__gui_widget_setuserdata
uint8_t gui_widget_setposition__ ( GUI_HANDLE_p  h,
GUI_iDim_t  x,
GUI_iDim_t  y 
)

Set widget position relative to parent object in units of pixels.

Widget position management

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
[in]xX position relative to parent object
[in]yY position relative to parent object
Return values
1Position was set ok
0Position was not set
See also
gui_widget_setpositionpercent
uint8_t gui_widget_setpositionpercent__ ( GUI_HANDLE_p  h,
float  x,
float  y 
)

Set widget position relative to parent object in units of percent.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
[in]xX position relative to parent object
[in]yY position relative to parent object
Return values
1Position was set ok
0Position was not set
See also
gui_widget_setposition
uint8_t gui_widget_setsize__ ( GUI_HANDLE_p  h,
GUI_Dim_t  wi,
GUI_Dim_t  hi 
)

Set widget size in units of pixels.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
[in]wiWidget width
[in]hiWidget height
Return values
1Successful
0Failed
uint8_t gui_widget_setsizepercent__ ( GUI_HANDLE_p  h,
float  wi,
float  hi 
)

Set widget size in units of percent.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
[in]wiWidget width
[in]hiWidget height
Return values
1Successful
0Failed
uint8_t gui_widget_settext__ ( GUI_HANDLE_p  h,
const GUI_Char text 
)

Set text for widget.

Note
Since this function is private, it can only be used by user inside GUI library
When memory for text is dynamically allocated, text will be copied to allocated memory, otherwise it will just set the pointer to new text. Any changes on this text after function call will affect on later results
Parameters
[in,out]hWidget handle
[in]*textPointer to text to set
Return values
1Successful
0Failed
uint8_t gui_widget_settransparency__ ( GUI_HANDLE_p  h,
uint8_t  trans 
)

Set transparency level to widget.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
[in]transTransparency level, where 0x00 means hidden and 0xFF means totally visible widget
Return values
1Transparency set ok
0Transparency was not set
See also
__gui_widget_settransparency
uint8_t gui_widget_setuserdata__ ( GUI_HANDLE_p  h,
void *  data 
)

Set custom user data to widget.

Note
Since this function is private, it can only be used by user inside GUI library
Specially useful in callback processing if required
Parameters
[in,out]hWidget handle
[in]dataPointer to custom user data
Return values
1Data were set OK
0Data were not set
See also
gui_widget_getuserdata__
uint8_t gui_widget_setwidth__ ( GUI_HANDLE_p  h,
GUI_Dim_t  width 
)

Set width of widget in units of pixels.

Widget size management

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
[in]widthWidth in units of pixels
Return values
1Successful
1Failed
See also
gui_widget_setheight, gui_widget_setwidthpercent, gui_widget_setheightpercent
uint8_t gui_widget_setwidthpercent__ ( GUI_HANDLE_p  h,
float  width 
)

Set width of widget in percentage relative to parent widget.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
[in]widthWidth in percentage
Return values
1Successful
1Failed
See also
gui_widget_setwidth, gui_widget_setheight, gui_widget_setheightpercent
uint8_t gui_widget_setxposition__ ( GUI_HANDLE_p  h,
GUI_iDim_t  x 
)

Set widget X position relative to parent object in units of pixels.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
[in]xX position relative to parent object
Return values
1Position was set ok
0Position was not set
See also
gui_widget_setxpositionpercent
uint8_t gui_widget_setxpositionpercent__ ( GUI_HANDLE_p  h,
float  x 
)

Set widget X position relative to parent object in units of percent.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
[in]xX position relative to parent object
Return values
1Position was set ok
0Position was not set
See also
gui_widget_setxposition
uint8_t gui_widget_setyposition__ ( GUI_HANDLE_p  h,
GUI_iDim_t  y 
)

Set widget Y position relative to parent object in units of pixels.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
[in]yY position relative to parent object
Return values
1Position was set ok
0Position was not set
See also
gui_widget_setypositionpercent
uint8_t gui_widget_setypositionpercent__ ( GUI_HANDLE_p  h,
float  y 
)

Set widget Y position relative to parent object in units of percent.

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
[in]yY position relative to parent object
Return values
1Position was set ok
0Position was not set
See also
gui_widget_setyposition
uint8_t gui_widget_setzindex__ ( GUI_HANDLE_p  h,
int32_t  zindex 
)

Set z-Index for widgets on the same level. This feature applies on widgets which are not dialogs.

Note
Larger z-index value means greater position on screen. In case of multiple widgets on same z-index level, they are automatically modified for correct display
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
[in]zindexZ-Index value for widget. Any value can be used
Return values
1New value is different than previous and modification has been done
0New value was not set
uint8_t gui_widget_show__ ( GUI_HANDLE_p  h)

Show widget from visible area.

.....

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
Return values
1Widget shown
0Widget not shown
See also
__gui_widget_hide
uint8_t gui_widget_toggleexpanded__ ( GUI_HANDLE_p  h)

Toggle expandend (maximized) mode of widget (mostly of windows)

Note
Since this function is private, it can only be used by user inside GUI library
Parameters
[in,out]hWidget handle
Return values
1Widget expandend status toggled ok
0Widget expandend status was not toggled