]> Dogcows Code - chaz/tint2/blob - src/battery/battery.h
patch for FULL battery by peter.ebden
[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 * Need kernel > 2.6.23.
7 *
8 **************************************************************************/
9
10 #ifndef BATTERY_H
11 #define BATTERY_H
12
13 #include <sys/types.h>
14 #include <sys/stat.h>
15 #include <fcntl.h>
16
17 #include "common.h"
18 #include "area.h"
19
20
21 typedef struct Battery {
22 // always start with area
23 Area area;
24
25 config_color font;
26 int bat1_posy;
27 int bat2_posy;
28 } Battery;
29
30 enum chargestate {
31 BATTERY_UNKNOWN,
32 BATTERY_CHARGING,
33 BATTERY_DISCHARGING,
34 BATTERY_FULL
35 };
36
37 typedef struct battime {
38 int16_t hours;
39 int8_t minutes;
40 int8_t seconds;
41 } battime;
42
43 typedef struct batstate {
44 int percentage;
45 struct battime time;
46 enum chargestate state;
47 } batstate;
48
49 extern struct batstate battery_state;
50 extern PangoFontDescription *bat1_font_desc;
51 extern PangoFontDescription *bat2_font_desc;
52
53 extern int8_t battery_low_status;
54 extern char *battery_low_cmd;
55 extern char *path_energy_now, *path_energy_full, *path_current_now, *path_status;
56
57
58 // initialize clock : y position, ...
59 void update_battery();
60
61 void init_battery();
62 void init_battery_panel(void *panel);
63
64 void draw_battery(void *obj, cairo_t *c, int active);
65
66 void resize_battery(void *obj);
67
68 #endif
This page took 0.040343 seconds and 5 git commands to generate.