{
Eina_List *desc, *ret = NULL;
FilterResult fr0;
-
+
desc = _descendants_list_get(root);
DEBUG("All descendants: %d", eina_list_count(desc));
GArray *states = NULL;
int a;
-/*
- DEBUG("Przed lista");
- EINA_LIST_FOREACH_SAFE(desc, l, ln, obj) {
- DEBUG("Role: %s, Name:%s", atspi_accessible_get_name(obj, NULL), atspi_accessible_get_role_name(obj, NULL));
- st = atspi_accessible_get_state_set (obj);
- states = atspi_state_set_get_states (st);
- DEBUG("Has states:%d", states->len);
- for (a = 0; a < states->len; ++a) {
- DEBUG("%d", g_array_index (states, AtspiStateType, a));
- }
-
- }
- DEBUG("Po liscie");
-*/
// remove object that are not in root's viewport
const ObjectCache *oc = object_cache_get(root);
if (!oc || !oc->bounds || (oc->bounds->height < 0) || (oc->bounds->width < 0))
DEBUG("Candidates: %d", eina_list_count(ret));
EINA_LIST_FOREACH_SAFE(ret, l, ln, obj) {
- DEBUG("Role: %s, Name:%s", atspi_accessible_get_name(obj, NULL), atspi_accessible_get_role_name(obj, NULL));
- st = atspi_accessible_get_state_set (obj);
- states = atspi_state_set_get_states (st);
- DEBUG("Has states:%d", states->len);
- for (a = 0; a < states->len; ++a) {
- DEBUG("%d", g_array_index (states, AtspiStateType, a));
- }
-
+ DEBUG("Role: %s, Name:%s", atspi_accessible_get_name(obj, NULL), atspi_accessible_get_role_name(obj, NULL));
+ st = atspi_accessible_get_state_set (obj);
+ states = atspi_state_set_get_states (st);
+ DEBUG("Has states:%d", states->len);
+ for (a = 0; a < states->len; ++a)
+ DEBUG("%d", g_array_index (states, AtspiStateType, a));
}
return ret;
}
if (obj && ATSPI_IS_COMPONENT(obj))
{
+ DEBUG("OBJ && IS COMPONENT");
AtspiComponent *comp = atspi_accessible_get_component(obj);
if (!comp)
{
gchar *name;
gchar *role;
-
current_obj = obj;
const ObjectCache *oc = object_cache_get(obj);
role = atspi_accessible_get_role_name(obj, &err);
GERROR_CHECK(err)
DEBUG("New focused object: %s, role: %s, (%d %d %d %d)",
- role,
name,
+ role,
oc->bounds->x, oc->bounds->y, oc->bounds->width, oc->bounds->height);
haptic_vibrate_start();
}
{
Service_Data *sd = (Service_Data*)user_data;
char *name;
+ char *names = NULL;
char *description;
char *role_name;
char *other;
- char *return_text = NULL;
+ char ret[256] = "\0";
sd->currently_focused = event->source;
description = atspi_accessible_get_description(sd->currently_focused, NULL);
DEBUG("->->->->->-> WIDGET GAINED FOCUS: %s <-<-<-<-<-<-<-", name);
DEBUG("->->->->->-> FROM SUBTREE HAS NAME: %s <-<-<-<-<-<-<-", other);
- if (strncmp(description, "\0", 1))
- return_text = strdup(description);
- else if (strncmp(name, "\0", 1))
- return_text = strdup(name);
+ if (strncmp(name, "\0", 1))
+ names = strdup(name);
else if (strncmp(other, "\0", 1))
- return_text = strdup(name);
- else
- return_text = strdup(role_name);
+ names = strdup(other);
+
+ if (names) {
+ strncat(ret, names, sizeof(ret) - strlen(ret) - 1);
+ strncat(ret, ", ", 2);
+ }
+
+ strncat(ret, role_name, sizeof(ret) - strlen(ret) - 1);
+ if (strncmp(description, "\0", 1))
+ strncat(ret, ", ", 2);
+ strncat(ret, description, sizeof(ret) - strlen(ret) - 1);
free(name);
free(description);
free(role_name);
free(other);
- return return_text;
+ return strdup(ret);
}
static char *spi_on_caret_move_get_text(AtspiEvent *event, void *user_data)
sd->tracking_signal_name = "test_event";
event.detail1 = 1;
accessible.name = "test_name";
+ accessible.role = ATSPI_ROLE_ICON;
accessible.description = NULL;
event.source = &accessible;
char *return_value = spi_event_get_text_to_read(&event, sd);
- fail_if(!return_value || strcmp(return_value, "test_name"));
+ fail_if(!return_value || strcmp(return_value, "test_name, Icon"));
free(return_value);
}
END_TEST
event.detail1 = 1;
accessible.name = "test_name";
accessible.description = "test description";
+ accessible.role = ATSPI_ROLE_ICON;
event.source = &accessible;
char *return_value = spi_event_get_text_to_read(&event, sd);
- fail_if(!return_value || strcmp(return_value, "test description"));
+ fail_if(!return_value || strcmp(return_value, "test_name, Icon, test description"));
free(return_value);
}
END_TEST