c91f1b6c3678b5e0274990c7ec8834b0a7a06174
[framework/uifw/e17.git] / src / modules / temperature / e_mod_main.h
1 #ifndef E_MOD_MAIN_H
2 #define E_MOD_MAIN_H
3
4 #ifdef HAVE_EEZE
5 # include <Eeze.h>
6 #else
7 # include <E_Hal.h>
8 #endif
9
10 #include "e_mod_main_private.h"
11
12 typedef struct _Config Config;
13 typedef struct _Config_Face Config_Face;
14
15 typedef enum _Unit
16 {
17    CELCIUS,
18    FAHRENHEIT
19 } Unit;
20
21 struct _Config_Face
22 {
23    const char *id;
24    /* saved * loaded config values */
25    int poll_interval;
26    int low, high;
27 #ifdef HAVE_EEZE
28    Eina_List *tempdevs;
29    int backend;
30    Ecore_Poller *temp_poller;
31 #endif
32    int sensor_type;
33    const char *sensor_name;
34    Unit units;
35    /* config state */
36    E_Gadcon_Client *gcc;
37    Evas_Object *o_temp;
38
39    E_Module *module;
40
41    E_Config_Dialog *config_dialog;
42    E_Menu *menu;
43    Ecore_Exe *tempget_exe;
44    Ecore_Event_Handler *tempget_data_handler;
45    Ecore_Event_Handler *tempget_del_handler;
46
47    Eina_Bool have_temp:1;
48 #ifdef __FreeBSD__
49    int mib[5];
50 #endif
51 };
52
53 struct _Config
54 {
55    /* saved * loaded config values */
56    Eina_Hash *faces;
57    /* config state */
58    E_Module *module;
59 };
60
61 #ifdef HAVE_EEZE
62 typedef enum _Backend
63 {
64    TEMPGET,
65    UDEV
66 } Backend;
67
68 Eina_Bool temperature_udev_update_poll(void *data);
69 void temperature_udev_update(void *data);
70 #endif
71
72 EAPI extern E_Module_Api e_modapi;
73
74 EAPI void *e_modapi_init(E_Module *m);
75 EAPI int e_modapi_shutdown(E_Module *m);
76 EAPI int e_modapi_save(E_Module *m);
77
78 Eina_Bool _temperature_cb_exe_data(void *data, int type, void *event);
79 Eina_Bool _temperature_cb_exe_del(void *data, int type, void *event);
80 void _temperature_face_level_set(Config_Face *inst, double level);
81 void config_temperature_module(Config_Face *inst);
82 void temperature_face_update_config(Config_Face *inst);
83 Eina_List *temperature_get_bus_files(const char* bus);
84
85 #endif