match eeze changes, add init/shutdown calls to illume2 keyboard

SVN revision: 49130
This commit is contained in:
Mike Blumenkrantz 2010-05-22 07:04:26 +00:00
parent 90a51634ea
commit 97529addef
11 changed files with 55 additions and 53 deletions

View File

@ -246,14 +246,14 @@ AC_ARG_ENABLE([device-udev],
AC_CACHE_VAL([e_cv_want_device_udev], [e_cv_want_device_udev=no]))
if test "x$e_cv_want_device_udev" = "xyes";then
device_backend=eeze_udev
AC_DEFINE_UNQUOTED([HAVE_EEZE_UDEV],[1],[enable udev support])
device_backend=eeze
AC_DEFINE_UNQUOTED([HAVE_EEZE],[1],[enable udev support])
else
device_backend=ehal
fi
AC_MSG_RESULT($device_backend)
AM_CONDITIONAL([HAVE_EEZE_UDEV], [test "x${device_backend}" = "xeeze_udev"])
AM_CONDITIONAL([HAVE_EEZE], [test "x${device_backend}" = "xeeze"])
# doxygen program for documentation building
@ -773,7 +773,7 @@ config/illume-home/Makefile
po/Makefile.in
])
if test "$device_backend" = "eeze_udev";then
if test "$device_backend" = "eeze";then
device_backend+=" (EXPERIMENTAL!)"
fi

View File

@ -92,13 +92,9 @@ void *alloca (size_t);
#include <Efreet.h>
#include <Efreet_Mime.h>
#include <E_DBus.h>
#ifdef HAVE_EUKIT
#include <E_Ukit.h>
#else
#include <E_Hal.h>
#endif
#ifdef HAVE_EEZE_UDEV
#include <Eeze_Udev.h>
#ifdef HAVE_EEZE
#include <Eeze.h>
#endif
#ifdef EAPI

View File

@ -1,7 +1,7 @@
MAINTAINERCLEANFILES = Makefile.in
MODULE = battery
if HAVE_EEZE_UDEV
if HAVE_EEZE
DEVICE_FILE = e_mod_udev.c
else
DEVICE_FILE = e_mod_dbus.c

View File

