- CORBA_long cx, cy, cw, ch;
- Accessibility_Component_getExtents (CSPI_OBJREF (obj),
- &cx,
- &cy,
- &cw,
- &ch,
- ctype,
- cspi_ev ());
- cspi_warn_ev (cspi_ev (), "AccessibleComponent_getExtents");
- *x = (long) cx;
- *y = (long) cy;
- *width = (long) cw;
- *height = (long) ch;
+ Accessibility_BoundingBox bbox;
+
+ cspi_return_if_fail (obj != NULL);
+
+ bbox = Accessibility_Component_getExtents (CSPI_OBJREF (obj),
+ ctype,
+ cspi_ev ());
+ if (!cspi_check_ev ("AccessibleComponent_getExtents"))
+ {
+ *x = *y = *width = *height = 0;
+ }
+ else
+ {
+ *x = bbox.x;
+ *y = bbox.y;
+ *width = bbox.width;
+ *height = bbox.height;
+ }