#include <Elementary.h>
#include "elm_priv.h"
+#include "elm_interface_scrollable.h"
static const char ACCESS_SMART_NAME[] = "elm_access";
static Eina_Bool mouse_event_enable = EINA_TRUE;
static Eina_Bool read_mode = EINA_FALSE;
+static Evas_Coord_Point offset;
+static Evas_Object *s_parent; /* scrollable parent */
static Evas_Object * _elm_access_add(Evas_Object *parent);
}
}
+void
+_elm_access_highlight_object_scroll(Evas_Object *obj, int type, int x, int y)
+{
+ Evas *evas;
+ Evas_Object *ho;
+ Evas_Coord_Rectangle ho_area;
+
+ if (!obj) return;
+
+ evas = evas_object_evas_get(obj);
+ if (!evas) return;
+
+ switch (type)
+ {
+ case 0:
+ ho = _access_highlight_object_get(obj);
+ if (!ho)
+ {
+ s_parent = NULL;
+ return;
+ }
+ else
+ {
+ /* find scrollable parent */
+ s_parent = elm_widget_parent_get(ho);
+ while (s_parent)
+ {
+ if(!!evas_object_smart_interface_get(s_parent, ELM_SCROLLABLE_IFACE_NAME))
+ break;
+ s_parent = elm_widget_parent_get(s_parent);
+ }
+
+ if (!s_parent) return;
+ //TODO: new interface to disable repeat event
+
+ evas_object_geometry_get
+ (ho, &ho_area.x, &ho_area.y, &ho_area.w, &ho_area.h);
+
+ offset.x = x - (ho_area.x + (ho_area.w / 2));
+ offset.y = y - (ho_area.y + (ho_area.h / 2));
+ }
+
+ evas_event_feed_mouse_in(evas, 0, NULL);
+ evas_event_feed_mouse_move(evas, x - offset.x, y - offset.y, 0, NULL);
+ evas_event_feed_mouse_down(evas, 1, EVAS_BUTTON_NONE, 0, NULL);
+ break;
+
+ case 1:
+ if (!s_parent) return;
+ evas_event_feed_mouse_move(evas, x - offset.x, y - offset.y, 0, NULL);
+ break;
+
+ case 2:
+ if (!s_parent) return;
+ evas_event_feed_mouse_up(evas, 1, EVAS_BUTTON_NONE, 0, NULL);
+ //TODO: new interface to enable repeat event
+ break;
+
+ default:
+ break;
+ }
+}
+
static Eina_Bool
_access_action_callback_call(Evas_Object *obj,
Elm_Access_Action_Type type,
void _elm_access_widget_item_access_order_set(Elm_Widget_Item *item, Eina_List *objs);
const Eina_List *_elm_access_widget_item_access_order_get(const Elm_Widget_Item *item);
void _elm_access_widget_item_access_order_unset(Elm_Widget_Item *item);
+void _elm_access_highlight_object_scroll(Evas_Object *obj, int type, int x, int y);
EAPI void _elm_access_clear(Elm_Access_Info *ac);
EAPI void _elm_access_text_set(Elm_Access_Info *ac, int type, const char *text);
int type __UNUSED__,
void *event)
{
+ Ecore_X_Atom atom_scroll;
Elm_Win_Smart_Data *sd = data;
Ecore_X_Event_Client_Message *e = event;
{
if ((unsigned int)e->data.l[0] == sd->x.xwin)
{
+ atom_scroll = ecore_x_atom_get("_E_MOD_SCREEN_READER_ACTION_SCROLL_");
+
if ((unsigned int)e->data.l[1] ==
ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_NEXT)
{
_elm_access_highlight_object_activate
(ELM_WIDGET_DATA(sd)->obj, ELM_ACTIVATE_DOWN);
}
+ else if ((unsigned int)e->data.l[1] == atom_scroll)
+ {
+ _elm_access_highlight_object_scroll(ELM_WIDGET_DATA(sd)->obj,
+ e->data.l[2], e->data.l[3], e->data.l[4]);
+ }
}
}
return ECORE_CALLBACK_PASS_ON;