]> Dogcows Code - chaz/tint2/blob - src/battery/battery.h
added battery code
[chaz/tint2] / src / battery / battery.h
1 /**************************************************************************
2 * Copyright (C) 2009 Sebastian Reichel <elektranox@gmail.com>
3 *
4 * Battery with functional data (percentage, time to life) and drawing data
5 * (area, font, ...). Each panel use his own drawing data.
6 *
7 **************************************************************************/
8
9 #ifndef BATTERY_H
10 #define BATTERY_H
11
12 #include <sys/types.h>
13 #include <sys/stat.h>
14 #include <fcntl.h>
15
16 #include "common.h"
17 #include "area.h"
18
19 typedef struct Battery {
20 // always start with area
21 Area area;
22
23 config_color font;
24 int bat1_posy;
25 int bat2_posy;
26 } Battery;
27
28 enum chargestate {
29 BATTERY_UNKNOWN,
30 BATTERY_CHARGING,
31 BATTERY_DISCHARGING
32 };
33
34 typedef struct battime {
35 int16_t hours;
36 int8_t minutes;
37 int8_t seconds;
38 } battime;
39
40 typedef struct batstate {
41 int percentage;
42 struct battime time;
43 enum chargestate state;
44 } batstate;
45
46 extern struct batstate battery_state;
47 extern PangoFontDescription *bat1_font_desc;
48 extern PangoFontDescription *bat2_font_desc;
49
50 extern int8_t battery_low_status;
51 extern char* battery_low_cmd;
52
53 // initialize clock : y position, ...
54 void update_battery(struct batstate *data);
55
56 void init_battery();
57
58 void draw_battery(void *obj, cairo_t *c, int active);
59
60 void resize_battery(void *obj);
61
62 #endif
This page took 0.043954 seconds and 5 git commands to generate.