X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=cspi%2Fspi_component.c;h=cf43b7d9c74849ac9eb80a21c37e0fe4e870d40b;hb=a90cc5cacb5efd233b714287297034c079def8aa;hp=103a69f4473e6efb18f80d806661ef2e09c0c52c;hpb=2b8f4365c549962de1f20418ca00dd503d6e28bc;p=platform%2Fcore%2Fuifw%2Fat-spi2-atk.git diff --git a/cspi/spi_component.c b/cspi/spi_component.c index 103a69f..cf43b7d 100644 --- a/cspi/spi_component.c +++ b/cspi/spi_component.c @@ -11,15 +11,11 @@ * @obj: a pointer to an object implementing #AccessibleComponent on which to operate. * * Increment the reference count for an #AccessibleComponent. - * - * Returns: (no return code implemented yet). - * **/ -int +void AccessibleComponent_ref (AccessibleComponent *obj) { cspi_object_ref (obj); - return 0; } /** @@ -27,15 +23,11 @@ AccessibleComponent_ref (AccessibleComponent *obj) * @obj: a pointer to the object implementing #AccessibleComponent on which to operate. * * Decrement the reference count for an #AccessibleComponent. - * - * Returns: (no return code implemented yet). - * **/ -int +void AccessibleComponent_unref (AccessibleComponent *obj) { cspi_object_unref (obj); - return 0; } /** @@ -57,11 +49,18 @@ AccessibleComponent_contains (AccessibleComponent *obj, long int y, AccessibleCoordType ctype) { - return Accessibility_Component_contains (CSPI_OBJREF (obj), - (CORBA_long) x, - (CORBA_long) y, - ctype, - cspi_ev ()); + SPIBoolean retval; + + cspi_return_val_if_fail (obj != NULL, FALSE); + + retval = Accessibility_Component_contains (CSPI_OBJREF (obj), + (CORBA_long) x, + (CORBA_long) y, + ctype, + cspi_ev ()); + cspi_return_val_if_ev ("contains", FALSE); + + return retval; } /** @@ -85,11 +84,13 @@ AccessibleComponent_getAccessibleAtPoint (AccessibleComponent *obj, { Accessibility_Accessible child; - child = Accessibility_Component_getAccessibleAtPoint(CSPI_OBJREF (obj), - (CORBA_long) x, - (CORBA_long) y, - ctype, - cspi_ev ()); + cspi_return_val_if_fail (obj != NULL, NULL); + + child = Accessibility_Component_getAccessibleAtPoint (CSPI_OBJREF (obj), + (CORBA_long) x, + (CORBA_long) y, + ctype, + cspi_ev ()); return cspi_object_add (child); } @@ -114,19 +115,24 @@ AccessibleComponent_getExtents (AccessibleComponent *obj, long int *height, AccessibleCoordType ctype) { - 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; + } } /** @@ -146,11 +152,22 @@ AccessibleComponent_getPosition (AccessibleComponent *obj, long int *y, AccessibleCoordType ctype) { + CORBA_long cx, cy; + + cspi_return_if_fail (obj != NULL); + Accessibility_Component_getPosition (CSPI_OBJREF (obj), - (CORBA_long *) x, - (CORBA_long *) y, - ctype, - cspi_ev ()); + &cx, &cy, ctype, cspi_ev ()); + + if (!cspi_check_ev ("getPosition")) + { + *x = *y = 0; + } + else + { + *x = cx; + *y = cy; + } } /** @@ -167,6 +184,8 @@ AccessibleComponent_getSize (AccessibleComponent *obj, long int *width, long int *height) { + cspi_return_if_fail (obj != NULL); + Accessibility_Component_getSize (CSPI_OBJREF (obj), (CORBA_long *) width, (CORBA_long *) height, @@ -185,12 +204,17 @@ AccessibleComponent_getSize (AccessibleComponent *obj, AccessibleComponentLayer AccessibleComponent_getLayer (AccessibleComponent *obj) { + AccessibleComponentLayer retval; Accessibility_ComponentLayer zlayer; - AccessibleComponentLayer retval; - + + cspi_return_val_if_fail (obj != NULL, FALSE); + zlayer = Accessibility_Component_getLayer (CSPI_OBJREF (obj), - cspi_ev ()); - switch (retval) + cspi_ev ()); + + cspi_return_val_if_ev ("getLayer", SPI_LAYER_INVALID); + + switch (zlayer) { case Accessibility_LAYER_BACKGROUND: retval = SPI_LAYER_BACKGROUND; @@ -212,7 +236,9 @@ AccessibleComponent_getLayer (AccessibleComponent *obj) break; default: retval = SPI_LAYER_INVALID; + break; } + return retval; } @@ -229,8 +255,16 @@ AccessibleComponent_getLayer (AccessibleComponent *obj) short AccessibleComponent_getMDIZOrder (AccessibleComponent *obj) { - return (short) Accessibility_Component_getMDIZOrder (CSPI_OBJREF (obj), - cspi_ev ()); + short retval; + + cspi_return_val_if_fail (obj != NULL, FALSE); + + retval = Accessibility_Component_getMDIZOrder (CSPI_OBJREF (obj), + cspi_ev ()); + + cspi_return_val_if_ev ("getMDIZOrder", FALSE); + + return retval; } /** @@ -240,9 +274,21 @@ AccessibleComponent_getMDIZOrder (AccessibleComponent *obj) * Attempt to set the keyboard input focus to the specified * #AccessibleComponent. * + * Returns: #TRUE if successful, #FALSE otherwise. + * **/ -void +SPIBoolean AccessibleComponent_grabFocus (AccessibleComponent *obj) { - ; + short retval; + + cspi_return_val_if_fail (obj != NULL, FALSE); + + retval = Accessibility_Component_grabFocus (CSPI_OBJREF (obj), + cspi_ev ()); + + cspi_return_val_if_ev ("grabFocus", FALSE); + + return retval; } +