# checks for pkg-config
dnl ========================================================================
-PKG_CHECK_MODULES(ENLIGHTENMENT, [enlightenment, dlog])
+PKG_CHECK_MODULES(ENLIGHTENMENT, [enlightenment, dlog, vconf])
AC_SUBST(ENLIGHTENMENT_CFLAGS)
AC_SUBST(ENLIGHTENMENT_LIBS)
#include "e_mod_main.h"
#include <e_screen_reader_config.h>
#include <e_screen_reader_private.h>
+#include <vconf.h>
#define E_A11Y_SERVICE_BUS_NAME "org.enlightenment.wm-screen-reader"
#define E_A11Y_SERVICE_NAVI_IFC_NAME "org.tizen.GestureNavigation"
}
}
+void screen_reader_cb(keynode_t *node, void *user_data)
+{
+ int is_sr_enabled;
+
+ is_sr_enabled = vconf_keynode_get_bool(node);
+ DEBUG("vconf_keynode_get_bool(node): %d", is_sr_enabled);
+
+ if (is_sr_enabled < 0)
+ {
+ ERROR("Could not read VCONFKEY_SETAPPL_ACCESSIBILITY_TTS key value.\n");
+ return;
+ }
+
+ DEBUG("screen reader: %d", is_sr_enabled);
+ if (is_sr_enabled)
+ _e_mod_submodules_init();
+ else
+ _e_mod_submodules_shutdown();
+}
+
+Eina_Bool _e_mod_atspi_vconf_init(void)
+{
+ int ret;
+ int is_sr_enabled;
+
+ ret = vconf_get_bool(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, &is_sr_enabled);
+ if (ret != 0)
+ {
+ ERROR("Could not read VCONFKEY_SETAPPL_ACCESSIBILITY_TTS key value.\n");
+ return EINA_FALSE;
+ }
+
+ ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, screen_reader_cb, NULL);
+ if(ret != 0)
+ {
+ ERROR("Could not add information level callback\n");
+ return EINA_FALSE;
+ }
+
+ if (is_sr_enabled)
+ _e_mod_submodules_init();
+ else
+ _e_mod_submodules_shutdown();
+
+ return EINA_TRUE;
+}
+
EAPI void *
e_modapi_init(E_Module *m)
{
if (_e_mod_atspi_dbus_init())
goto fail;
+ if (!_e_mod_atspi_vconf_init())
+ {
+ _e_mod_atspi_dbus_shutdown();
+ goto fail;
+ }
+
return m;
fail:
ERROR("Dbus initialization failed.");