@ -5,7 +5,7 @@ struct _E_Config_Dialog_Data
{
int show_alert;
int poll_interval;
#ifdef HAVE_EEZE_UDEV
#ifdef HAVE_EEZE
int fuzzy;
#endif
int alert_time;
@ -20,7 +20,7 @@ struct _E_Config_Dialog_Data
Evas_Object *show_alert_percent;
Evas_Object *dismiss_alert_label;
Evas_Object *alert_timeout;
#ifdef HAVE_EEZE_UDEV
#ifdef HAVE_EEZE
Evas_Object *fuzzy;
#endif
} ui;
@ -72,7 +72,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
cfdata->poll_interval = battery_config->poll_interval;
cfdata->alert_timeout = battery_config->alert_timeout;
cfdata->force_mode = battery_config->force_mode;
#ifdef HAVE_EEZE_UDEV
#ifdef HAVE_EEZE
cfdata->fuzzy = battery_config->fuzzy;
#endif
@ -190,7 +190,7 @@ _cb_radio_changed(void *data, Evas_Object *obj __UNUSED__)
if (!(cfdata = data)) return;
fuzzy = (cfdata->force_mode == SUBSYSTEM);
#ifdef HAVE_EEZE_UDEV
#ifdef HAVE_EEZE
e_widget_disabled_set(cfdata->ui.fuzzy, !fuzzy);
#endif
}
@ -254,7 +254,7 @@ _advanced_create_widgets(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_D
ob = e_widget_radio_add(evas, _("Internal"), NOSUBSYSTEM, rg);
e_widget_on_change_hook_set(ob, _cb_radio_changed, cfdata);
e_widget_list_object_append(o, ob, 1, 0, 0.0);
#ifdef HAVE_EEZE_UDEV
#ifdef HAVE_EEZE
ob = e_widget_radio_add(evas, _("udev"), SUBSYSTEM, rg);
e_widget_on_change_hook_set(ob, _cb_radio_changed, cfdata);
e_widget_list_object_append(o, ob, 1, 0, 0.0);
@ -280,7 +280,7 @@ _advanced_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfda
if (!battery_config) return 0;
battery_config->poll_interval = cfdata->poll_interval;
#ifdef HAVE_EEZE_UDEV
#ifdef HAVE_EEZE
battery_config->fuzzy = cfdata->fuzzy;
#endif
@ -319,7 +319,7 @@ _advanced_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *c
(cfdata->alert_percent != battery_config->alert_p) ||
(cfdata->poll_interval != battery_config->poll_interval) ||
(cfdata->alert_timeout != battery_config->alert_timeout) ||
#ifdef HAVE_EEZE_UDEV
#ifdef HAVE_EEZE
(cfdata->fuzzy != battery_config->fuzzy) ||
#endif
(cfdata->force_mode != battery_config->force_mode) ||

View File

@ -79,8 +79,8 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
inst->warning = NULL;
inst->popup_battery = NULL;
#ifdef HAVE_EEZE_UDEV
eeze_udev_init();
#ifdef HAVE_EEZE
eeze_init();
#else
e_dbus_init();
e_hal_init();
@ -100,8 +100,8 @@ _gc_shutdown(E_Gadcon_Client *gcc)
{
Instance *inst;
#ifdef HAVE_EEZE_UDEV
eeze_udev_shutdown();
#ifdef HAVE_EEZE
eeze_shutdown();
#else
e_hal_shutdown();
e_dbus_shutdown();
@ -353,7 +353,7 @@ _battery_config_updated(void)
}
if (battery_config->have_subsystem == UNKNOWN)
{
#ifdef HAVE_EEZE_UDEV
#ifdef HAVE_EEZE
battery_config->have_subsystem = SUBSYSTEM;
#else
if (!e_dbus_bus_get(DBUS_BUS_SYSTEM))
@ -387,7 +387,7 @@ _battery_config_updated(void)
ecore_exe_free(battery_config->batget_exe);
battery_config->batget_exe = NULL;
}
#ifdef HAVE_EEZE_UDEV
#ifdef HAVE_EEZE
_battery_udev_start();
#else
E_DBus_Connection *conn;
@ -765,7 +765,7 @@ e_modapi_shutdown(E_Module *m __UNUSED__)
battery_config->menu = NULL;
}
#ifdef HAVE_EEZE_UDEV
#ifdef HAVE_EEZE
_battery_udev_stop();
#else
_battery_dbus_stop();

View File

