From: Brian Cameron Date: Fri, 15 Jun 2001 13:20:49 +0000 (+0000) Subject: Now atkselection returns a boolean for add_selection, clear_selection X-Git-Tag: EA_1_0~64 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a992d1ec4bd948b359a63efc6d5e0358a1ceef26;p=platform%2Fupstream%2Fatk.git Now atkselection returns a boolean for add_selection, clear_selection and remove_selection to indiate if the operation was successful or not. --- diff --git a/ChangeLog b/ChangeLog index ef5f7b8..ca2377c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2001-06-15 Brian Cameron & Lucy Brophy + * atk/atkselection.h atk/atkselection.c + Now add_selection, clear_selection, and remove_selection + return a boolean indicating SUCCESS/FAILURE to indicate + if the operation was successful. + 2001-06-13 Brian Cameron & Lucy Brophy * atk/atktable.h atk/atktable.h Updated so now the get_text_before|at|after functions diff --git a/atk/atkselection.c b/atk/atkselection.c index fa5a946..4532ff4 100755 --- a/atk/atkselection.c +++ b/atk/atkselection.c @@ -46,20 +46,24 @@ atk_selection_get_type () * * Adds the specified accessible child of the object to the * object's selection. + * + * Returns: TRUE if success, FALSE otherwise. **/ -void +gboolean atk_selection_add_selection (AtkSelection *obj, gint i) { AtkSelectionIface *iface; - g_return_if_fail (obj != NULL); - g_return_if_fail (ATK_IS_SELECTION (obj)); + g_return_val_if_fail (obj != NULL, FALSE); + g_return_val_if_fail (ATK_IS_SELECTION (obj), FALSE); iface = ATK_SELECTION_GET_IFACE (obj); if (iface->add_selection) - (iface->add_selection) (obj, i); + return (iface->add_selection) (obj, i); + else + return FALSE; } /** @@ -68,19 +72,23 @@ atk_selection_add_selection (AtkSelection *obj, * * Clears the selection in the object so that no children in the object * are selected. + * + * Returns: TRUE if success, FALSE otherwise. **/ -void +gboolean atk_selection_clear_selection (AtkSelection *obj) { AtkSelectionIface *iface; - g_return_if_fail (obj != NULL); - g_return_if_fail (ATK_IS_SELECTION (obj)); + g_return_val_if_fail (obj != NULL, FALSE); + g_return_val_if_fail (ATK_IS_SELECTION (obj), FALSE); iface = ATK_SELECTION_GET_IFACE (obj); if (iface->clear_selection) - (iface->clear_selection) (obj); + return (iface->clear_selection) (obj); + else + return FALSE; } /** @@ -181,20 +189,24 @@ atk_selection_is_child_selected (AtkSelection *obj, * @i: a #gint specifying an accessible child of @selection * * Removes the specified child of the object from the object's selection. + * + * Returns: TRUE if success, FALSE otherwise. **/ -void +gboolean atk_selection_remove_selection (AtkSelection *obj, gint i) { AtkSelectionIface *iface; - g_return_if_fail (obj != NULL); - g_return_if_fail (ATK_IS_SELECTION (obj)); + g_return_val_if_fail (obj != NULL, FALSE); + g_return_val_if_fail (ATK_IS_SELECTION (obj), FALSE); iface = ATK_SELECTION_GET_IFACE (obj); if (iface->remove_selection) - (iface->remove_selection) (obj, i); + return (iface->remove_selection) (obj, i); + else + return FALSE; } /** diff --git a/atk/atkselection.h b/atk/atkselection.h index e210576..af042aa 100755 --- a/atk/atkselection.h +++ b/atk/atkselection.h @@ -48,24 +48,24 @@ struct _AtkSelectionIface { GTypeInterface parent; - void (* add_selection) (AtkSelection *selection, + gboolean (* add_selection) (AtkSelection *selection, gint i); - void (* clear_selection) (AtkSelection *selection); + gboolean (* clear_selection) (AtkSelection *selection); AtkObject* (* ref_selection) (AtkSelection *selection, gint i); gint (* get_selection_count) (AtkSelection *selection); gboolean (* is_child_selected) (AtkSelection *selection, gint i); - void (* remove_selection) (AtkSelection *selection, + gboolean (* remove_selection) (AtkSelection *selection, gint i); void (* select_all_selection) (AtkSelection *selection); }; GType atk_selection_get_type (); -void atk_selection_add_selection (AtkSelection *selection, +gboolean atk_selection_add_selection (AtkSelection *selection, gint i); -void atk_selection_clear_selection (AtkSelection *selection); +gboolean atk_selection_clear_selection (AtkSelection *selection); AtkObject* atk_selection_ref_selection (AtkSelection *selection, gint i); @@ -75,7 +75,7 @@ gint atk_selection_get_selection_count (AtkSelection *selection); gboolean atk_selection_is_child_selected (AtkSelection *selection, gint i); -void atk_selection_remove_selection (AtkSelection *selection, +gboolean atk_selection_remove_selection (AtkSelection *selection, gint i); void atk_selection_select_all_selection (AtkSelection *selection);