10 typedef struct _Config Config;
16 #define CHECK_SYS_ACPI 4
22 #define POPUP_DEBOUNCE_CYCLES 2
26 /* saved * loaded config values */
28 int alert; /* Alert on minutes remaining */
29 int alert_p; /* Alert on percentage remaining */
30 int alert_timeout; /* Popup dismissal timeout */
31 int suspend_below; /* Suspend if batter drops below this level */
32 int force_mode; /* force use of batget or hal */
33 /* just config state */
35 E_Config_Dialog *config_dialog;
38 Ecore_Exe *batget_exe;
39 Ecore_Event_Handler *batget_data_handler;
40 Ecore_Event_Handler *batget_del_handler;
41 Ecore_Timer *alert_timer;
48 Eeze_Udev_Watch *acwatch;
49 Eeze_Udev_Watch *batwatch;
51 #if defined HAVE_EEZE || defined __OpenBSD__
56 // FIXME: on bat_conf del dbus_pending_call_cancel(dbus.have);
57 // then set dbus.have to NULL
58 DBusPendingCall *have;
59 // FIXME: on bat_conf del e_dbus_signal_handler_del() these
60 E_DBus_Signal_Handler *dev_add;
61 E_DBus_Signal_Handler *dev_del;
66 typedef struct _Battery Battery;
67 typedef struct _Ac_Adapter Ac_Adapter;
72 #if defined HAVE_EEZE || defined __OpenBSD__
75 E_DBus_Signal_Handler *prop_change;
76 Eina_Bool can_charge:1;
80 #if defined HAVE_EEZE || defined __OpenBSD__
83 double current_charge;
85 double last_full_charge;
98 const char *charge_units;
100 const char *technology;
103 Eina_Bool got_prop:1;
113 E_DBus_Signal_Handler *prop_change;
122 Battery *_battery_battery_find(const char *udi);
123 Ac_Adapter *_battery_ac_adapter_find(const char *udi);
124 void _battery_device_update(void);
126 /* in e_mod_udev.c */
127 int _battery_udev_start(void);
128 void _battery_udev_stop(void);
129 /* end e_mod_udev.c */
130 #elif !defined __OpenBSD__
131 /* in e_mod_dbus.c */
132 int _battery_dbus_start(void);
133 void _battery_dbus_stop(void);
134 /* end e_mod_dbus.c */
136 /* in e_mod_openbsd.c */
137 int _battery_openbsd_start(void);
138 void _battery_openbsd_stop(void);
139 /* end e_mod_openbsd.c */
142 EAPI extern E_Module_Api e_modapi;
144 EAPI void *e_modapi_init (E_Module *m);
145 EAPI int e_modapi_shutdown (E_Module *m);
146 EAPI int e_modapi_save (E_Module *m);
148 E_Config_Dialog *e_int_config_battery_module(E_Container *con, const char *params __UNUSED__);
150 void _battery_config_updated(void);
151 extern Config *battery_config;