#include "e.h"
#include "e_mod_main.h"
+#include "e_mod_config.h"
struct _E_Config_Dialog_Data
{
e_config_save_queue();
return 1;
}
+
+EAPI void
+e_mod_screen_reader_cfdata_edd_init(E_Config_DD **conf_edd)
+{
+ *conf_edd = E_CONFIG_DD_NEW("Screen_Reader_Config", Config);
+
+#undef T
+#undef D
+#define T Config
+#define D *conf_edd
+ E_CONFIG_VAL(D, T, three_finger_swipe_timeout, INT);
+}
+
+EAPI Config *
+e_mod_screen_reader_cfdata_config_new(void)
+{
+ Config *cfg;
+
+ cfg = E_NEW(Config, 1);
+
+ cfg->three_finger_swipe_timeout = 450;
+
+ return cfg;
+}
+
+EAPI void
+e_mod_screen_reader_cfdata_config_free(Config *cfg)
+{
+ if (cfg)
+ {
+ memset(cfg, 0, sizeof(Config));
+ free(cfg);
+ cfg = NULL;
+ }
+}
#define MOUSE_MOVE 1
#define MOUSE_BUTTON_UP 2
+Mod *_screen_reader_mod = NULL;
+
typedef struct
{
E_Zone *zone;
int distance = 40;
int dx, dy;
int angle = 0;
+ int tfs_timeout = 450;
if (cov->three_finger_down)
{
dx = ev->x - cov->dx;
dy = ev->y - cov->dy;
+ if (_screen_reader_mod) tfs_timeout = _screen_reader_mod->conf->three_finger_swipe_timeout;
+
if (((dx * dx) + (dy * dy)) > (4 * distance * distance)
- && ((ev->timestamp - cov->dt) < (timeout * 3000)))
+ && ((ev->timestamp - cov->dt) < tfs_timeout))
{
/* get root window rotation */
angle = _win_angle_get(target_win);
elm_config_all_flush();
elm_config_save();
}
+
+static void
+_e_mod_config_new(E_Module *m)
+{
+ Mod *mod = m->data;
+ mod->conf = e_mod_screen_reader_cfdata_config_new();
+}
+
+static void
+_e_mod_config_free(E_Module *m)
+{
+ Mod *mod = m->data;
+
+ e_mod_screen_reader_cfdata_config_free(mod->conf);
+ mod->conf = NULL;
+}
/***************************************************************************/
/* module setup */
EAPI E_Module_Api e_modapi =
EAPI void *
e_modapi_init(E_Module *m)
{
+ Mod *mod;
+
+ mod = calloc(1, sizeof(Mod));
+ m->data = mod;
+ e_mod_screen_reader_cfdata_edd_init(&(mod->conf_edd));
+ mod->conf = e_config_domain_load("module.screen-reader-tizen", mod->conf_edd);
+
+ if (!mod->conf) _e_mod_config_new(m);
+
+ _screen_reader_mod = mod;
+
vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS,
_vconf_cb_accessibility_tts_change,
NULL);
}
EAPI int
-e_modapi_shutdown(E_Module *m __UNUSED__)
+e_modapi_shutdown(E_Module *m)
{
INF("[screen-reader module] module shutdown");
if (property_handler) ecore_event_handler_del(property_handler);
_covers_shutdown();
_events_shutdown();
+ Mod *mod = m->data;
+
+ if (mod == _screen_reader_mod) _screen_reader_mod = NULL;
+ _e_mod_config_free(m);
+ E_CONFIG_DD_FREE(mod->conf_edd);
+
+ memset(mod, 0, sizeof(Mod));
+ free(mod);
+ mod = NULL;
+
return 1;
}