]> Dogcows Code - chaz/tint2/blob - src/battery/battery.h
fixed indentation inconsistency by dmitry
[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 typedef struct Battery {
21 // always start with area
22 Area area;
23
24 config_color font;
25 int bat1_posy;
26 int bat2_posy;
27 } Battery;
28
29 enum chargestate {
30 BATTERY_UNKNOWN,
31 BATTERY_CHARGING,
32 BATTERY_DISCHARGING
33 };
34
35 typedef struct battime {
36 int16_t hours;
37 int8_t minutes;
38 int8_t seconds;
39 } battime;
40
41 typedef struct batstate {
42 int percentage;
43 struct battime time;
44 enum chargestate state;
45 } batstate;
46
47 extern struct batstate battery_state;
48 extern PangoFontDescription *bat1_font_desc;
49 extern PangoFontDescription *bat2_font_desc;
50
51 extern int8_t battery_low_status;
52 extern char *battery_low_cmd;
53 extern char *path_energy_now, *path_energy_full, *path_current_now, *path_status;
54
55
56 // initialize clock : y position, ...
57 void update_battery();
58
59 void init_battery();
60
61 void draw_battery(void *obj, cairo_t *c, int active);
62
63 void resize_battery(void *obj);
64
65 #endif
This page took 0.037996 seconds and 5 git commands to generate.