};
typedef struct _Box_Size {
+ char *x;
+ char *y;
char *height;
char *width;
} Box_Size;
static void _print_module_legend()
{
- printf("\n[[node role name],[attributes list],[width,height],[node name],[states list]]\n\n");
+ printf("\n[[node role name],[attributes list],[x,y,width,height],[node name],[states list]]\n\n");
}
static void _print_atspi_states_legend()
if (box_size == NULL)
return NULL;
+ char *x = NULL;
+ char *y = NULL;
char *width = NULL;
char *height = NULL;
- _combine_strings(&width, "_");
- _combine_strings(&height, "_");
-
- box_size->width = width;
- box_size->height = height;
-
AtspiComponent *component = atspi_accessible_get_component_iface(node);
+ AtspiRect *extent = component ? atspi_component_get_extents(component, ATSPI_COORD_TYPE_SCREEN, NULL) : NULL;
- if (component == NULL)
- return box_size;
-
- AtspiRect *extent = atspi_component_get_extents(component, ATSPI_COORD_TYPE_SCREEN, NULL);
- if (extent == NULL)
- return box_size;
+ if (extent == NULL) {
+ _combine_strings(&x, "_");
+ _combine_strings(&y, "_");
+ _combine_strings(&width, "_");
+ _combine_strings(&height, "_");
+ } else {
+ char temp_buff[NUMBER_WIDTH];
- *width = '\0';
- *height = '\0';
+ snprintf(temp_buff, NUMBER_WIDTH, "%d", extent->x);
+ _combine_strings(&x, temp_buff);
- char temp_buff[NUMBER_WIDTH];
+ snprintf(temp_buff, NUMBER_WIDTH, "%d", extent->y);
+ _combine_strings(&y, temp_buff);
- snprintf(temp_buff, NUMBER_WIDTH, "%d", extent->width);
- _combine_strings(&width, temp_buff);
+ snprintf(temp_buff, NUMBER_WIDTH, "%d", extent->width);
+ _combine_strings(&width, temp_buff);
- snprintf(temp_buff, NUMBER_WIDTH, "%d", extent->height);
- _combine_strings(&height, temp_buff);
+ snprintf(temp_buff, NUMBER_WIDTH, "%d", extent->height);
+ _combine_strings(&height, temp_buff);
- g_object_unref(component);
- g_free(extent);
+ g_object_unref(component);
+ g_free(extent);
+ }
+ box_size->x = x;
+ box_size->y = y;
box_size->width = width;
box_size->height = height;
_truncate_string(states, length_limit);
char result[SAFE_BUFFER_SIZE];
- int ret = snprintf(result, SAFE_BUFFER_SIZE, "[[%s],[%s],[%s,%s],[%s],[%s]]",
+ int ret = snprintf(result, SAFE_BUFFER_SIZE, "[[%s],[%s],[%s,%s,%s,%s],[%s],[%s]]",
node_role_name,
attributes,
+ box_size->x,
+ box_size->y,
box_size->width,
box_size->height,
node_name,