BSB Developer Docs
Loading...
Searching...
No Matches
timer_indicator.h File Reference

A widget that shows the current timer status. More...

#include <gui/widget.h>

Go to the source code of this file.

Data Structures

struct  TimerIndicatorBgConfig
 
struct  TimerIndicatorProgressConfig
 
struct  TimerIndicatorFgConfig
 
struct  TimerIndicatorPreset
 
struct  TimerIndicatorTransition
 

Typedefs

typedef struct TimerIndicator TimerIndicator
 TimerIndicator opaque structure.
 

Enumerations

enum  TimerIndicatorProgressDirection { TimerIndicatorProgressDirectionHorizontal , TimerIndicatorProgressDirectionVertical , TimerIndicatorProgressDirectionMax }
 

Functions

TimerIndicator * timer_indicator_alloc (Widget *parent)
 Create a new TimerIndicator instance.
 
void timer_indicator_free (TimerIndicator *instance)
 Delete a TimerIndicator instance.
 
Widget * timer_indicator_get_base (TimerIndicator *instance)
 Get a pointer to the base class instance.
 
void timer_indicator_set_preset (TimerIndicator *instance, const TimerIndicatorPreset *preset, const TimerIndicatorTransition *transition)
 Set the active preset for a TimerIndicator instance.
 
void timer_indicator_set_progress (TimerIndicator *instance, float progress)
 Set the progress value for the progress animation.
 
void timer_indicator_enable_animations (TimerIndicator *instance, bool enable)
 Enable or disable animations shown by a TimerIndicator instance.
 

Detailed Description

A widget that shows the current timer status.

Can be used only on the front display.

Function Documentation

◆ timer_indicator_alloc()

TimerIndicator * timer_indicator_alloc ( Widget * parent)

Create a new TimerIndicator instance.

Parameters
[in,out]parentpointer to the parent Widget instance
Returns
pointer to the newly created TimerIndicator instance

◆ timer_indicator_enable_animations()

void timer_indicator_enable_animations ( TimerIndicator * instance,
bool enable )

Enable or disable animations shown by a TimerIndicator instance.

Parameters
[in,out]instancepointer to the TimerIndicator instance to be modified
[in]enableplay animations if true, stop them otherwise

◆ timer_indicator_free()

void timer_indicator_free ( TimerIndicator * instance)

Delete a TimerIndicator instance.

Parameters
[in,out]instancepointer to the TimerIndicator instance to be deleted

◆ timer_indicator_get_base()

Widget * timer_indicator_get_base ( TimerIndicator * instance)

Get a pointer to the base class instance.

The return value can be used in all Widget methods.

Parameters
[in,out]instancepointer to the TimerIndicator instance to be queried
Returns
pointer to the base class instance

◆ timer_indicator_set_preset()

void timer_indicator_set_preset ( TimerIndicator * instance,
const TimerIndicatorPreset * preset,
const TimerIndicatorTransition * transition )

Set the active preset for a TimerIndicator instance.

TimerIndicator presets consist of the following parts:

  • Background animation (.anim sequence file)
  • Progress animation, used for a visual progress representation (.anim sequence file)
  • Mask image, usually used for rounded corners and other effects (.image image file)
  • Foreground image, containing static elements (.image image file)

Any of these parts may be omitted, in that case NULL should be passed instead of the respective file path.

Parameters
[in,out]instancepointer to the TimerIndicator instance to be modified
[in]preset
[in]transition

◆ timer_indicator_set_progress()

void timer_indicator_set_progress ( TimerIndicator * instance,
float progress )

Set the progress value for the progress animation.

Note
If no progress animation is present in the current preset, this function will do nothing
Parameters
[in,out]instancepointer to the TimerIndicator instance to be modified
[in]progressnumber between 0 and 1 (inclusive)