2003-07-16 Duarte Loreto <happyguy_pt@hotmail.com>
[platform/core/uifw/at-spi2-atk.git] / libspi / selection.c
index 5932af0..64deabc 100644 (file)
@@ -2,7 +2,8 @@
  * AT-SPI - Assistive Technology Service Provider Interface
  * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
  *
- * Copyright 2001 Sun Microsystems Inc.
+ * 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
@@ -58,7 +59,7 @@ impl__get_nSelectedChildren (PortableServer_Servant servant,
 
   g_return_val_if_fail (selection != NULL, 0);
 
-  return (CORBA_long) atk_selection_get_selection_count (selection);
+  return atk_selection_get_selection_count (selection);
 }
 
 
@@ -77,7 +78,7 @@ impl_getSelectedChild (PortableServer_Servant servant,
 #endif
 
   atk_object = atk_selection_ref_selection (selection,
-                                           (gint) selectedChildIndex);
+                                           selectedChildIndex);
 
   g_return_val_if_fail (ATK_IS_OBJECT (atk_object), CORBA_OBJECT_NIL);
 
@@ -99,8 +100,7 @@ impl_selectChild (PortableServer_Servant servant,
 
   g_return_val_if_fail (selection != NULL, FALSE);
 
-  return (CORBA_boolean)
-    atk_selection_add_selection (selection, (gint) childIndex);
+  return atk_selection_add_selection (selection, childIndex);
 }
 
 
@@ -113,8 +113,7 @@ impl_deselectSelectedChild (PortableServer_Servant servant,
 
   g_return_val_if_fail (selection != NULL, FALSE);
 
-  return (CORBA_boolean)
-    atk_selection_remove_selection (selection, (gint) selectedChildIndex);
+  return atk_selection_remove_selection (selection, selectedChildIndex);
 }
 
 
@@ -127,32 +126,32 @@ impl_isChildSelected (PortableServer_Servant servant,
 
   g_return_val_if_fail (selection != NULL, FALSE);
 
-  return (CORBA_boolean)
-    atk_selection_is_child_selected (selection, (gint) childIndex);
+  return atk_selection_is_child_selected (selection, childIndex);
 }
 
 
-static void 
+static CORBA_boolean 
 impl_selectAll (PortableServer_Servant servant,
                CORBA_Environment     *ev)
 {
   AtkSelection *selection = get_selection_from_servant (servant);
 
-  g_return_if_fail (selection != NULL);
+  g_return_val_if_fail (selection != NULL, FALSE);
+
+  return atk_selection_select_all_selection (selection);
 
-  atk_selection_select_all_selection (selection);
 }
 
 
-static void 
+static CORBA_boolean
 impl_clearSelection (PortableServer_Servant servant,
                     CORBA_Environment     *ev)
 {
   AtkSelection *selection = get_selection_from_servant (servant);
 
-  g_return_if_fail (selection != NULL);
+  g_return_val_if_fail (selection != NULL, FALSE);
 
-  atk_selection_clear_selection (selection);
+  return atk_selection_clear_selection (selection);
 }
 
 
@@ -182,4 +181,4 @@ spi_selection_init (SpiSelection *selection)
 BONOBO_TYPE_FUNC_FULL (SpiSelection,
                       Accessibility_Selection,
                       SPI_TYPE_BASE,
-                      spi_selection);
+                      spi_selection)