Now atkselection returns a boolean for add_selection, clear_selection
authorBrian Cameron <bcameron@src.gnome.org>
Fri, 15 Jun 2001 13:20:49 +0000 (13:20 +0000)
committerBrian Cameron <bcameron@src.gnome.org>
Fri, 15 Jun 2001 13:20:49 +0000 (13:20 +0000)
and remove_selection to indiate if the operation was successful or not.

ChangeLog
atk/atkselection.c
atk/atkselection.h

index ef5f7b8..ca2377c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2001-06-15  Brian Cameron & Lucy Brophy  <brian.cameron@sun.com>
+       * 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  <brian.cameron@sun.com>
        * atk/atktable.h atk/atktable.h
        Updated so now the get_text_before|at|after functions
index fa5a946..4532ff4 100755 (executable)
@@ -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;
 }
 
 /**
index e210576..af042aa 100755 (executable)
@@ -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);