summaryrefslogtreecommitdiff
path: root/legacy/elementary/src/lib/elm_access.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2011-08-23 07:44:49 +0000
committerCarsten Haitzler <raster@rasterman.com>2011-08-23 07:44:49 +0000
commitee218406b0a3588d5e116dd2992b302ea4cb8559 (patch)
treecad5fa13597fc4eaf172a7d606a585b563be6833 /legacy/elementary/src/lib/elm_access.c
parentf8cddb17e6dfab1f0b21d6215acea46f7b02a706 (diff)
add visual feedback on accessibility mouseover too
SVN revision: 62713
Diffstat (limited to 'legacy/elementary/src/lib/elm_access.c')
-rw-r--r--legacy/elementary/src/lib/elm_access.c48
1 files changed, 43 insertions, 5 deletions
diff --git a/legacy/elementary/src/lib/elm_access.c b/legacy/elementary/src/lib/elm_access.c
index a4e4b7b..7875086 100644
--- a/legacy/elementary/src/lib/elm_access.c
+++ b/legacy/elementary/src/lib/elm_access.c
@@ -70,6 +70,7 @@ _access_obj_over_timeout_cb(void *data)
70 if (!ac) return EINA_FALSE; 70 if (!ac) return EINA_FALSE;
71 if (_elm_config->access_mode != ELM_ACCESS_MODE_OFF) 71 if (_elm_config->access_mode != ELM_ACCESS_MODE_OFF)
72 { 72 {
73 _elm_access_object_hilight(data);
73 _elm_access_read(ac, ELM_ACCESS_CANCEL, data, NULL); 74 _elm_access_read(ac, ELM_ACCESS_CANCEL, data, NULL);
74 _elm_access_read(ac, ELM_ACCESS_TYPE, data, NULL); 75 _elm_access_read(ac, ELM_ACCESS_TYPE, data, NULL);
75 _elm_access_read(ac, ELM_ACCESS_INFO, data, NULL); 76 _elm_access_read(ac, ELM_ACCESS_INFO, data, NULL);
@@ -100,6 +101,7 @@ _access_obj_mouse_out_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS
100{ 101{
101 Elm_Access_Info *ac = evas_object_data_get(data, "_elm_access"); 102 Elm_Access_Info *ac = evas_object_data_get(data, "_elm_access");
102 if (!ac) return; 103 if (!ac) return;
104 _elm_access_object_unhilight(data);
103 if (ac->delay_timer) 105 if (ac->delay_timer)
104 { 106 {
105 ecore_timer_del(ac->delay_timer); 107 ecore_timer_del(ac->delay_timer);
@@ -184,7 +186,7 @@ _elm_access_text_get(Elm_Access_Info *ac, int type, Evas_Object *obj, Elm_Widget
184 { 186 {
185 if (ai->type == type) 187 if (ai->type == type)
186 { 188 {
187 if (ai->func) return ai->func(ai->data, obj, item); 189 if (ai->func) return ai->func((void *)(ai->data), obj, item);
188 else if (ai->data) return strdup(ai->data); 190 else if (ai->data) return strdup(ai->data);
189 return NULL; 191 return NULL;
190 } 192 }
@@ -247,9 +249,40 @@ _elm_access_object_get(Evas_Object *obj)
247} 249}
248 250
249EAPI void 251EAPI void
250_elm_access_object_hilight(Evas_Object *win, Evas_Object *obj) 252_elm_access_object_hilight(Evas_Object *obj)
251{ 253{
252 // if hilight obj doens exist - create and attach to window 254 Evas_Object *o;
255
256 o = evas_object_name_find(evas_object_evas_get(obj), "_elm_access_disp");
257 if (!o)
258 {
259 o = edje_object_add(evas_object_evas_get(obj));
260 evas_object_name_set(o, "_elm_access_disp");
261 evas_object_layer_set(o, ELM_OBJECT_LAYER_TOOLTIP);
262 }
263 else
264 {
265 Evas_Object *ptarget = evas_object_data_get(o, "_elm_access_target");
266 if (ptarget)
267 {
268 evas_object_data_del(o, "_elm_access_target");
269 // FIXME: delete move/resize/del callbacks from ptarget
270 }
271 }
272 evas_object_data_set(o, "_elm_access_target", obj);
273 // FIXME: track obj pos/size until hilight removed
274 _elm_theme_object_set(obj, o, "access", "base", "default");
275 evas_object_raise(o);
276
277 {
278 Evas_Coord x, y, w, h;
279 evas_object_geometry_get(obj, &x, &y, &w, &h);
280 evas_object_move(o, x, y);
281 evas_object_resize(o, w, h);
282 }
283
284 evas_object_show(o);
285 // if hilight obj doesnt exist - create and attach to window
253 // make sure its on a high layer 286 // make sure its on a high layer
254 // show it and emit signal 287 // show it and emit signal
255 // if exists, move and resize to obj object location 288 // if exists, move and resize to obj object location
@@ -257,9 +290,14 @@ _elm_access_object_hilight(Evas_Object *win, Evas_Object *obj)
257} 290}
258 291
259EAPI void 292EAPI void
260_elm_access_object_unhilight(Evas_Object *win) 293_elm_access_object_unhilight(Evas_Object *obj)
261{ 294{
262 // hide highlight obj is there, emit hide and then del when done 295 Evas_Object *o, *ptarget;
296
297 o = evas_object_name_find(evas_object_evas_get(obj), "_elm_access_disp");
298 if (!o) return;
299 ptarget = evas_object_data_get(o, "_elm_access_target");
300 if (ptarget == obj) evas_object_del(o);
263} 301}
264 302
265EAPI void 303EAPI void