@ -41,7 +41,7 @@ struct _Config
int have_battery;
int have_power;
int have_subsystem;
#ifdef HAVE_EEZE_UDEV
#ifdef HAVE_EEZE
Eeze_Udev_Watch *acwatch;
Eeze_Udev_Watch *batwatch;
Eina_Bool fuzzy;
@ -64,7 +64,7 @@ typedef struct _Ac_Adapter Ac_Adapter;
struct _Battery
{
const char *udi;
#ifdef HAVE_EEZE_UDEV
#ifdef HAVE_EEZE
Ecore_Poller *poll;
#else
E_DBus_Signal_Handler *prop_change;
@ -72,7 +72,7 @@ struct _Battery
#endif
Eina_Bool present:1;
Eina_Bool charging:1;
#ifdef HAVE_EEZE_UDEV
#ifdef HAVE_EEZE
double last_update;
double percent;
double current_charge;
@ -101,7 +101,7 @@ struct _Battery
struct _Ac_Adapter
{
const char *udi;
#ifndef HAVE_EEZE_UDEV
#ifndef HAVE_EEZE
E_DBus_Signal_Handler *prop_change;
#endif
Eina_Bool present:1;

View File

@ -7,7 +7,7 @@ static void _e_mod_kbd_device_ignore_load_file(const char *file);
static void _e_mod_kbd_device_kbd_add(const char *udi);
static void _e_mod_kbd_device_kbd_del(const char *udi);
static void _e_mod_kbd_device_kbd_eval(void);
#ifdef HAVE_EEZE_UDEV
#ifdef HAVE_EEZE
static void _e_mod_kbd_device_udev_event(const char *device, const char *event, void *data __UNUSED__, Eeze_Udev_Watch *watch __UNUSED__);
#else
static void _e_mod_kbd_device_cb_input_kbd(void *data __UNUSED__, void *reply, DBusError *err);
@ -19,7 +19,7 @@ static void _e_mod_kbd_device_dbus_chg(void *data __UNUSED__, DBusMessage *msg);
/* local variables */
static int have_real_kbd = 0;
#ifdef HAVE_EEZE_UDEV
#ifdef HAVE_EEZE
static Eeze_Udev_Watch *watch;
#else
static E_DBus_Connection *_dbus_conn = NULL;
@ -34,10 +34,13 @@ e_mod_kbd_device_init(void)
{
/* load the 'ignored' keyboard file */
_e_mod_kbd_device_ignore_load();
#ifdef HAVE_EEZE_UDEV
#ifdef HAVE_EEZE
eeze_init();
watch = eeze_udev_watch_add(EEZE_UDEV_TYPE_KEYBOARD, EEZE_UDEV_EVENT_NONE,
_e_mod_kbd_device_udev_event, NULL);
#else
e_dbus_init();
e_hal_init();
/* try to attach to the system dbus */
if (!(_dbus_conn = e_dbus_bus_get(DBUS_BUS_SYSTEM))) return;
@ -69,13 +72,16 @@ e_mod_kbd_device_shutdown(void)
{
char *str;
#ifdef HAVE_EEZE_UDEV
#ifdef HAVE_EEZE
if (watch) eeze_udev_watch_del(watch);
eeze_shutdown();
#else
/* remove the dbus signal handlers if we can */
if (_dev_add) e_dbus_signal_handler_del(_dbus_conn, _dev_add);
if (_dev_del) e_dbus_signal_handler_del(_dbus_conn, _dev_del);
if (_dev_chg) e_dbus_signal_handler_del(_dbus_conn, _dev_chg);
e_hal_shutdown();
e_dbus_shutdown();
#endif
/* free the list of ignored keyboards */
EINA_LIST_FREE(_ignore_kbds, str)
@ -136,7 +142,7 @@ _e_mod_kbd_device_ignore_load_file(const char *file)
fclose(f);
}
#ifdef HAVE_EEZE_UDEV
#ifdef HAVE_EEZE
static void
_e_mod_kbd_device_udev_event(const char *device, const char *event, void *data __UNUSED__, Eeze_Udev_Watch *watch __UNUSED__)
{

View File

@ -1,7 +1,7 @@
MAINTAINERCLEANFILES = Makefile.in
MODULE = temperature
if HAVE_EEZE_UDEV
if HAVE_EEZE
DEVICE_FILE = e_mod_udev.c
else
DEVICE_FILE =

View File

@ -12,7 +12,7 @@ struct _E_Config_Dialog_Data
} poll;
int unit_method;
#ifdef HAVE_EEZE_UDEV
#ifdef HAVE_EEZE
int backend;
#endif
struct
@ -77,7 +77,7 @@ _fill_data_tempget(E_Config_Dialog_Data *cfdata)
cfdata->temp.low = cfdata->inst->low;
cfdata->temp.high = cfdata->inst->high;
cfdata->sensor = 0;
#ifdef HAVE_EEZE_UDEV
#ifdef HAVE_EEZE
cfdata->backend = cfdata->inst->backend;
if (cfdata->backend == TEMPGET)
{
@ -120,7 +120,7 @@ _fill_data_tempget(E_Config_Dialog_Data *cfdata)
default:
break;
}
#ifdef HAVE_EEZE_UDEV
#ifdef HAVE_EEZE
}
#endif
}
@ -240,7 +240,7 @@ _basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
e_widget_toolbook_page_append(otb, NULL, _("Temperatures"), ol,
1, 0, 1, 0, 0.5, 0.0);
#ifdef HAVE_EEZE_UDEV
#ifdef HAVE_EEZE
ol = e_widget_list_add(evas, 0, 0);
rg = e_widget_radio_group_new(&(cfdata->backend));
ow = e_widget_radio_add(evas, _("Internal"), TEMPGET, rg);
@ -261,7 +261,7 @@ _basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
cfdata->inst->units = cfdata->unit_method;
cfdata->inst->low = cfdata->temp.low;
cfdata->inst->high = cfdata->temp.high;
#ifdef HAVE_EEZE_UDEV
#ifdef HAVE_EEZE
cfdata->inst->backend = cfdata->backend;
#endif

View File

@ -62,7 +62,7 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
inst->sensor_type = SENSOR_TYPE_NONE;
inst->sensor_name = NULL;
inst->units = CELCIUS;
#ifdef HAVE_EEZE_UDEV
#ifdef HAVE_EEZE
inst->backend = UDEV;
#endif
if (!temperature_config->faces)
@ -74,7 +74,7 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
E_CONFIG_LIMIT(inst->low, 0, 100);
E_CONFIG_LIMIT(inst->high, 0, 220);
E_CONFIG_LIMIT(inst->units, CELCIUS, FAHRENHEIT);
#ifdef HAVE_EEZE_UDEV
#ifdef HAVE_EEZE
E_CONFIG_LIMIT(inst->backend, TEMPGET, UDEV);
#endif
@ -89,7 +89,7 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
inst->o_temp = o;
inst->module = temperature_config->module;
inst->have_temp = -1;
#ifdef HAVE_EEZE_UDEV
#ifdef HAVE_EEZE
if (inst->backend == TEMPGET)
{
#endif
@ -99,11 +99,11 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
inst->tempget_del_handler =
ecore_event_handler_add(ECORE_EXE_EVENT_DEL,
_temperature_cb_exe_del, inst);
#ifdef HAVE_EEZE_UDEV
#ifdef HAVE_EEZE
}
else
{
eeze_udev_init();
eeze_init();
inst->temp_poller = ecore_poller_add(ECORE_POLLER_CORE, inst->poll_interval, temperature_udev_update_poll, inst);
temperature_udev_update(inst);
}
@ -141,7 +141,7 @@ _gc_shutdown(E_Gadcon_Client *gcc)
#ifdef HAVE_EEEZ_UDEV
if (inst->temp_poller)
ecore_poller_del(inst->temp_poller);
eeze_udev_shutdown();
eeze_shutdown();
#endif
if (inst->o_temp) evas_object_del(inst->o_temp);
inst->o_temp = NULL;
@ -193,7 +193,7 @@ _gc_id_new(E_Gadcon_Client_Class *client_class)
inst->sensor_type = SENSOR_TYPE_NONE;
inst->sensor_name = NULL;
inst->units = CELCIUS;
#ifdef HAVE_EEZE_UDEV
#ifdef HAVE_EEZE
inst->backend = TEMPGET;
#endif
if (!temperature_config->faces)
@ -278,7 +278,7 @@ _temperature_face_shutdown(const Eina_Hash *hash __UNUSED__, const void *key __U
inst = hdata;
if (inst->sensor_name) eina_stringshare_del(inst->sensor_name);
if (inst->id) eina_stringshare_del(inst->id);
#ifdef HAVE_EEZE_UDEV
#ifdef HAVE_EEZE
if (inst->tempdevs)
{
const char *s;
@ -316,7 +316,7 @@ temperature_face_update_config(Config_Face *inst)
inst->tempget_exe = NULL;
}
#ifdef HAVE_EEZE_UDEV
#ifdef HAVE_EEZE
if (inst->backend == TEMPGET)
{
if (inst->temp_poller)
@ -336,7 +336,7 @@ temperature_face_update_config(Config_Face *inst)
ECORE_EXE_PIPE_READ |
ECORE_EXE_PIPE_READ_LINE_BUFFERED |
ECORE_EXE_NOT_LEADER, inst);
#ifdef HAVE_EEZE_UDEV
#ifdef HAVE_EEZE
}
else
{
@ -421,7 +421,7 @@ e_modapi_init(E_Module *m)
E_CONFIG_VAL(D, T, low, INT);
E_CONFIG_VAL(D, T, high, INT);
E_CONFIG_VAL(D, T, sensor_type, INT);
#ifdef HAVE_EEZE_UDEV
#ifdef HAVE_EEZE
E_CONFIG_VAL(D, T, backend, INT);
#endif
E_CONFIG_VAL(D, T, sensor_name, STR);

View File

@ -21,7 +21,7 @@ struct _Config_Face
/* saved * loaded config values */
int poll_interval;
int low, high;
#ifdef HAVE_EEZE_UDEV
#ifdef HAVE_EEZE
Eina_List *tempdevs;
int backend;
Ecore_Poller *temp_poller;
@ -55,7 +55,7 @@ struct _Config
E_Module *module;
};
#ifdef HAVE_EEZE_UDEV
#ifdef HAVE_EEZE
typedef enum _Backend
{
TEMPGET,