2005-02-09 04:14:08 -08:00
|
|
|
/*
|
|
|
|
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
|
|
|
*/
|
2004-12-27 00:33:52 -08:00
|
|
|
#ifndef E_MOD_MAIN_H
|
|
|
|
#define E_MOD_MAIN_H
|
|
|
|
|
|
|
|
typedef struct _Config Config;
|
2005-02-09 04:14:08 -08:00
|
|
|
typedef struct _Config_Face Config_Face;
|
2004-12-27 00:33:52 -08:00
|
|
|
typedef struct _Battery Battery;
|
|
|
|
typedef struct _Battery_Face Battery_Face;
|
|
|
|
|
2005-02-09 04:14:08 -08:00
|
|
|
typedef struct _Status Status;
|
|
|
|
|
2004-12-27 02:49:46 -08:00
|
|
|
#define CHECK_NONE 0
|
|
|
|
#define CHECK_LINUX_ACPI 1
|
|
|
|
#define CHECK_LINUX_APM 2
|
|
|
|
|
2004-12-27 00:33:52 -08:00
|
|
|
struct _Config
|
|
|
|
{
|
2005-01-01 18:39:44 -08:00
|
|
|
double poll_time;
|
2005-01-10 23:08:38 -08:00
|
|
|
int alarm;
|
2005-02-09 04:14:08 -08:00
|
|
|
Evas_List *faces;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _Config_Face
|
|
|
|
{
|
|
|
|
unsigned char enabled;
|
2004-12-27 00:33:52 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _Battery
|
|
|
|
{
|
2005-02-10 04:00:39 -08:00
|
|
|
E_Menu *config_menu;
|
2005-02-10 08:42:07 -08:00
|
|
|
E_Menu *config_menu_poll;
|
|
|
|
E_Menu *config_menu_alarm;
|
2005-02-10 04:00:39 -08:00
|
|
|
Evas_List *faces;
|
2005-02-09 04:14:08 -08:00
|
|
|
|
2004-12-27 00:33:52 -08:00
|
|
|
Config *conf;
|
2005-01-10 23:08:38 -08:00
|
|
|
int alarm_triggered;
|
2005-02-09 04:14:08 -08:00
|
|
|
|
|
|
|
int battery_check_mode;
|
|
|
|
Ecore_Timer *battery_check_timer;
|
|
|
|
int battery_prev_drain;
|
|
|
|
int battery_prev_ac;
|
|
|
|
int battery_prev_battery;
|
2004-12-27 00:33:52 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _Battery_Face
|
|
|
|
{
|
|
|
|
E_Container *con;
|
2005-02-10 04:00:39 -08:00
|
|
|
|
|
|
|
E_Menu *menu;
|
|
|
|
Config_Face *conf;
|
2005-02-09 04:14:08 -08:00
|
|
|
|
2004-12-27 00:33:52 -08:00
|
|
|
Evas_Object *bat_object;
|
|
|
|
Evas_Object *event_object;
|
2005-02-09 04:14:08 -08:00
|
|
|
|
2005-01-25 06:24:38 -08:00
|
|
|
E_Gadman_Client *gmc;
|
2004-12-27 00:33:52 -08:00
|
|
|
};
|
|
|
|
|
2005-02-09 04:14:08 -08:00
|
|
|
#define BATTERY_STATE_NONE 0
|
|
|
|
#define BATTERY_STATE_CHARGING 1
|
|
|
|
#define BATTERY_STATE_DISCHARGING 2
|
|
|
|
|
|
|
|
struct _Status
|
|
|
|
{
|
|
|
|
/* Low battery */
|
|
|
|
unsigned char alarm;
|
|
|
|
/* Is there a battery? */
|
|
|
|
unsigned char has_battery;
|
|
|
|
/* charging, discharging, none */
|
|
|
|
unsigned char state;
|
|
|
|
/* Battery level */
|
|
|
|
double level;
|
|
|
|
/* Text */
|
|
|
|
/* reading == % left */
|
|
|
|
char *reading;
|
|
|
|
/* time == time left to empty / full */
|
|
|
|
char *time;
|
|
|
|
};
|
|
|
|
|
2005-04-11 20:34:31 -07:00
|
|
|
EAPI void *e_modapi_init (E_Module *m);
|
|
|
|
EAPI int e_modapi_shutdown (E_Module *m);
|
|
|
|
EAPI int e_modapi_save (E_Module *m);
|
|
|
|
EAPI int e_modapi_info (E_Module *m);
|
|
|
|
EAPI int e_modapi_about (E_Module *m);
|
2004-12-27 00:33:52 -08:00
|
|
|
|
|
|
|
#endif
|