X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=cspi%2Fspi_selection.c;h=d66d5cd9098d81a793f812b9c5b07bf244c6ec57;hb=80a357d26579617a76c32e0de9ac7fc99476cd18;hp=1b9870442f84a268cca98cc3a4adba66a6bc0947;hpb=a0661d5d4128769f2544d24430c80dc440bfdbba;p=platform%2Fcore%2Fuifw%2Fat-spi2-atk.git diff --git a/cspi/spi_selection.c b/cspi/spi_selection.c index 1b98704..d66d5cd 100644 --- a/cspi/spi_selection.c +++ b/cspi/spi_selection.c @@ -6,35 +6,26 @@ * * Increment the reference count for an #AccessibleSelection object. * - * Returns: (no return code implemented yet). - * **/ -int +void AccessibleSelection_ref (AccessibleSelection *obj) { cspi_object_ref (obj); - return 0; } - /** * AccessibleSelection_unref: * @obj: a pointer to the #AccessibleSelection implementor on which to operate. * * Decrement the reference count for an #Accessible object. * - * Returns: (no return code implemented yet). - * **/ -int +void AccessibleSelection_unref (AccessibleSelection *obj) { cspi_object_unref (obj); - return 0; } - - /** * AccessibleSelection_getNSelectedChildren: * @obj: a pointer to the #AccessibleSelection implementor on which to operate. @@ -49,10 +40,18 @@ AccessibleSelection_unref (AccessibleSelection *obj) long AccessibleSelection_getNSelectedChildren (AccessibleSelection *obj) { - return (long) - Accessibility_Selection__get_nSelectedChildren (CSPI_OBJREF (obj), cspi_ev ()); -} + long retval; + + cspi_return_val_if_fail (obj != NULL, -1); + retval = + Accessibility_Selection__get_nSelectedChildren (CSPI_OBJREF (obj), + cspi_ev ()); + + cspi_return_val_if_ev ("getNSelectedChildren", -1); + + return retval; +} /** * AccessibleSelection_getSelectedChild: @@ -75,10 +74,13 @@ Accessible * AccessibleSelection_getSelectedChild (AccessibleSelection *obj, long int selectedChildIndex) { - Accessibility_Accessible child = - Accessibility_Selection_getSelectedChild (CSPI_OBJREF (obj), - (CORBA_long) selectedChildIndex, cspi_ev ()); - cspi_warn_ev (cspi_ev (), "getSelectedChild"); + Accessibility_Accessible child; + + cspi_return_val_if_fail (obj != NULL, NULL); + + child = Accessibility_Selection_getSelectedChild ( + CSPI_OBJREF (obj), + (CORBA_long) selectedChildIndex, cspi_ev ()); return (Accessible *) cspi_object_add (child); } @@ -95,17 +97,23 @@ AccessibleSelection_getSelectedChild (AccessibleSelection *obj, * selection. * * Returns: #TRUE if the child was successfully selected, #FALSE otherwise. - * **/ -boolean +SPIBoolean AccessibleSelection_selectChild (AccessibleSelection *obj, long int childIndex) { - return (boolean) + SPIBoolean retval; + + cspi_return_val_if_fail (obj != NULL, FALSE); + + retval = Accessibility_Selection_selectChild (CSPI_OBJREF (obj), (CORBA_long) childIndex, cspi_ev ()); -} + cspi_return_val_if_ev ("selectChild", FALSE); + + return retval; +} /** * AccessibleSelection_deselectSelectedChild: @@ -120,17 +128,22 @@ AccessibleSelection_selectChild (AccessibleSelection *obj, * are asymmettric. * * Returns: #TRUE if the child was successfully deselected, #FALSE otherwise. - * **/ -boolean +SPIBoolean AccessibleSelection_deselectSelectedChild (AccessibleSelection *obj, long int selectedChildIndex) { - return Accessibility_Selection_deselectSelectedChild ( - CSPI_OBJREF (obj), (CORBA_long) selectedChildIndex, cspi_ev ()); -} + SPIBoolean retval; + + cspi_return_val_if_fail (obj != NULL, FALSE); + retval = Accessibility_Selection_deselectSelectedChild ( + CSPI_OBJREF (obj), (CORBA_long) selectedChildIndex, cspi_ev ()); + cspi_return_val_if_ev ("deselectSelectedChild", FALSE); + + return retval; +} /** * AccessibleSelection_isChildSelected: @@ -143,18 +156,23 @@ AccessibleSelection_deselectSelectedChild (AccessibleSelection *obj, * * Returns: #TRUE if the specified child is currently selected, * #FALSE otherwise. - * **/ -boolean +SPIBoolean AccessibleSelection_isChildSelected (AccessibleSelection *obj, long int childIndex) { - return (boolean) - Accessibility_Selection_isChildSelected (CSPI_OBJREF (obj), - (CORBA_long) childIndex, cspi_ev ()); -} + SPIBoolean retval; + cspi_return_val_if_fail (obj != NULL, FALSE); + retval = Accessibility_Selection_isChildSelected ( + CSPI_OBJREF (obj), + (CORBA_long) childIndex, cspi_ev ()); + + cspi_return_val_if_ev ("isChildSelected", FALSE); + + return (SPIBoolean) retval; +} /** * AccessibleSelection_selectAll: @@ -166,14 +184,17 @@ AccessibleSelection_isChildSelected (AccessibleSelection *obj, * Returns: #TRUE if successful, #FALSE otherwise. * **/ -boolean +SPIBoolean AccessibleSelection_selectAll (AccessibleSelection *obj) { + cspi_return_val_if_fail (obj != NULL, FALSE); + Accessibility_Selection_selectAll (CSPI_OBJREF (obj), cspi_ev ()); - return TRUE; /* TODO: change the bonobo method to return boolean */ -} + cspi_check_ev ("selectAll"); + return TRUE; /* TODO: change the CORBA method to return SPIBoolean */ +} /** * AccessibleSelection_clearSelection: @@ -181,12 +202,14 @@ AccessibleSelection_selectAll (AccessibleSelection *obj) * * Clear the current selection, removing all selected children from the * specified #AccessibleSelection implementor's selection list. - * **/ void AccessibleSelection_clearSelection (AccessibleSelection *obj) { + cspi_return_if_fail (obj != NULL); + Accessibility_Selection_clearSelection (CSPI_OBJREF (obj), cspi_ev ()); + cspi_check_ev ("clearSelection"); }