EasyGUI  v0.1
Platform independent GUI Library
Core widget functions

Core functions for all widgets. More...

Modules

 Predefined ID values
 Macros for fast ID setup.
 
 Flags for widget create
 A list of flags supported for widget creation.
 
 Private functions
 Private widget functions and enumerations.
 
 Text management
 Text and font management functions.
 
 Size management
 Size management functions.
 
 Position management
 Position management functions.
 
 Visibility management
 Visibility management functions.
 
 Miscellaneous
 Miscellaneous functions.
 
 Callback processing
 Callback based functions.
 

Data Structures

struct  GUI_WIDGET_Param_t
 Structure used in setting and getting parameter values from widgets using callbacks. More...
 
struct  GUI_WIDGET_PARAM_t
 Structure of input parameters for widget callback. More...
 
struct  GUI_WIDGET_RESULT_t
 Structure of output results for widget callback. More...
 
struct  GUI_WIDGET_t
 Structure for each widget type. More...
 
struct  GUI_HANDLE_p
 Common GUI values for widgets. More...
 
struct  GUI_HANDLE_ROOT_t
 Common GUI values for widgets who can have children widgets (windows, panels) More...
 

Macros

#define GUI_WIDGET_PARAMTYPE_DISP(x)    (x)->u.disp
 
#define GUI_WIDGET_PARAMTYPE_TOUCH(x)    (x)->u.td
 
#define GUI_WIDGET_PARAMTYPE_KEYBOARD(x)    (x)->u.kd
 
#define GUI_WIDGET_PARAMTYPE_WIDGETPARAM(x)    (x)->u.wp
 
#define GUI_WIDGET_PARAMTYPE_I16(x)    (x)->u.i16
 
#define GUI_WIDGET_PARAMTYPE_HANDLE(x)    (x)->u.h
 
#define GUI_WIDGET_PARAMTYPE_INT(x)    (x)->u.i
 
#define GUI_WIDGET_RESULTTYPE_TOUCH(x)    (x)->u.ts
 
#define GUI_WIDGET_RESULTTYPE_KEYBOARD(x)    (x)->u.ks
 
#define GUI_WIDGET_RESULTTYPE_U8(x)    (x)->u.u8
 

Typedefs

typedef uint8_t(* GUI_WIDGET_CALLBACK_t) (GUI_HANDLE_p h, GUI_WC_t cmd, GUI_WIDGET_PARAM_t *param, GUI_WIDGET_RESULT_t *result)
 Callback function for widget. More...
 
typedef GUI_HANDLE_p(* GUI_WIDGET_CreateFunc_t) (GUI_ID_t, GUI_iDim_t, GUI_iDim_t, GUI_iDim_t, GUI_iDim_t, GUI_HANDLE_p, GUI_WIDGET_CALLBACK_t, uint16_t)
 Widget create function footprint for structures as callbacks.
 

Enumerations

enum  GUI_WC_t {
  GUI_WC_None = 0x00, GUI_WC_PreInit = 0x01, GUI_WC_ExcludeLinkedList = 0x02, GUI_WC_SetParam = 0x03,
  GUI_WC_GetParam = 0x04, GUI_WC_Init = 0x05, GUI_WC_ChildWidgetCreated, GUI_WC_Draw,
  GUI_WC_CanRemove, GUI_WC_Remove, GUI_WC_FocusIn, GUI_WC_FocusOut,
  GUI_WC_ActiveIn, GUI_WC_ActiveOut, GUI_WC_TouchStart, GUI_WC_TouchMove,
  GUI_WC_TouchEnd, GUI_WC_Click, GUI_WC_LongClick, GUI_WC_DblClick,
  GUI_WC_KeyPress, GUI_WC_SelectionChanged, GUI_WC_ValueChanged, GUI_WC_TextChanged,
  GUI_WC_IncSelection, GUI_WC_OnDismiss
}
 Control parameters for widget. More...
 

Detailed Description

Core functions for all widgets.

Use can use all function which do not start with __GUI which indicate private functions.

Core widget functions are common functions to all widgets. They can perform:

In general, each widget also uses custom based functions. These are provided in widget specific section.

Typedef Documentation

typedef uint8_t(* GUI_WIDGET_CALLBACK_t) (GUI_HANDLE_p h, GUI_WC_t cmd, GUI_WIDGET_PARAM_t *param, GUI_WIDGET_RESULT_t *result)

Callback function for widget.

Handles everything related to widget.

  • Initialization
  • Drawing
  • Touch handling
  • Key presses
  • Value change, selection change
  • and more

Enumeration Type Documentation

enum GUI_WC_t

Control parameters for widget.

Note
Must always start with number 1
Enumerator
GUI_WC_PreInit 

Called just after widget has been created. Used for internal widget purpose only.

Note
This field is only visible inside GUI library and can't be used in custom widget callback
Parameters
[in]*paramNone
[out]*resultPointer to uint8_t variable with result. If set to 0 by user, widget will be deleted
GUI_WC_ExcludeLinkedList 

Check if widget should not be added to linked list after creation.

Parameters
[in]*paramNone
[out]*resultPointer to uint8_t variable type to store result to [1 = exclude, 0 = do not exclude]
GUI_WC_SetParam 

Set user parameter for widget.

