2005-01-01 18:39:44 -08:00
|
|
|
#ifndef E_MOD_MAIN_H
|
|
|
|
#define E_MOD_MAIN_H
|
|
|
|
|
2012-11-30 06:38:34 -08:00
|
|
|
#include "e.h"
|
|
|
|
|
2011-01-06 10:41:58 -08:00
|
|
|
#ifdef HAVE_EEZE
|
|
|
|
# include <Eeze.h>
|
|
|
|
#endif
|
|
|
|
|
2012-11-30 06:38:34 -08:00
|
|
|
|
|
|
|
typedef enum _Sensor_Type
|
|
|
|
{
|
|
|
|
SENSOR_TYPE_NONE,
|
|
|
|
SENSOR_TYPE_FREEBSD,
|
|
|
|
SENSOR_TYPE_OPENBSD,
|
|
|
|
SENSOR_TYPE_OMNIBOOK,
|
|
|
|
SENSOR_TYPE_LINUX_MACMINI,
|
|
|
|
SENSOR_TYPE_LINUX_I2C,
|
|
|
|
SENSOR_TYPE_LINUX_ACPI,
|
|
|
|
SENSOR_TYPE_LINUX_PCI,
|
|
|
|
SENSOR_TYPE_LINUX_PBOOK,
|
|
|
|
SENSOR_TYPE_LINUX_INTELCORETEMP,
|
|
|
|
SENSOR_TYPE_LINUX_THINKPAD,
|
|
|
|
SENSOR_TYPE_LINUX_SYS
|
|
|
|
} Sensor_Type;
|
2009-12-17 00:22:39 -08:00
|
|
|
|
2008-11-11 16:53:56 -08:00
|
|
|
typedef struct _Config Config;
|
|
|
|
typedef struct _Config_Face Config_Face;
|
2016-11-30 00:06:45 -08:00
|
|
|
typedef struct _Tempthread Tempthread;
|
2008-11-11 16:53:56 -08:00
|
|
|
|
2005-09-20 11:16:33 -07:00
|
|
|
typedef enum _Unit
|
|
|
|
{
|
2016-07-05 08:45:00 -07:00
|
|
|
CELSIUS,
|
2005-09-20 11:16:33 -07:00
|
|
|
FAHRENHEIT
|
|
|
|
} Unit;
|
2005-01-01 18:39:44 -08:00
|
|
|
|
2016-11-30 00:06:45 -08:00
|
|
|
struct _Tempthread
|
|
|
|
{
|
|
|
|
Config_Face *inst;
|
|
|
|
int poll_interval;
|
|
|
|
Sensor_Type sensor_type;
|
|
|
|
const char *sensor_name;
|
|
|
|
const char *sensor_path;
|
|
|
|
void *extn;
|
|
|
|
#ifdef HAVE_EEZE
|
|
|
|
Eina_List *tempdevs;
|
|
|
|
#endif
|
|
|
|
Eina_Bool initted : 1;
|
|
|
|
};
|
|
|
|
|
2006-12-17 14:01:45 -08:00
|
|
|
struct _Config_Face
|
2005-01-01 18:39:44 -08:00
|
|
|
{
|
2008-11-11 16:53:56 -08:00
|
|
|
const char *id;
|
2006-04-20 04:30:25 -07:00
|
|
|
/* saved * loaded config values */
|
2008-11-11 16:53:56 -08:00
|
|
|
int poll_interval;
|
|
|
|
int low, high;
|
|
|
|
int sensor_type;
|
2016-12-04 05:46:02 -08:00
|
|
|
int temp;
|
2008-11-11 16:53:56 -08:00
|
|
|
const char *sensor_name;
|
|
|
|
Unit units;
|
2006-12-17 14:01:45 -08:00
|
|
|
/* config state */
|
|
|
|
E_Gadcon_Client *gcc;
|
2008-11-11 16:53:56 -08:00
|
|
|
Evas_Object *o_temp;
|
2016-11-30 00:06:45 -08:00
|
|
|
#ifdef HAVE_EEZE
|
2016-12-02 18:28:45 -08:00
|
|
|
Ecore_Poller *poller;
|
|
|
|
Tempthread *tth;
|
2016-11-30 00:06:45 -08:00
|
|
|
int backend;
|
|
|
|
#endif
|
2008-11-11 16:53:56 -08:00
|
|
|
E_Module *module;
|
2006-12-17 14:01:45 -08:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
E_Config_Dialog *config_dialog;
|
2008-11-11 16:53:56 -08:00
|
|
|
E_Menu *menu;
|
2016-11-30 00:06:45 -08:00
|
|
|
Ecore_Thread *th;
|
2008-11-11 16:53:56 -08:00
|
|
|
|
2010-05-20 03:12:41 -07:00
|
|
|
Eina_Bool have_temp:1;
|
2005-01-01 18:39:44 -08:00
|
|
|
};
|
|
|
|
|
2006-12-17 14:01:45 -08:00
|
|
|
struct _Config
|
|
|
|
{
|
|
|
|
/* saved * loaded config values */
|
2008-12-17 07:33:43 -08:00
|
|
|
Eina_Hash *faces;
|
2006-12-17 14:01:45 -08:00
|
|
|
/* config state */
|
2008-11-11 16:53:56 -08:00
|
|
|
E_Module *module;
|
2006-12-17 14:01:45 -08:00
|
|
|
};
|
|
|
|
|
2010-05-22 00:04:26 -07:00
|
|
|
#ifdef HAVE_EEZE
|
2010-05-20 03:12:41 -07:00
|
|
|
typedef enum _Backend
|
|
|
|
{
|
|
|
|
TEMPGET,
|
|
|
|
UDEV
|
|
|
|
} Backend;
|
2010-05-23 15:23:14 -07:00
|
|
|
|
2016-11-30 00:06:45 -08:00
|
|
|
int temperature_udev_get(Tempthread *tth);
|
2010-05-20 03:12:41 -07:00
|
|
|
#endif
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API extern E_Module_Api e_modapi;
|
2005-09-23 10:13:47 -07:00
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void *e_modapi_init(E_Module *m);
|
|
|
|
E_API int e_modapi_shutdown(E_Module *m);
|
|
|
|
E_API int e_modapi_save(E_Module *m);
|
2005-12-27 09:16:58 -08:00
|
|
|
|
2006-12-17 14:01:45 -08:00
|
|
|
void config_temperature_module(Config_Face *inst);
|
|
|
|
void temperature_face_update_config(Config_Face *inst);
|
2016-11-30 00:06:45 -08:00
|
|
|
|
|
|
|
int temperature_tempget_get(Tempthread *tth);
|
2006-04-20 04:30:25 -07:00
|
|
|
|
2012-01-19 15:25:32 -08:00
|
|
|
/**
|
|
|
|
* @addtogroup Optional_Gadgets
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @defgroup Module_Temperature Temperature
|
|
|
|
*
|
|
|
|
* Monitors computer temperature sensors and may do actions given some
|
|
|
|
* thresholds.
|
|
|
|
*
|
|
|
|
* @see Module_CPUFreq
|
|
|
|
* @}
|
|
|
|
*/
|
2005-01-01 18:39:44 -08:00
|
|
|
#endif
|