Update preset.
[bertos.git] / bertos / gui / levelbar.h
1 /**
2  * \file
3  * Copyright 2004, 2006 Develer S.r.l. (http://www.develer.com/)
4  *
5  *
6  * \author Stefano Fedrigo <aleph@develer.com>
7  *
8  * \brief Graphics level bar widget
9  */
10
11 #ifndef GUI_LEVELBAR_H
12 #define GUI_LEVELBAR_H
13
14 #include <gfx/gfx.h>
15
16
17 /** Type of levelbar */
18 #define LBAR_HORIZONTAL 1
19 #define LBAR_VERTICAL   2
20
21 typedef struct LevelBar
22 {
23         struct Bitmap *bitmap;
24         int type;
25         int pos;                 ///< Current level
26         int min;                 ///< Minimum level
27         int max;                 ///< Maximum level
28         coord_t x1, y1, x2, y2;  ///< Position of widget in the bitmap
29 } LevelBar;
30
31 void lbar_init(struct LevelBar *lb, struct Bitmap *bmp, int type, int min, int max, int pos,
32                 coord_t x1, coord_t y1, coord_t x2, coord_t y2);
33 void lbar_setLevel(struct LevelBar *lb, int level);
34 int  lbar_getLevel(struct LevelBar *lb);
35 void lbar_changeLevel(struct LevelBar *lb, int delta);
36 void lbar_setMax(struct LevelBar *lb, int max);
37 void lbar_draw(struct LevelBar *lb);
38
39 #endif /* GUI_LEVELBAR_H */