#include <atspi/atspi.h>
/**
- * @brief Application events
- *
- * @APP_TRACKER_EVENT_VIEW_CHANGE_STARTED - occuring when any of application's
- * UI parts has change its visuals, including moving, resizing widgets, scrolling etc.
- *
- * @APP_TRACKER_EVENT_VIEW_CHANGED occuring when any of application's
- * UI parts has changed its visuals and a prefined time period elapsed
- *
- */
-typedef enum
-{
- APP_TRACKER_EVENT_VIEW_CHANGE_STARTED,
- APP_TRACKER_EVENT_VIEW_CHANGED,
- APP_TRACKER_EVENT_COUNT
-} AppTrackerEventType;
-
-/**
* @brief Callback
*/
-typedef void (*AppTrackerEventCB)(AppTrackerEventType type, void *user_data);
+typedef void (*AppTrackerEventCB)(void *user_data);
/**
* @brief Register listener on given event type.
*
* @param obj AtspiAccessible application object type
- * @param event type of event to register on
* @param cb callback type
* @param user_data pointer passed to cb function.
*/
-void app_tracker_callback_register(AtspiAccessible *app, AppTrackerEventType event, AppTrackerEventCB cb, void *user_data);
+void app_tracker_callback_register(AtspiAccessible *app, AppTrackerEventCB cb, void *user_data);
/**
* @brief Unregister listener on given event type.
*
* @param obj AtspiAccessible application object type
- * @param event type of event to register on
* @param cb callback type
* @param user_data pointer passed to cb function.
*/
-void app_tracker_callback_unregister(AtspiAccessible *app, AppTrackerEventType event, AppTrackerEventCB cb, void *user_data);
+void app_tracker_callback_unregister(AtspiAccessible *app, AppTrackerEventCB cb, void *user_data);
/**
* @brief Initialize app tracker module.
typedef struct
{
- AppTrackerEventType type;
AppTrackerEventCB func;
void *user_data;
} EventCallbackData;
}
static void
-_subtree_callbacks_call(AppTrackerEventType event, SubTreeRootData *std)
+_subtree_callbacks_call(SubTreeRootData *std)
{
DEBUG("START");
GList *l;
for (l = std->callbacks; l != NULL; l = l->next)
{
ecd = l->data;
- if (ecd->type == event)
- {
- ecd->func(event, ecd->user_data);
- }
+ ecd->func(ecd->user_data);
}
DEBUG("END");
}
DEBUG("START");
SubTreeRootData *std = user_data;
- _subtree_callbacks_call(APP_TRACKER_EVENT_VIEW_CHANGED, std);
+ _subtree_callbacks_call(std);
std->timer = 0;
DEBUG("END");
if (std->timer)
g_source_remove(std->timer);
else
- _subtree_callbacks_call(APP_TRACKER_EVENT_VIEW_CHANGE_STARTED, std);
+ _subtree_callbacks_call(std);
std->timer = g_timeout_add(APP_TRACKER_INVACTIVITY_TIMEOUT, _on_timeout_cb, std);
}
atspi_event_listener_register(_listener, "object:state-changed:showing", NULL);
atspi_event_listener_register(_listener, "object:state-changed:visible", NULL);
- atspi_event_listener_register(_listener, "object:children-changed", NULL);
atspi_event_listener_register(_listener, "object:bounds-changed", NULL);
atspi_event_listener_register(_listener, "object:visible-data-changed", NULL);
{
atspi_event_listener_deregister(_listener, "object:state-changed:showing", NULL);
atspi_event_listener_deregister(_listener, "object:state-changed:visible", NULL);
- atspi_event_listener_deregister(_listener, "object:children-changed", NULL);
atspi_event_listener_deregister(_listener, "object:bounds-changed", NULL);
atspi_event_listener_deregister(_listener, "object:visible-data-changed", NULL);
if (--_init_count < 0) _init_count = 0;
}
-void app_tracker_callback_register(AtspiAccessible *app, AppTrackerEventType event, AppTrackerEventCB cb, void *user_data)
+void app_tracker_callback_register(AtspiAccessible *app, AppTrackerEventCB cb, void *user_data)
{
DEBUG("START");
SubTreeRootData *rd = NULL;
}
cd = g_new(EventCallbackData, 1);
- cd->type = event;
cd->func = cb;
cd->user_data = user_data;
DEBUG("END");
}
-void app_tracker_callback_unregister(AtspiAccessible *app, AppTrackerEventType event, AppTrackerEventCB cb, void *user_data)
+void app_tracker_callback_unregister(AtspiAccessible *app, AppTrackerEventCB cb, void *user_data)
{
DEBUG("START");
GList *l;
DEBUG("START");
DEBUG("------------------------");
const char *name = atspi_accessible_get_name(obj, NULL);
- const char *role = atspi_accessible_get_role_name(obj, NULL);
+ const char *role = atspi_accessible_get_localized_role_name(obj, NULL);
const char *description = atspi_accessible_get_description(obj, NULL);
char *state_name = NULL;
AtspiStateSet *st = atspi_accessible_get_state_set (obj);
DEBUG(" %s", state_name);
free(state_name);
}
-
+ DEBUG("LOCALE:%s", atspi_accessible_get_object_locale(obj, NULL));
DEBUG("------------------------");
DEBUG("END");
}
if (!obj)
return strdup("");
- char *role = atspi_accessible_get_role_name(obj, NULL);
+ char *role = atspi_accessible_get_localized_role_name(obj, NULL);
char ret[TTS_MAX_TEXT_SIZE] = "\0";
if (!strncmp(role, "entry", strlen(role)))
{
AtspiEditableText *edit = NULL;
GError *err = NULL;
- gchar *roleName = NULL;
gchar *actionName = NULL;
gint number = 0;
gint i = 0;
current_widget = current_obj;
- roleName = atspi_accessible_get_role_name(current_widget, &err);
- if (!roleName)
- {
- ERROR("The role name is null");
- return;
- }
- GERROR_CHECK(err)
- DEBUG("Widget role prev: %s\n", roleName);
-
display_info_about_object(current_widget);
edit = atspi_accessible_get_editable_text_iface (current_widget);
AtspiAccessible *obj = NULL;
AtspiAccessible *current = NULL;
AtspiAccessible *parent = NULL;
- gchar *role = NULL;
+ AtspiRole role;
current = flat_navi_context_current_get(context);
parent = atspi_accessible_get_parent (current, NULL);
- role = atspi_accessible_get_role_name(parent, NULL);
+ role = atspi_accessible_get_role(parent, NULL);
- if (strcmp(role, "list"))
+ if (role != ATSPI_ROLE_LIST)
{
- DEBUG("That operation can be done only on list, it is:%s", role);
- g_free(role);
+ DEBUG("That operation can be done only on list, it is:%s", atspi_accessible_get_role_name(parent, NULL));
return;
}
- g_free(role);
visi = flat_navi_context_current_children_count_visible_get(context);
DEBUG("There is %d elements visible", visi);
AtspiAccessible *obj = NULL;
AtspiAccessible *current = NULL;
AtspiAccessible *parent = NULL;
- gchar *role = NULL;
+ AtspiRole role;
current = flat_navi_context_current_get(context);
parent = atspi_accessible_get_parent (current, NULL);
- role = atspi_accessible_get_role_name(parent, NULL);
+ role = atspi_accessible_get_role(parent, NULL);
- if (strcmp(role, "list"))
+ if (role != ATSPI_ROLE_LIST)
{
- DEBUG("That operation can be done only on list, it is:%s", role);
- g_free(role);
+ DEBUG("That operation can be done only on list, it is:%s", atspi_accessible_get_role_name(parent, NULL));
return;
}
- g_free(role);
visi = flat_navi_context_current_children_count_visible_get(context);
DEBUG("There is %d elements visible", visi);
return EINA_FALSE;
}
AtspiAccessible *obj = NULL;
+ AtspiRole role;
obj = flat_navi_context_current_get(context);
if (!obj)
return EINA_FALSE;
- char *role = atspi_accessible_get_role_name(obj, NULL);
- if (!strncmp(role, "entry", strlen(role)))
+ role = atspi_accessible_get_role(obj, NULL);
+ if (role == ATSPI_ROLE_ENTRY)
{
AtspiStateSet* state_set = atspi_accessible_get_state_set (obj);
if (atspi_state_set_contains(state_set, ATSPI_STATE_FOCUSED))
{
g_object_unref(state_set);
- g_free(role);
return EINA_TRUE;
}
g_object_unref(state_set);
- g_free(role);
return EINA_FALSE;
}
- g_free(role);
return EINA_FALSE;
DEBUG("END");
}
static void
-_view_content_changed(AppTrackerEventType type, void *user_data)
+_view_content_changed(void *user_data)
{
DEBUG("START");
_window_cache_builded = EINA_FALSE;
{
DEBUG("START");
- app_tracker_callback_unregister(top_window, APP_TRACKER_EVENT_VIEW_CHANGED, _view_content_changed, NULL);
+ app_tracker_callback_unregister(top_window, _view_content_changed, NULL);
if(window)
{
DEBUG("Window name: %s", atspi_accessible_get_name(window, NULL));
- app_tracker_callback_register(window, APP_TRACKER_EVENT_VIEW_CHANGED, _view_content_changed, NULL);
+ app_tracker_callback_register(window, _view_content_changed, NULL);
_window_cache_builded = EINA_FALSE;
object_cache_build_async(window, 5, _on_cache_builded, NULL);
}