path: root/src/modules/battery/e_mod_main.h
diff options
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2010-05-18 10:39:30 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2010-05-18 10:39:30 +0000
commitf7f417298ba44499852e1267adbfb6c38265bc9b (patch)
tree79d4ab37b46e537959756b4888cefb4b1310d43c /src/modules/battery/e_mod_main.h
parent7c2df0efc675865d222e7cead5b1620d782a4f64 (diff)
udev mode enabled in battery module (--enable-device-udev) with polling time supported. udev times are extremely accurate AT THE TIME THAT THEY POLL.
I have added what I call "fuzzy mode", which (in udev mode only) averages the past 10 polling times to give a somewhat more readable measurement. bugs: none that I know of? todo: make fuzzy mode average the previous 10 times without resetting except on state change, fix "fuzzy mode" checkbox to only enable when udev is selected SVN revision: 48973
Diffstat (limited to 'src/modules/battery/e_mod_main.h')
1 files changed, 24 insertions, 25 deletions
diff --git a/src/modules/battery/e_mod_main.h b/src/modules/battery/e_mod_main.h
index 58d53db38..2202d1027 100644
--- a/src/modules/battery/e_mod_main.h
+++ b/src/modules/battery/e_mod_main.h
@@ -41,9 +41,11 @@ struct _Config
int have_battery;
int have_power;
int have_subsystem;
-#ifdef HAVE_EUDEV
Eeze_Udev_Watch *acwatch;
Eeze_Udev_Watch *batwatch;
+ Eina_Bool fuzzy;
+ int fuzzcount;
struct {
// FIXME: on bat_conf del dbus_pending_call_cancel(dbus.have);
@@ -62,14 +64,24 @@ typedef struct _Ac_Adapter Ac_Adapter;
struct _Battery
const char *udi;
-#ifdef HAVE_EUDEV
- Eeze_Udev_Watch *watch;
+ Ecore_Poller *poll;
E_DBus_Signal_Handler *prop_change;
+ Eina_Bool can_charge:1;
Eina_Bool present:1;
- Eina_Bool can_charge:1;
- int state;
+ Eina_Bool charging:1;
+ double last_update;
+ double percent;
+ double current_charge;
+ double design_charge;
+ double last_full_charge;
+ double charge_rate;
+ double time_full;
+ double time_left;
int percent;
int current_charge;
int design_charge;
@@ -77,9 +89,10 @@ struct _Battery
int charge_rate;
int time_full;
int time_left;
- const char *technology;
const char *type;
const char *charge_units;
+ const char *technology;
const char *model;
const char *vendor;
Eina_Bool got_prop:1;
@@ -88,9 +101,7 @@ struct _Battery
struct _Ac_Adapter
const char *udi;
-#ifdef HAVE_EUDEV
- Eeze_Udev_Watch *watch;
E_DBus_Signal_Handler *prop_change;
Eina_Bool present:1;
@@ -99,26 +110,14 @@ struct _Ac_Adapter
Battery *_battery_battery_find(const char *udi);
Ac_Adapter *_battery_ac_adapter_find(const char *udi);
-/* in e_mod_dbus.c */
-void _battery_dbus_battery_props(void *data, void *reply_data, DBusError *error);
-void _battery_dbus_ac_adapter_props(void *data, void *reply_data, DBusError *error);
-void _battery_dbus_battery_property_changed(void *data, DBusMessage *msg);
-void _battery_dbus_battery_add(const char *udi);
-void _battery_dbus_battery_del(const char *udi);
-void _battery_dbus_ac_adapter_add(const char *udi);
-void _battery_dbus_ac_adapter_del(const char *udi);
-void _battery_dbus_find_battery(void *user_data, void *reply_data, DBusError *err);
-void _battery_dbus_find_ac(void *user_data, void *reply_data, DBusError *err);
-void _battery_dbus_is_battery(void *user_data, void *reply_data, DBusError *err);
-void _battery_dbus_is_ac_adapter(void *user_data, void *reply_data, DBusError *err);
-void _battery_dbus_dev_add(void *data, DBusMessage *msg);
-void _battery_dbus_dev_del(void *data, DBusMessage *msg);
-void _battery_dbus_have_dbus(void);
-void _battery_dbus_shutdown(void);
void _battery_device_update(void);
+/* in e_mod_dbus.c */
+void _battery_dbus_start(void);
+void _battery_dbus_stop(void);
/* end e_mod_dbus.c */
/* in e_mod_udev.c */
void _battery_udev_start(void);
+void _battery_udev_stop(void);
/* end e_mod_udev.c */
Eina_List *device_batteries;
Eina_List *device_ac_adapters;