]> Dogcows Code - chaz/tint2/blob - src/battery/battery.h
issue 158 : dissociate object initialization from panel initialization
[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 };
35
36 typedef struct battime {
37 int16_t hours;
38 int8_t minutes;
39 int8_t seconds;
40 } battime;
41
42 typedef struct batstate {
43 int percentage;
44 struct battime time;
45 enum chargestate state;
46 } batstate;
47
48 extern struct batstate battery_state;
49 extern PangoFontDescription *bat1_font_desc;
50 extern PangoFontDescription *bat2_font_desc;
51
52 extern int8_t battery_low_status;
53 extern char *battery_low_cmd;
54 extern char *path_energy_now, *path_energy_full, *path_current_now, *path_status;
55
56
57 // initialize clock : y position, ...
58 void update_battery();
59
60 void init_battery();
61 void init_battery_panel(void *panel);
62
63 void draw_battery(void *obj, cairo_t *c, int active);
64
65 void resize_battery(void *obj);
66
67 #endif
This page took 0.04229 seconds and 5 git commands to generate.