static void
_current_highlight_object_set(AtspiAccessible *obj)
{
- GError *err = NULL;
- if (!obj)
- {
- DEBUG("Clearing highligjt object");
- current_obj = NULL;
- return;
- }
- if (current_obj == obj)
- {
- DEBUG("Object already highlighted");
- return;
- }
- if (obj && ATSPI_IS_COMPONENT(obj))
- {
- AtspiComponent *comp = atspi_accessible_get_component(obj);
- if (!comp)
- {
- GError *err = NULL;
- gchar *role = atspi_accessible_get_role_name(obj, &err);
- ERROR("AtspiComponent *comp NULL, [%s]", role);
- GERROR_CHECK(err);
- g_free(role);
- return;
- }
- atspi_component_grab_highlight(comp, &err);
- GERROR_CHECK(err)
- gchar *name;
- gchar *role;
-
-
- current_obj = obj;
- const ObjectCache *oc = object_cache_get(obj);
-
- if (oc) {
- name = atspi_accessible_get_name(obj, &err);
- GERROR_CHECK(err)
- role = atspi_accessible_get_role_name(obj, &err);
- GERROR_CHECK(err)
- DEBUG("New highlighted object: %s, role: %s, (%d %d %d %d)",
- role,
- name,
- oc->bounds->x, oc->bounds->y, oc->bounds->width, oc->bounds->height);
- haptic_vibrate_start();
- }
- else {
- name = atspi_accessible_get_name(obj, &err);
- GERROR_CHECK(err)
- role = atspi_accessible_get_role_name(obj, &err);
- GERROR_CHECK(err)
- DEBUG("New highlighted object: %s, role: %s",
- name,
- role
- );
- haptic_vibrate_start();
- }
- g_free(role);
- g_free(name);
- }
- else
- DEBUG("Unable to highlight object");
+ //TODO
+ //speak virtually focused widget
}
void test_debug(AtspiAccessible *current_widget)
void navigator_shutdown(void)
{
- GError *err = NULL;
- if (current_obj)
- {
- AtspiComponent *comp = atspi_accessible_get_component(current_obj);
- if (comp)
- {
- atspi_component_clear_highlight(comp, &err);
- GERROR_CHECK(err);
- }
- }
if (context)
{
flat_navi_context_free(context);