*/
#include "atspi-private.h"
+#include "atspi-accessible-private.h"
void
atspi_rect_free (AtspiRect *rect)
*
* Gets the accessible child at a given coordinate within an #AtspiComponent.
*
- * Returns: (transfer full): a pointer to an #AtspiAccessible child of the
- * specified component which contains the point (@x, @y), or NULL if
- * no child contains the point.
+ * Returns: (nullable) (transfer full): a pointer to an
+ * #AtspiAccessible child of the specified component which
+ * contains the point (@x, @y), or NULL if no child contains
+ * the point.
**/
AtspiAccessible *
atspi_component_get_accessible_at_point (AtspiComponent *obj,
{
dbus_uint32_t d_ctype = ctype;
AtspiRect bbox;
+ AtspiAccessible *accessible;
bbox.x = bbox.y = bbox.width = bbox.height = -1;
g_return_val_if_fail (obj != NULL, atspi_rect_copy (&bbox));
+ accessible = ATSPI_ACCESSIBLE (obj);
+ if (accessible->priv->cache && ctype == ATSPI_COORD_TYPE_SCREEN)
+ {
+ GValue *val = g_hash_table_lookup (accessible->priv->cache, "Component.ScreenExtents");
+ if (val)
+ {
+ return g_value_dup_boxed (val);
+ }
+ }
+
_atspi_dbus_call (obj, atspi_interface_component, "GetExtents", error, "u=>(iiii)", d_ctype, &bbox);
return atspi_rect_copy (&bbox);
}