forked from sam-itt/sofis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
odo-gauge.h
48 lines (36 loc) · 1.18 KB
/
odo-gauge.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
* SPDX-FileCopyrightText: 2021 Samuel Cuella <samuel.cuella@gmail.com>
*
* This file is part of SoFIS - an open source EFIS
*
* SPDX-License-Identifier: GPL-2.0-only
*/
#ifndef ODO_GAUGE_H
#define ODO_GAUGE_H
#include <SDL2/SDL.h>
#include <stdbool.h>
#include "sfv-gauge.h"
#include "digit-barrel.h"
typedef struct{
DigitBarrelState *barrel_states;
uintf8_t nbarrel_states; /*Must be the same type as OdoGauge::nbarrels*/
SDL_Rect *fill_rects;
uintf8_t nfill_rects; /*Must be the same type as OdoGauge::nbarrels*/
int pskip;
}OdoGaugeState;
typedef struct{
SfvGauge super;
DigitBarrel **barrels;
int *heights;
uintf8_t nbarrels;
int rubis;
float max_value;
OdoGaugeState state;
}OdoGauge;
OdoGauge *odo_gauge_new(DigitBarrel *barrel, int height, int rubis);
OdoGauge *odo_gauge_new_multiple(int rubis, int nbarrels, ...);
OdoGauge *odo_gauge_vanew_multiple(int rubis, int nbarrels, va_list ap);
OdoGauge *odo_gauge_init(OdoGauge *self, int rubis, int nbarrels, ...);
OdoGauge *odo_gauge_vainit(OdoGauge *self, int rubis, int nbarrels, va_list ap);
bool odo_gauge_set_value(OdoGauge *self, float value, bool animated);
#endif /* ODO_GAUGE_H */