X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=cspi%2Fspi_selection.c;h=5268ff4a98afb07843fff0da50272ac28c592682;hb=9d4d25b1227645a24dcfc1d8bbd0cbf9302b6e5c;hp=68c03344f72c04aa5cfd4278d75be4d9cfa52d26;hpb=fb1e8ce4bd1b97a4029321017b414bd04cef087d;p=platform%2Fcore%2Fuifw%2Fat-spi2-atk.git diff --git a/cspi/spi_selection.c b/cspi/spi_selection.c index 68c0334..5268ff4 100644 --- a/cspi/spi_selection.c +++ b/cspi/spi_selection.c @@ -1,38 +1,54 @@ +/* + * AT-SPI - Assistive Technology Service Provider Interface + * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap) + * + * Copyright 2001, 2002 Sun Microsystems Inc., + * Copyright 2001, 2002 Ximian, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include + /** * AccessibleSelection_ref: * @obj: a pointer to the #AccessibleSelection implementor on which to operate. * * Increment the reference count for an #AccessibleSelection object. * - * Returns: (no return code implemented yet). - * **/ -int +void AccessibleSelection_ref (AccessibleSelection *obj) { - Accessibility_Selection_ref (*obj, &ev); - return 0; + cspi_object_ref (obj); } - /** * 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) { - Accessibility_Selection_unref (*obj, &ev); - return 0; + cspi_object_unref (obj); } - - /** * AccessibleSelection_getNSelectedChildren: * @obj: a pointer to the #AccessibleSelection implementor on which to operate. @@ -47,10 +63,18 @@ AccessibleSelection_unref (AccessibleSelection *obj) long AccessibleSelection_getNSelectedChildren (AccessibleSelection *obj) { - return (long) - Accessibility_Selection__get_nSelectedChildren (*obj, &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: @@ -73,12 +97,15 @@ Accessible * AccessibleSelection_getSelectedChild (AccessibleSelection *obj, long int selectedChildIndex) { - Accessibility_Accessible child = - Accessibility_Selection_getSelectedChild (*obj, - (CORBA_long) selectedChildIndex, &ev); - spi_warn_ev (&ev, "getSelectedChild"); + Accessibility_Accessible child; + + cspi_return_val_if_fail (obj != NULL, NULL); + + child = Accessibility_Selection_getSelectedChild ( + CSPI_OBJREF (obj), + selectedChildIndex, cspi_ev ()); - return (Accessible *) ((CORBA_Object_is_nil (child, &ev)) ? NULL : Obj_Add (child)); + return cspi_object_add (child); } /** @@ -93,17 +120,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) - Accessibility_Selection_selectChild (*obj, - (CORBA_long) childIndex, &ev); -} + SPIBoolean retval; + + cspi_return_val_if_fail (obj != NULL, FALSE); + retval = + Accessibility_Selection_selectChild (CSPI_OBJREF (obj), + childIndex, cspi_ev ()); + + cspi_return_val_if_ev ("selectChild", FALSE); + + return retval; +} /** * AccessibleSelection_deselectSelectedChild: @@ -118,17 +151,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) { - Accessibility_Selection_deselectSelectedChild (*obj, - (CORBA_long) selectedChildIndex, &ev); -} + SPIBoolean retval; + + cspi_return_val_if_fail (obj != NULL, FALSE); + retval = Accessibility_Selection_deselectSelectedChild ( + CSPI_OBJREF (obj), selectedChildIndex, cspi_ev ()); + cspi_return_val_if_ev ("deselectSelectedChild", FALSE); + + return retval; +} /** * AccessibleSelection_isChildSelected: @@ -141,18 +179,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 (*obj, - (CORBA_long) childIndex, &ev); -} + SPIBoolean retval; + + cspi_return_val_if_fail (obj != NULL, FALSE); + retval = Accessibility_Selection_isChildSelected ( + CSPI_OBJREF (obj), + childIndex, cspi_ev ()); + cspi_return_val_if_ev ("isChildSelected", FALSE); + + return retval; +} /** * AccessibleSelection_selectAll: @@ -164,14 +207,19 @@ AccessibleSelection_isChildSelected (AccessibleSelection *obj, * Returns: #TRUE if successful, #FALSE otherwise. * **/ -boolean +SPIBoolean AccessibleSelection_selectAll (AccessibleSelection *obj) { - Accessibility_Selection_selectAll (*obj, &ev); - return TRUE; /* TODO: change the bonobo method to return boolean */ -} + SPIBoolean retval; + + cspi_return_val_if_fail (obj != NULL, FALSE); + retval = Accessibility_Selection_selectAll (CSPI_OBJREF (obj), cspi_ev ()); + cspi_return_val_if_ev ("selectAll", FALSE); + + return retval; +} /** * AccessibleSelection_clearSelection: @@ -180,11 +228,20 @@ AccessibleSelection_selectAll (AccessibleSelection *obj) * Clear the current selection, removing all selected children from the * specified #AccessibleSelection implementor's selection list. * + * Returns: #TRUE if successful, #FALSE otherwise. + * **/ -void +SPIBoolean AccessibleSelection_clearSelection (AccessibleSelection *obj) { - Accessibility_Selection_clearSelection (*obj, &ev); + SPIBoolean retval; + + cspi_return_val_if_fail (obj != NULL, FALSE); + + retval = Accessibility_Selection_clearSelection (CSPI_OBJREF (obj), cspi_ev ()); + cspi_return_val_if_ev ("clearSelection", FALSE); + + return retval; }