![]() |
BSB Developer Docs
|
A widget that displays time until or from the specified timestamp. More...
Go to the source code of this file.
Typedefs | |
| typedef struct Countdown | Countdown |
| Countdown opaque structure. | |
| typedef void(* | CountdownCallback) (void *context) |
| Countdown callback function type. | |
Functions | |
| Countdown * | countdown_alloc (Widget *parent) |
| Create a new Countdown instance. | |
| void | countdown_free (Countdown *instance) |
| Delete a Countdown instance. | |
| Widget * | countdown_get_base (Countdown *instance) |
| Get a pointer to the base class instance. | |
| void | countdown_set_callback (Countdown *instance, CountdownCallback callback, void *context) |
| Set a countdown callback. | |
| void | countdown_set_text_color (Countdown *instance, Color color) |
| Set the countdown text color. | |
| void | countdown_set_text_font (Countdown *instance, const char *font_path) |
| Set the countdown font from a font file. | |
| void | countdown_begin (Countdown *instance, time_t time, CountdownDirection direction, CountdownShowHour hours) |
| Starts counting down (or up) | |
| void | countdown_stop (Countdown *instance) |
| Stop counting. | |
A widget that displays time until or from the specified timestamp.
| typedef void(* CountdownCallback) (void *context) |
Countdown callback function type.
| [in,out] | context | pointer to a user-specific object |
Create a new Countdown instance.
| [in,out] | parent | pointer to the parent Widget instance |
| void countdown_begin | ( | Countdown * | instance, |
| time_t | time, | ||
| CountdownDirection | direction, | ||
| CountdownShowHour | hours ) |
Starts counting down (or up)
| [in] | instance | pointer to the Countdown instance to be modified |
| [in] | time | seconds-based Unix timestamp to count down to or up from |
| [in] | direction | explicit counting direction - see CountdownDirection enum |
| [in] | hours | when to show the hours position - see CountdownShowHour enum |
| void countdown_free | ( | Countdown * | instance | ) |
Delete a Countdown instance.
| [in,out] | instance | pointer to the Countdown instance to be deleted |
Get a pointer to the base class instance.
The return value can be used in all Widget methods.
| [in,out] | instance | pointer to the Countdown instance to be queried |
| void countdown_set_callback | ( | Countdown * | instance, |
| CountdownCallback | callback, | ||
| void * | context ) |
Set a countdown callback.
The callback function is called when the timer reaches zero. Works only when CountdownDirectionTimeLeft is set.
| [in,out] | instance | pointer to the Countdown instance to be queried |
| [in] | callback | callback function pointer |
| [in] | context | callback context data |
Set the countdown text color.
| [in,out] | instance | pointer to the Countdown instance to be modified |
| [in] | color | text color |
| void countdown_set_text_font | ( | Countdown * | instance, |
| const char * | font_path ) |
Set the countdown font from a font file.
| [in,out] | instance | pointer to the Countdown instance to be modified |
| [in] | font_path | path to font file |
| void countdown_stop | ( | Countdown * | instance | ) |
Stop counting.
| [in] | instance | pointer to the Countdown instance to be modified |