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 int desktop_notifications;
51 Eeze_Udev_Watch *acwatch;
52 Eeze_Udev_Watch *batwatch;
54 #if defined HAVE_EEZE || defined __OpenBSD__
59 // FIXME: on bat_conf del dbus_pending_call_cancel(dbus.have);
60 // then set dbus.have to NULL
61 DBusPendingCall *have;
62 // FIXME: on bat_conf del e_dbus_signal_handler_del() these
63 E_DBus_Signal_Handler *dev_add;
64 E_DBus_Signal_Handler *dev_del;
69 typedef struct _Battery Battery;
70 typedef struct _Ac_Adapter Ac_Adapter;
75 #if defined HAVE_EEZE || defined __OpenBSD__
78 E_DBus_Signal_Handler *prop_change;
79 Eina_Bool can_charge:1;
83 #if defined HAVE_EEZE || defined __OpenBSD__
86 double current_charge;
88 double last_full_charge;
101 const char *charge_units;
103 const char *technology;
106 Eina_Bool got_prop:1;
116 E_DBus_Signal_Handler *prop_change;
125 Battery *_battery_battery_find(const char *udi);
126 Ac_Adapter *_battery_ac_adapter_find(const char *udi);
127 void _battery_device_update(void);
129 /* in e_mod_udev.c */
130 int _battery_udev_start(void);
131 void _battery_udev_stop(void);
132 /* end e_mod_udev.c */
133 #elif !defined __OpenBSD__
134 /* in e_mod_dbus.c */
135 int _battery_dbus_start(void);
136 void _battery_dbus_stop(void);
137 /* end e_mod_dbus.c */
139 /* in e_mod_openbsd.c */
140 int _battery_openbsd_start(void);
141 void _battery_openbsd_stop(void);
142 /* end e_mod_openbsd.c */
145 EAPI extern E_Module_Api e_modapi;
147 EAPI void *e_modapi_init (E_Module *m);
148 EAPI int e_modapi_shutdown (E_Module *m);
149 EAPI int e_modapi_save (E_Module *m);
151 E_Config_Dialog *e_int_config_battery_module(E_Container *con, const char *params __UNUSED__);
153 void _battery_config_updated(void);
154 extern Config *battery_config;
157 * @addtogroup Optional_Gadgets
160 * @defgroup Module_Battery Battery
162 * Shows battery level and current status, may do actions given some