NetSurf
Functions
progress_bar.h File Reference

Progress bar (interface). More...

#include <stdbool.h>
#include "oslib/osspriteop.h"
#include "oslib/wimp.h"
Include dependency graph for progress_bar.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void ro_gui_progress_bar_init (osspriteop_area *icons)
 Initialise the progress bar. More...
 
struct progress_barro_gui_progress_bar_create (void)
 Create a new progress bar. More...
 
void ro_gui_progress_bar_destroy (struct progress_bar *pb)
 Destroy a progress bar and free all associated resources. More...
 
void ro_gui_progress_bar_update (struct progress_bar *pb, int width, int height)
 Update the progress bar to a new dimension. More...
 
wimp_w ro_gui_progress_bar_get_window (struct progress_bar *pb)
 Get the handle of the window that represents a progress bar. More...
 
void ro_gui_progress_bar_set_icon (struct progress_bar *pb, const char *icon)
 Set the icon for a progress bar. More...
 
void ro_gui_progress_bar_set_value (struct progress_bar *pb, unsigned int value)
 Set the value of a progress bar. More...
 
unsigned int ro_gui_progress_bar_get_value (struct progress_bar *pb)
 Get the value of a progress bar. More...
 
void ro_gui_progress_bar_set_range (struct progress_bar *pb, unsigned int range)
 Set the range of a progress bar. More...
 
unsigned int ro_gui_progress_bar_get_range (struct progress_bar *pb)
 Get the range of a progress bar. More...
 

Detailed Description

Progress bar (interface).

Definition in file progress_bar.h.

Function Documentation

◆ ro_gui_progress_bar_create()

struct progress_bar * ro_gui_progress_bar_create ( void  )

Create a new progress bar.

Definition at line 128 of file progress_bar.c.

References NSLOG, progress_bar_definition, ro_gui_progress_bar_redraw(), ro_gui_wimp_event_register_redraw_window(), ro_gui_wimp_event_set_user_data(), and progress_bar::w.

Referenced by ro_gui_status_bar_create().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ro_gui_progress_bar_destroy()

void ro_gui_progress_bar_destroy ( struct progress_bar pb)

Destroy a progress bar and free all associated resources.

Parameters
pbthe progress bar to destroy

Definition at line 158 of file progress_bar.c.

References progress_bar::animating, NSLOG, riscos_schedule(), ro_gui_progress_bar_animate(), ro_gui_wimp_event_finalise(), and progress_bar::w.

Referenced by ro_gui_status_bar_destroy().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ro_gui_progress_bar_get_range()

unsigned int ro_gui_progress_bar_get_range ( struct progress_bar pb)

Get the range of a progress bar.

Parameters
pbthe progress bar to get the range of
Returns
the current range

Definition at line 269 of file progress_bar.c.

References progress_bar::range.

Referenced by ro_gui_status_bar_set_progress_range(), ro_gui_status_bar_set_progress_value(), and ro_gui_status_position_progress_bar().

Here is the caller graph for this function:

◆ ro_gui_progress_bar_get_value()

unsigned int ro_gui_progress_bar_get_value ( struct progress_bar pb)

Get the value of a progress bar.

Parameters
pbthe progress bar to get the value of
Returns
the current value

Definition at line 238 of file progress_bar.c.

References progress_bar::value.

◆ ro_gui_progress_bar_get_window()

wimp_w ro_gui_progress_bar_get_window ( struct progress_bar pb)

Get the handle of the window that represents a progress bar.

Parameters
pbthe progress bar to get the window handle of
Returns
the progress bar's window handle

Definition at line 183 of file progress_bar.c.

References progress_bar::w.

Referenced by ro_gui_status_bar_set_progress_range(), and ro_gui_status_position_progress_bar().

Here is the caller graph for this function:

◆ ro_gui_progress_bar_init()

void ro_gui_progress_bar_init ( osspriteop_area *  icons)

Initialise the progress bar.

Parameters
iconsthe sprite area to use for icons

Definition at line 104 of file progress_bar.c.

References progress_animation_sprite, progress_bar_definition, progress_height, progress_icon, and progress_width.

◆ ro_gui_progress_bar_set_icon()

void ro_gui_progress_bar_set_icon ( struct progress_bar pb,
const char *  icon 
)

Set the icon for a progress bar.

Parameters
pbthe progress bar to set the icon for
iconthe icon to use, or NULL for no icon

Definition at line 197 of file progress_bar.c.

References progress_bar::cur_height, progress_bar::cur_width, progress_bar::icon, progress_bar::recalculate, ro_gui_progress_bar_update(), and progress_bar::w.

Referenced by ro_gui_status_bar_set_progress_icon().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ro_gui_progress_bar_set_range()

void ro_gui_progress_bar_set_range ( struct progress_bar pb,
unsigned int  range 
)

Set the range of a progress bar.

Parameters
pbthe progress bar to set the range for
rangethe range to use

Definition at line 252 of file progress_bar.c.

References progress_bar::cur_height, progress_bar::cur_width, progress_bar::range, ro_gui_progress_bar_update(), and progress_bar::value.

Referenced by ro_gui_status_bar_set_progress_range().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ro_gui_progress_bar_set_value()

void ro_gui_progress_bar_set_value ( struct progress_bar pb,
unsigned int  value 
)

Set the value of a progress bar.

Parameters
pbthe progress bar to set the value for
valuethe value to use

Definition at line 221 of file progress_bar.c.

References progress_bar::cur_height, progress_bar::cur_width, progress_bar::range, ro_gui_progress_bar_update(), and progress_bar::value.

Referenced by ro_gui_status_bar_set_progress_value().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ro_gui_progress_bar_update()

void ro_gui_progress_bar_update ( struct progress_bar pb,
int  width,
int  height 
)

Update the progress bar to a new dimension.

Parameters
pbthe progress bar to update
widththe new progress bar width
heightthe new progress bar height

Definition at line 284 of file progress_bar.c.

References progress_bar::animating, height, max, NSLOG, progress_bar::range, progress_bar::recalculate, riscos_schedule(), ro_gui_progress_bar_animate(), ro_gui_progress_bar_calculate(), ro_gui_progress_bar_redraw_window(), progress_bar::value, progress_bar::visible, progress_bar::w, and width.

Referenced by ro_gui_progress_bar_set_icon(), ro_gui_progress_bar_set_range(), ro_gui_progress_bar_set_value(), and ro_gui_status_position_progress_bar().

Here is the call graph for this function:
Here is the caller graph for this function: