Loading...
Searching...
No Matches
popup.h File Reference

GUI: Popup view module API. More...

#include <gui/view.h>

Go to the source code of this file.

Typedefs

typedef struct Popup Popup
 Popup anonymous structure.
 
typedef void(* PopupCallback) (void *context)
 Popup result callback type.
 

Functions

Popuppopup_alloc (void)
 Allocate and initialize popup.
 
void popup_free (Popup *popup)
 Deinitialize and free popup.
 
Viewpopup_get_view (Popup *popup)
 Get popup view.
 
void popup_set_callback (Popup *popup, PopupCallback callback)
 Set popup header text.
 
void popup_set_context (Popup *popup, void *context)
 Set popup context.
 
void popup_set_header (Popup *popup, const char *text, uint8_t x, uint8_t y, Align horizontal, Align vertical)
 Set popup header text.
 
void popup_set_text (Popup *popup, const char *text, uint8_t x, uint8_t y, Align horizontal, Align vertical)
 Set popup text.
 
void popup_set_icon (Popup *popup, uint8_t x, uint8_t y, const Icon *icon)
 Set popup icon.
 
void popup_set_timeout (Popup *popup, uint32_t timeout_in_ms)
 Set popup timeout.
 
void popup_enable_timeout (Popup *popup)
 Enable popup timeout.
 
void popup_disable_timeout (Popup *popup)
 Disable popup timeout.
 
void popup_reset (Popup *popup)
 Reset popup instance state.
 

Detailed Description

GUI: Popup view module API.

Typedef Documentation

◆ PopupCallback

typedef void(* PopupCallback) (void *context)

Popup result callback type.

Warning
comes from GUI thread

Function Documentation

◆ popup_alloc()

Popup * popup_alloc ( void )

Allocate and initialize popup.

This popup used to ask simple questions like Yes/

Returns
Popup instance

◆ popup_disable_timeout()

void popup_disable_timeout ( Popup * popup)

Disable popup timeout.

Parameters
popupPopup instance

◆ popup_enable_timeout()

void popup_enable_timeout ( Popup * popup)

Enable popup timeout.

Parameters
popupPopup instance

◆ popup_free()

void popup_free ( Popup * popup)

Deinitialize and free popup.

Parameters
popupPopup instance

◆ popup_get_view()

View * popup_get_view ( Popup * popup)

Get popup view.

Parameters
popupPopup instance
Returns
View instance that can be used for embedding

◆ popup_reset()

void popup_reset ( Popup * popup)

Reset popup instance state.

Parameters
popupPopup instance

◆ popup_set_callback()

void popup_set_callback ( Popup * popup,
PopupCallback callback )

Set popup header text.

Parameters
popupPopup instance
callbackPopupCallback

◆ popup_set_context()

void popup_set_context ( Popup * popup,
void * context )

Set popup context.

Parameters
popupPopup instance
contextcontext pointer, will be passed to result callback

◆ popup_set_header()

void popup_set_header ( Popup * popup,
const char * text,
uint8_t x,
uint8_t y,
Align horizontal,
Align vertical )

Set popup header text.

If text is null, popup header will not be rendered

Parameters
popupPopup instance
texttext to be shown, can be multiline
xx position
yy position
horizontalhorizontal alignment
verticalvertical alignment

◆ popup_set_icon()

void popup_set_icon ( Popup * popup,
uint8_t x,
uint8_t y,
const Icon * icon )

Set popup icon.

If icon position is negative, popup icon will not be rendered

Parameters
popupPopup instance
xx position
yy position
iconpointer to Icon data

◆ popup_set_text()

void popup_set_text ( Popup * popup,
const char * text,
uint8_t x,
uint8_t y,
Align horizontal,
Align vertical )

Set popup text.

If text is null, popup text will not be rendered

Parameters
popupPopup instance
texttext to be shown, can be multiline
xx position
yy position
horizontalhorizontal alignment
verticalvertical alignment

◆ popup_set_timeout()

void popup_set_timeout ( Popup * popup,
uint32_t timeout_in_ms )

Set popup timeout.

Parameters
popupPopup instance
timeout_in_mspopup timeout value in milliseconds