e_dispatch_rotation_event.c \
e_universal_switch.c \
e_mod_utils.c \
+ e_mod_accessibility_conf.c \
e_dispatch_key_event.c
module_la_LIBADD =
--- /dev/null
+#include "e_mod_accessibility_conf.h"
+#include "e.h"
+
+#define DEFAULT_QUICKPANEL_AREA_SIZE 40
+#define DEFAULT_LONGPRESS_TIMEOUT 0.4
+#define ACCESSIBILITY_CONFIG "Accessibility_Config"
+#define MODULE_ACCESSIBILITY "module.accessibility"
+
+typedef struct _E_Accessibility_Config_Data
+{
+ E_Module *module;
+ E_Config_DD *conf_edd;
+ E_Accessibility_Conf_Edd *conf;
+} E_Accessibility_Config_Data;
+
+E_Accessibility_Config_Data *aconfig = NULL;
+
+void
+_e_accessibility_conf_value_check( void )
+{
+ E_Accessibility_Conf_Edd *conf = aconfig->conf;
+
+ if (conf->gesture.quickpanel_area_size <= 0) conf->gesture.quickpanel_area_size = DEFAULT_QUICKPANEL_AREA_SIZE;
+ if (conf->gesture.longpress_timeout <= 0.0) conf->gesture.longpress_timeout = DEFAULT_LONGPRESS_TIMEOUT;
+}
+
+Eina_Bool
+e_accessibility_conf_init(E_Module *m)
+{
+ aconfig = E_NEW(E_Accessibility_Config_Data, 1);
+ if (!aconfig)
+ return EINA_FALSE;
+ aconfig->module = m;
+ aconfig->conf_edd = E_CONFIG_DD_NEW(ACCESSIBILITY_CONFIG, E_Accessibility_Conf_Edd);
+ if (!aconfig->conf_edd)
+ return EINA_FALSE;
+
+ E_CONFIG_VAL(aconfig->conf_edd, E_Accessibility_Conf_Edd, gesture.quickpanel_area_size, UINT);
+ E_CONFIG_VAL(aconfig->conf_edd, E_Accessibility_Conf_Edd, gesture.longpress_timeout, DOUBLE);
+
+ aconfig->conf = e_config_domain_load(MODULE_ACCESSIBILITY, aconfig->conf_edd);
+
+ if (!aconfig->conf)
+ {
+ ERR("Failed to find %s config file.", MODULE_ACCESSIBILITY);
+ return EINA_FALSE;
+ }
+ _e_accessibility_conf_value_check();
+ return EINA_TRUE;
+}
+
+void
+e_accessibility_conf_deinit( void )
+{
+ if (!aconfig)
+ return;
+ if (aconfig->conf)
+ E_FREE(aconfig->conf);
+ E_CONFIG_DD_FREE(aconfig->conf_edd);
+ E_FREE(aconfig);
+}
+
+E_Accessibility_Conf_Edd* e_accessibility_get_configuration( void )
+{
+ return aconfig ? aconfig->conf : NULL;
+}
\ No newline at end of file
--- /dev/null
+#ifndef E_MOD_ACCESSIBILITY_CONF_H__
+#define E_MOD_ACCESSIBILITY_CONF_H__
+
+#include "e.h"
+
+typedef struct _E_Accessibility_Conf_Edd {
+ struct {
+ unsigned int quickpanel_area_size;
+ double longpress_timeout;
+ } gesture;
+} E_Accessibility_Conf_Edd;
+
+Eina_Bool e_accessibility_conf_init();
+void e_accessibility_conf_shutdown();
+E_Accessibility_Conf_Edd* e_accessibility_get_configuration();
+
+#endif//E_MOD_ACCESSIBILITY_CONF_H__
#include <e_dispatch_rotation_event.h>
#include <e_dispatch_key_event.h>
#include "e_universal_switch.h"
+#include "e_mod_accessibility_conf.h"
#define E_A11Y_SERVICE_BUS_NAME "org.enlightenment.wm-screen-reader"
#define E_A11Y_SERVICE_NAVI_IFC_NAME "org.tizen.GestureNavigation"
int highlighted_object_x, highlighted_object_y;
Eina_Bool is_selection_mode;
int object_needs_scroll_from_x, object_needs_scroll_from_y;
-
EAPI E_Module_Api e_modapi =
{
E_MODULE_API_VERSION,
{
_e_mod_log_init();
if (_e_mod_atspi_dbus_init())
- goto fail;
+ {
+ ERROR("Dbus initialization failed.");
+ return NULL;
+ }
if (!_e_mod_atspi_vconf_init())
- {
- _e_mod_atspi_dbus_shutdown();
- goto fail;
- }
+ {
+ _e_mod_atspi_dbus_shutdown();
+ ERROR("AT-SPI vconf initialization failed.");
+ return NULL;
+ }
+ if (!e_accessibility_conf_init(m))
+ {
+ ERROR("Accessibility config initialization failed.");
+ e_modapi_shutdown(m);
+ return NULL;
+ }
return m;
-fail:
- ERROR("Dbus initialization failed.");
-
- return NULL;
}
EAPI int
e_modapi_shutdown(E_Module *m EINA_UNUSED)
{
+ e_accessibility_conf_shutdown();
_e_mod_log_shutdown();
_e_mod_atspi_dbus_shutdown();
MENU_MOUSE_UP_SIGNAL
} signal_type;
-#endif//__E_MOD_MAIN_H__
+#endif//__E_MOD_MAIN_H__
\ No newline at end of file
#include "e.h"
#include "e_comp.h"
#include "e_screen_reader_private.h"
+#include "e_mod_accessibility_conf.h"
-#define QUICKPANEL_AREA_SIZE 40 /* area size to open/close quickpanel */
#define HISTORY_MAX 8
-#define LONGPRESS_TIMEOUT 0.4
+
double MAGIC_NUMBER = 987654321.0;
typedef enum {
cov->hover_gesture.y[1] = ev->root.y;
cov->hover_gesture.finger[1] = ev->multi.device;
cov->hover_gesture.n_fingers = 2;
-
+ E_Accessibility_Conf_Edd* conf = e_accessibility_get_configuration();
/* Make Quickpanel Open Easy */
- if (((cov->hover_gesture.y[0] < cov->zone.y + QUICKPANEL_AREA_SIZE)
- && (cov->hover_gesture.y[1] < cov->zone.y + QUICKPANEL_AREA_SIZE)) ||
- ((cov->hover_gesture.y[0] > cov->zone.y + cov->zone.h - QUICKPANEL_AREA_SIZE)
- && (cov->hover_gesture.y[1] > cov->zone.y + cov->zone.h - QUICKPANEL_AREA_SIZE)))
+ if (((cov->hover_gesture.y[0] < cov->zone.y + conf->gesture.quickpanel_area_size)
+ && (cov->hover_gesture.y[1] < cov->zone.y + conf->gesture.quickpanel_area_size)) ||
+ ((cov->hover_gesture.y[0] > cov->zone.y + cov->zone.h - conf->gesture.quickpanel_area_size)
+ && (cov->hover_gesture.y[1] > cov->zone.y + cov->zone.h - conf->gesture.quickpanel_area_size)))
{
/* Do what _on_hover_timeout does */
cov->hover_gesture.longpressed = EINA_TRUE;