}
}
-#if 0
-static void object_get_x_y(AtspiAccessible * accessibleObject, int* x, int* y)
-{
- GError * error = NULL;
-
- if ( ATSPI_IS_COMPONENT(accessibleObject) )
- {
- AtspiComponent * component = ATSPI_COMPONENT(accessibleObject);
- AtspiPoint *position = atspi_component_get_position (component, ATSPI_COORD_TYPE_SCREEN, &error);
- if ( error != NULL )
- {
- g_error_free(error);
- }
- if ( position != NULL )
- {
- *x = position->x;
- *y = position->y;
- g_free ( position );
- }
- }
-}
-
-static void object_get_wh(AtspiAccessible * accessibleObject, int* width, int* height)
-{
- GError * error = NULL;
-
- if ( ATSPI_IS_COMPONENT(accessibleObject) )
- {
- AtspiComponent * component = ATSPI_COMPONENT(accessibleObject);
- AtspiPoint * size = atspi_component_get_size (component, &error);
- if ( error != NULL )
- {
- g_error_free(error);
- }
- if ( size != NULL )
- {
- *width = size->x;
- *height = size->y;
- g_free ( size );
- }
- }
-}
-
-static void find_objects(AtspiAccessible* parent, gint x, gint y, gint radius, double* distance, AtspiAccessible **find_app)
-{
- AtspiAccessible* app = NULL;
- GError* err = NULL;
- int jdx, kdx;
-
- int count_child = atspi_accessible_get_child_count(parent, &err);
-
- for(jdx = 0; jdx < count_child; jdx++)
- {
- app = atspi_accessible_get_child_at_index(parent, jdx, &err);
-
- AtspiStateSet* state_set = atspi_accessible_get_state_set (app);
- AtspiStateType state = ATSPI_STATE_VISIBLE;
-
- int height = 0, width = 0, xpos1 = 0, ypos1 = 0, xpos2 = 0, ypos2 = 0;
-
- object_get_wh(app, &width, &height); object_get_x_y(app, &xpos1, &ypos1);
-
- gboolean is_visile = atspi_state_set_contains(state_set, state);
-
- if(is_visile == TRUE && width > 0 && height > 0)
- {
- xpos2 = xpos1 + width;
- ypos2 = ypos1 + height;
-
- double set_distance[DISTANCE_NB] = {0};
- double min_distance = DBL_MAX;
-
- set_distance[0] = pow((x - xpos1), 2) + pow((y - ypos1), 2);
- set_distance[1] = pow((x - xpos2), 2) + pow((y - ypos1), 2);
- set_distance[2] = pow((x - xpos1), 2) + pow((y - ypos2), 2);
- set_distance[3] = pow((x - xpos2), 2) + pow((y - ypos2), 2);
- set_distance[4] = DBL_MAX;
- set_distance[5] = DBL_MAX;
- set_distance[6] = DBL_MAX;
- set_distance[7] = DBL_MAX;
-
- if(x >= fmin(xpos1, xpos2) && x <= fmax(xpos1, xpos2))
- {
- set_distance[4] = pow((y - ypos1), 2);
- set_distance[5] = pow((y - ypos2), 2);
- }
-
- if(y >= fmin(ypos1, ypos2) && y <= fmax(ypos1, ypos2))
- {
- set_distance[6] = pow((x - xpos1), 2);
- set_distance[7] = pow((x - xpos2), 2);
- }
-
- for(kdx = 0; kdx < DISTANCE_NB; kdx++)
- {
- if(set_distance[kdx] < min_distance)
- min_distance = set_distance[kdx];
- }
-
- if(min_distance <= *distance && (radius < 0 || (radius >= 0 && min_distance <= radius)))
- {
- *distance = min_distance;
- *find_app = app;
- }
- find_objects(app, x, y, radius, distance, find_app);
- }
- }
-}
-
-static AtspiAccessible *get_nearest_widget(AtspiAccessible* app_obj, gint x_cord, gint y_cord, gint radius)
-{
- int xn = 0, yn = 0;
- GError *err = NULL;
- AtspiAccessible* f_app_obj = app_obj;
- double distance = DBL_MAX;
- int jdx = 0;
-
- int count_child = atspi_accessible_get_child_count(app_obj, &err);
-
- find_objects(app_obj, x_cord, y_cord, radius, &distance, &f_app_obj);
-
- return f_app_obj;
-}
-#endif
-
static void _focus_next(void)
{
AtspiAccessible *obj;