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