Parameters
[in]*paramPointer to GUI_WIDGET_Param_t structure with custom user parameter for widget
[out]*resultNone
GUI_WC_GetParam 

Get parameter for widget.

Parameters
[in]*paramPointer to GUI_WIDGET_Param_t structure with identification and memory where to save parameter value
[out]*resultNone
GUI_WC_Init 

Widget has been created and ready to init for future setup.

Note
Default values for widget can be set here. Example: Checkbox check can be made and default checkbox value should be set if required
Parameters
[in]*paramNone
[out]*resultNone
GUI_WC_ChildWidgetCreated 

A new child widget has been added to parent's linked list. It is called on parent widget.

Parameters
[in]*paramChild widget handle
[out]*resultNone
GUI_WC_Draw 

Draw widget on screen.

Parameters
[in]*paramPointer to GUI_Display_t structure
[out]*resultNone
GUI_WC_CanRemove 

Check if widget can be removed. User can perform check if for example widget needs save or similar operation.

Parameters
[in]*paramNone
[out]*resultPointer to uint8_t variable type to store result to [1 = remove, 0 = do not remove]
See also
GUI_WC_Remove
GUI_WC_Remove 

Notification before widget delete will actually happen. In case of specific user allocations in memory, they can be restored here.

Parameters
[in]*paramNone
[out]*resultNone
See also
GUI_WC_CanRemove
GUI_WC_FocusIn 

Notification called when widget becomes focused.

Parameters
[in]*paramNone
[out]*resultNone
See also
GUI_WC_FocusOut
GUI_WC_FocusOut 

Notification called when widget clears widget state.

Parameters
[in]*paramNone
[out]*resultNone
See also
GUI_WC_FocusIn
GUI_WC_ActiveIn 

Notification for active status on widget.

Note
Called when widget just become active
Parameters
[in]*paramNone
[out]*resultNone
See also
GUI_WC_ActiveOut
GUI_WC_ActiveOut 

Notification for cleared active status on widget.

Note
Called when widget just clears active
Parameters
[in]*paramNone
[out]*resultNone
See also
GUI_WC_ActiveIn
GUI_WC_TouchStart 

Notification when touch down event occurs on widget.

Parameters
[in]*paramPointer to __GUI_TouchData_t structure
[out]*resultValue of __GUI_TouchStatus_t enumeration
See also
GUI_WC_TouchMove, GUI_WC_TouchEnd
GUI_WC_TouchMove 

Notification when touch move event occurs on widget.

Note
If return value from function on this parameter is 1, then GUI_WC_Click event won't be called after released status to prevent collisions between widget events (sliding on widget and click at the same time can cause unknown behaviour on user)
Parameters
[in]*paramPointer to __GUI_TouchData_t structure
[out]*resultValue of __GUI_TouchStatus_t enumeration
See also
GUI_WC_TouchStart, GUI_WC_TouchEnd
GUI_WC_TouchEnd 

Notification when touch up event occurs on widget.

Parameters
[in]*paramPointer to __GUI_TouchData_t structure
[out]*resultValue of __GUI_TouchStatus_t enumeration
See also
GUI_WC_TouchStart, GUI_WC_TouchMove
GUI_WC_Click 

Notification when click event has been detected.

Parameters
[in]*paramPointer to __GUI_TouchData_t structure with valid touch press location
[out]*resultNone
GUI_WC_LongClick 

Notification when long press has been detected.

Parameters
[in]*paramPointer to __GUI_TouchData_t structure with valid touch press location
[out]*resultNone
GUI_WC_DblClick 

Notification when double click has been detected.

Parameters
[in]*paramPointer to __GUI_TouchData_t structure with valid touch press location
[out]*resultNone
GUI_WC_KeyPress 

Notification when key has been pushed to this widget.

Parameters
[in]*paramPointer to __GUI_KeyboardData_t structure
[out]*resultValue of __GUI_KeyboardStatus_t enumeration
GUI_WC_SelectionChanged 

Notification when widget selection has changed.

Note
Called from widget by user when necessary. Not all widget reports this value by itself
Used by widgets where selection can be changed (listbox, selectbox, radio, etc)
Parameters
[in]*paramNone
[out]*resultNone
See also
GUI_WC_ValueChanged
GUI_WC_ValueChanged 

Value of widget has been changed.

Note
Called from widget by user when necessary. Not all widget reports this value by itself
Used by widgets where value or status can change (checkbox)
Parameters
[in]*paramNone
[out]*resultNone
See also
GUI_WC_SelectionChanged
GUI_WC_TextChanged 

Widget text value has been changed.

Note
Called from widget by user when necessary. Not all widget reports this value by itself
Parameters
[in]*paramNone
[out]*resultNone
GUI_WC_IncSelection 

Widget should increase/decrease selection.

Note
Called from gui_widget_incselection function to increase/decrease selection for widgets such as listbox or dropdown, where active selection can be changed
Parameters
[in]*paramPointer to int16_t variable for amount of increase/decrease value
[out]*resultPointer to output uint8_t variable to save status of increase/decrease operation
GUI_WC_OnDismiss 

Called when dialog is dismissed.

Note
Callback is activated when dismiss function is called on dialog widget. Notification can be used to proceed with function call
Parameters
[in]*paramPointer to int variable passed to dismiss function
[out]*resultNone