GFXprim
2D bitmap graphics library with emphasis on speed and correctness
Loading...
Searching...
No Matches
gp_widget_pbar.h
Go to the documentation of this file.
1//SPDX-License-Identifier: LGPL-2.0-or-later
2
3/*
4
5 Copyright (c) 2014-2024 Cyril Hrubis <metan@ucw.cz>
6
7 */
8
37#ifndef GP_WIDGET_PBAR_H
38#define GP_WIDGET_PBAR_H
39
40#include <stdint.h>
41
77
88
89struct gp_widget_pbar {
90 uint64_t max;
91 uint64_t val;
92 int32_t step;
93 enum gp_widget_pbar_unit unit;
94};
95
105gp_widget *gp_widget_pbar_new(uint64_t val, uint64_t max,
106 enum gp_widget_pbar_unit unit);
107
114void gp_widget_pbar_val_set(gp_widget *self, uint64_t val);
115
122void gp_widget_pbar_max_set(gp_widget *self, uint64_t max);
123
132
141
142#endif /* GP_WIDGET_PBAR_H */
void gp_widget_pbar_max_set(gp_widget *self, uint64_t max)
Sets a progress bar maximum.
void gp_widget_pbar_val_set(gp_widget *self, uint64_t val)
Sets a progress bar value.
uint64_t gp_widget_pbar_val_get(gp_widget *self)
Returns progressbar value.
uint64_t gp_widget_pbar_max_get(gp_widget *self)
Returns progress bar max value.
gp_widget_pbar_unit
A progress bar widget units.
@ GP_WIDGET_PBAR_SECONDS
Progress bar is in seconds.
@ GP_WIDGET_PBAR_INVERSE
Inverse the value shown on the screen.
@ GP_WIDGET_PBAR_UNIT_MASK
Unit mask.
@ GP_WIDGET_PBAR_NONE
No unit.
@ GP_WIDGET_PBAR_PERCENTS
Progress bar is in percents.
gp_widget * gp_widget_pbar_new(uint64_t val, uint64_t max, enum gp_widget_pbar_unit unit)
Allocate and initialize new progress bar widget.
gp_widget_pbar_event_type
A gp_widget_event::sub_type for a progress bar widget.
@ GP_WIDGET_PBAR_VAL_CHANGED
Emitted when progress bar value is changed.
A widget base.
Definition gp_widget.h:28