2002-05-09 Marc Mulcahy <marc.mulcahy@sun.com>
authormarcm <marcm@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Mon, 13 May 2002 07:49:03 +0000 (07:49 +0000)
committermarcm <marcm@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Mon, 13 May 2002 07:49:03 +0000 (07:49 +0000)
* cspi/spi_accessible.c: Added exception checks.  Fixed completely
busted AccessibleStateSet_compare.  Removed redundant casts.

* cspi/spi-action.c: Removed redundant casts.

* cspi/spi_application.c: Fixed typo in AccessibleApplication_getVersion.

* cspi/spi_component.c: Fixed typos and casting error.

* cspi/spi_editabletext.c: Removed redundant casts.

* cspi/spi_hyperlink.c: Fixed casting and exception checking.

* cspi/spi_hypertext.c: Eliminated redundant casts.

* cspi/spi_image.c: Eliminated redundant casts.

* cspi/spi_registry.c: Eliminated redundant casts.
SPI_deregisterGlobalEventListenerAll () removed retval variable.
* cspi/spi_selection.c: Removed redundant casts.
* cspi/spi_text.c: Eliminated redundant casts.  Fixed exception
handling.  Screen geometry and text offsets were being returned as 0
on error which is technically valid-- changed these to return -1.
Added marshaller for text boundary types to fix bug with boundary
types being passed incorrectly to atk

git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@294 e2bd861d-eb25-0410-b326-f6ed22b6b98c

16 files changed:
ChangeLog
cspi/bonobo/cspi-bonobo-listener.c
cspi/bonobo/cspi-bonobo-listener.h
cspi/bonobo/cspi-bonobo.c
cspi/spi_accessible.c
cspi/spi_action.c
cspi/spi_application.c
cspi/spi_component.c
cspi/spi_editabletext.c
cspi/spi_hyperlink.c
cspi/spi_hypertext.c
cspi/spi_image.c
cspi/spi_registry.c
cspi/spi_selection.c
cspi/spi_table.c
cspi/spi_text.c

index 562acd8..0dc8ab9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,37 @@
+2002-05-09  Marc Mulcahy <marc.mulcahy@sun.com>
+
+       * cspi/spi_accessible.c: Added exception checks.  Fixed completely
+       busted AccessibleStateSet_compare.  Removed redundant casts.
+       
+       * cspi/spi-action.c: Removed redundant casts.
+
+       * cspi/spi_application.c: Fixed typo in AccessibleApplication_getVersion.
+
+       * cspi/spi_component.c: Fixed typos and casting error.
+
+       * cspi/spi_editabletext.c: Removed redundant casts.
+
+       * cspi/spi_hyperlink.c: Fixed casting and exception checking.
+
+       * cspi/spi_hypertext.c: Eliminated redundant casts.
+
+       * cspi/spi_image.c: Eliminated redundant casts.
+
+       * cspi/spi_registry.c: Eliminated redundant casts.
+       SPI_deregisterGlobalEventListenerAll () removed retval variable.
+       * cspi/spi_selection.c: Removed redundant casts.
+       * cspi/spi_text.c: Eliminated redundant casts.  Fixed exception
+       handling.  Screen geometry and text offsets were being returned as 0
+       on error which is technically valid-- changed these to return -1.
+       Added marshaller for text boundary types to fix bug with boundary
+       types being passed incorrectly to atk.
+               
+       
+2002-05-03  Marc Mulcahy <marc.mulcahy@sun.com>
+
+       * cspi/bonobo/cspi-bonobo.c cspi/bonobo/cspi-bonobo-listener.c
+       cspi/bonobo/cspi-bonobo-listener.h: Added copyright notice.
+
 2002-05-10  Bill Haneman <bill.haneman@sun.com>
 
        * registryd/deviceeventcontroller.c:
@@ -7,6 +41,7 @@
        * NEWS:
        updated NEWS file to reflect recent spin-off of gnome-mag.
 
+
 2002-05-09  Bill Haneman <bill.haneman@sun.com>
 
        * cspi/spi_registry.c:
index 1946cb8..fe6c9b4 100644 (file)
@@ -1,3 +1,25 @@
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
+ *
+ * Copyright 2001 Sun Microsystems 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 <libbonobo.h>
 #include "../spi-private.h"
 #include "cspi-bonobo-listener.h"
index 0268df9..aee946f 100644 (file)
@@ -1,3 +1,25 @@
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
+ *
+ * Copyright 2001 Sun Microsystems 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.
+ */
+
 #ifndef __SPI_LISTENER_IMPL_H__
 #define __SPI_LISTENER_IMP_H__
 
index 57e16de..c5bd670 100644 (file)
@@ -1,3 +1,25 @@
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
+ *
+ * Copyright 2001 Sun Microsystems 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 <string.h>
 #include <libbonobo.h>
 #include "../cspi-lowlevel.h"
index 6294108..044fea1 100644 (file)
@@ -326,8 +326,7 @@ Accessible_getName (Accessible *obj)
 
   cspi_return_val_if_fail (obj != NULL, NULL);
 
-  retval = (char *)
-    Accessibility_Accessible__get_name (CSPI_OBJREF (obj), cspi_ev ());
+  retval = Accessibility_Accessible__get_name (CSPI_OBJREF (obj), cspi_ev ());
 
   cspi_return_val_if_ev ("getName", NULL); 
 
@@ -350,8 +349,7 @@ Accessible_getDescription (Accessible *obj)
 
   cspi_return_val_if_fail (obj != NULL, NULL);
 
-  retval = (char *)
-    Accessibility_Accessible__get_description (CSPI_OBJREF (obj),
+  retval = Accessibility_Accessible__get_description (CSPI_OBJREF (obj),
                                               cspi_ev ());
 
   cspi_return_val_if_ev ("getDescription", NULL); 
@@ -402,8 +400,7 @@ Accessible_getChildCount (Accessible *obj)
 
   cspi_return_val_if_fail (obj != NULL, -1);
 
-  retval = (long) 
-    Accessibility_Accessible__get_childCount (CSPI_OBJREF (obj),
+  retval = Accessibility_Accessible__get_childCount (CSPI_OBJREF (obj),
                                              cspi_ev ());
 
   cspi_return_val_if_ev ("getChildCount", -1); 
@@ -433,6 +430,7 @@ Accessible_getChildAtIndex (Accessible *obj,
     Accessibility_Accessible_getChildAtIndex (CSPI_OBJREF (obj),
                                              childIndex, cspi_ev ()));
 
+  cspi_return_val_if_ev ("getChildAtIndex", NULL);
   return retval;
 }
 
@@ -453,8 +451,7 @@ Accessible_getIndexInParent (Accessible *obj)
 
   cspi_return_val_if_fail (obj != NULL, -1);
 
-  retval = (long)
-    Accessibility_Accessible_getIndexInParent (CSPI_OBJREF (obj), cspi_ev ());
+  retval = Accessibility_Accessible_getIndexInParent (CSPI_OBJREF (obj), cspi_ev ());
 
   cspi_return_val_if_ev ("getIndexInparent", -1); 
   return retval;
@@ -569,6 +566,7 @@ Accessible_getStateSet (Accessible *obj)
     Accessibility_Accessible_getState (CSPI_OBJREF (obj),
                                          cspi_ev ()));
 
+  cspi_return_val_if_ev ("getState", NULL);
   return retval;
 }
 
@@ -1047,8 +1045,7 @@ AccessibleRelation_getNTargets (AccessibleRelation *obj)
   int retval;
   
   cspi_return_val_if_fail (obj, -1);
-  retval = (int)
-    Accessibility_Relation_getNTargets (CSPI_OBJREF (obj), cspi_ev());
+  retval = Accessibility_Relation_getNTargets (CSPI_OBJREF (obj), cspi_ev());
   cspi_return_val_if_ev ("getNTargets", -1);
   return retval;
 }
@@ -1074,7 +1071,7 @@ AccessibleRelation_getTarget (AccessibleRelation *obj, int i)
 
   retval = cspi_object_add (
                         Accessibility_Relation_getTarget (CSPI_OBJREF(obj),
-                                                          (CORBA_short) i, cspi_ev()));
+                                                          i, cspi_ev()));
   cspi_return_val_if_ev ("getTarget", NULL);
   return retval;
 }
@@ -1133,7 +1130,7 @@ AccessibleStateSet_contains (AccessibleStateSet *obj,
 
   cspi_return_val_if_ev ("contains", FALSE);
 
-  return (SPIBoolean) retval;
+  return retval;
 }
 
 /**
@@ -1229,12 +1226,15 @@ AccessibleStateSet *
 AccessibleStateSet_compare (AccessibleStateSet *obj,
                             AccessibleStateSet *obj2)
 {
-  Accessibility_StateSet retval;
+  AccessibleStateSet *retval;
 
   cspi_return_val_if_fail (obj != NULL, NULL);
   cspi_return_val_if_fail (obj2 != NULL, NULL);
-  retval = Accessibility_StateSet_compare (CSPI_OBJREF(obj), CSPI_OBJREF(obj2), cspi_ev ());
-  return NULL; 
+  retval = cspi_object_add (
+                        Accessibility_StateSet_compare (CSPI_OBJREF(obj), CSPI_OBJREF(obj2), cspi_ev ()));
+
+  cspi_return_val_if_ev ("compare", NULL);
+  return retval;
 }
 
 /**
@@ -1254,7 +1254,9 @@ AccessibleStateSet_isEmpty (AccessibleStateSet *obj)
 
   cspi_return_val_if_fail (obj != NULL, FALSE);
   retval = Accessibility_StateSet_isEmpty (CSPI_OBJREF (obj), cspi_ev ());
-  return (SPIBoolean) retval;
+
+  cspi_return_val_if_ev ("isEmpty", TRUE);
+  return retval;
 }
 
 
index cd7efa2..cce5af7 100644 (file)
@@ -88,7 +88,7 @@ AccessibleAction_getDescription (AccessibleAction *obj,
 
   retval =
     Accessibility_Action_getDescription (CSPI_OBJREF (obj),
-                                        (CORBA_long) i,
+                                        i,
                                         cspi_ev ());
 
   cspi_return_val_if_ev ("getDescription", NULL);
@@ -117,7 +117,7 @@ AccessibleAction_getKeyBinding (AccessibleAction *obj,
 
   retval =
     Accessibility_Action_getKeyBinding (CSPI_OBJREF (obj),
-       (CORBA_long) i,
+       i,
        cspi_ev ());
 
   cspi_return_val_if_ev ("getKeyBinding", NULL);
@@ -145,7 +145,7 @@ AccessibleAction_getName (AccessibleAction *obj,
 
   retval =
    Accessibility_Action_getName (CSPI_OBJREF (obj),
-                                (CORBA_long) i,
+                                i,
                                 cspi_ev ());
 
   cspi_return_val_if_ev ("getName", NULL);
@@ -170,9 +170,8 @@ AccessibleAction_doAction (AccessibleAction *obj,
 
   cspi_return_val_if_fail (obj != NULL, FALSE);
 
-  retval = (SPIBoolean)
-    Accessibility_Action_doAction (CSPI_OBJREF (obj),
-                                  (CORBA_long) i,
+  retval = Accessibility_Action_doAction (CSPI_OBJREF (obj),
+                                  i,
                                   cspi_ev ());
 
   cspi_return_val_if_ev ("doAction", FALSE);
index 3fe39cd..5dcad28 100644 (file)
@@ -98,7 +98,7 @@ AccessibleApplication_getVersion (AccessibleApplication *obj)
     Accessibility_Application__get_version (CSPI_OBJREF (obj),
                                            cspi_ev ());
 
-  cspi_return_val_if_ev ("getVersion", NULL);
+  cspi_return_val_if_ev ("version", NULL);
 
   return retval;
 }
@@ -124,7 +124,7 @@ AccessibleApplication_getID (AccessibleApplication *obj)
   retval = Accessibility_Application__get_id (CSPI_OBJREF (obj),
                                              cspi_ev ());
 
-  cspi_return_val_if_ev ("get_id", 0);
+  cspi_return_val_if_ev ("id", 0);
 
   return retval;
 }
index 530dc8e..872882b 100644 (file)
@@ -76,8 +76,8 @@ AccessibleComponent_contains (AccessibleComponent *obj,
   cspi_return_val_if_fail (obj != NULL, FALSE);
 
   retval = Accessibility_Component_contains (CSPI_OBJREF (obj),
-                                            (CORBA_long) x,
-                                            (CORBA_long) y,
+                                            x,
+                                            y,
                                             ctype,
                                             cspi_ev ());
   cspi_return_val_if_ev ("contains", FALSE);
@@ -109,8 +109,8 @@ AccessibleComponent_getAccessibleAtPoint (AccessibleComponent *obj,
   cspi_return_val_if_fail (obj != NULL, NULL);
 
   child = Accessibility_Component_getAccessibleAtPoint (CSPI_OBJREF (obj),
-                                                       (CORBA_long) x,
-                                                       (CORBA_long) y,
+                                                       x,
+                                                       y,
                                                        ctype,
                                                        cspi_ev ());
   return cspi_object_add (child);
@@ -144,7 +144,7 @@ AccessibleComponent_getExtents (AccessibleComponent *obj,
   bbox = Accessibility_Component_getExtents (CSPI_OBJREF (obj),
                                             ctype,
                                             cspi_ev ());
-  if (!cspi_check_ev ("AccessibleComponent_getExtents"))
+  if (!cspi_check_ev ("getExtents"))
     {
       *x = *y = *width = *height = 0;    
     }
@@ -206,12 +206,23 @@ AccessibleComponent_getSize (AccessibleComponent *obj,
                              long int *width,
                              long int *height)
 {
+  CORBA_long cw, ch;
+
   cspi_return_if_fail (obj != NULL);
 
   Accessibility_Component_getSize (CSPI_OBJREF (obj),
-                                   (CORBA_long *) width,
-                                   (CORBA_long *) height,
+                                   &cw,
+                                   &ch,
                                    cspi_ev ());
+  if (cspi_check_ev ("getSize"))
+  {
+    *width = *height = 0;
+  }
+  else
+  {
+    *width = cw;
+    *height = ch;
+  }
 }
 
 /**
@@ -302,7 +313,7 @@ AccessibleComponent_getMDIZOrder (AccessibleComponent *obj)
 SPIBoolean
 AccessibleComponent_grabFocus (AccessibleComponent *obj)
 {
-  short retval;
+  SPIBoolean retval;
 
   cspi_return_val_if_fail (obj != NULL, FALSE);
 
index a4d857f..980927e 100644 (file)
@@ -75,9 +75,9 @@ AccessibleEditableText_setAttributes (AccessibleEditableText *obj,
 
   retval = 
     Accessibility_EditableText_setAttributes (CSPI_OBJREF (obj),
-                                             (CORBA_char *) attributes,
-                                             (CORBA_long) startPos,
-                                             (CORBA_long) endPos, cspi_ev ());
+                                             attributes,
+                                             startPos,
+                                             endPos, cspi_ev ());
 
   cspi_return_val_if_ev ("setAttributes", FALSE);
 
@@ -103,7 +103,7 @@ AccessibleEditableText_setTextContents (AccessibleEditableText *obj,
   cspi_return_val_if_fail (obj != NULL, FALSE);
 
   retval = Accessibility_EditableText_setTextContents (CSPI_OBJREF (obj),
-                                      (CORBA_char *) newContents, cspi_ev ());
+                                                                         newContents, cspi_ev ());
 
   cspi_return_val_if_ev ("setTextContents", FALSE);
 
@@ -136,8 +136,8 @@ AccessibleEditableText_insertText (AccessibleEditableText *obj,
   cspi_return_val_if_fail (obj != NULL, FALSE);
 
   retval = Accessibility_EditableText_insertText (CSPI_OBJREF (obj),
-                                        (CORBA_long) position, (const CORBA_char *) text,
-                                        (CORBA_long) length, cspi_ev ());
+                                        position, text,
+                                        length, cspi_ev ());
 
   cspi_return_val_if_ev ("insertText", FALSE);
 
@@ -166,8 +166,8 @@ AccessibleEditableText_copyText (AccessibleText *obj,
   cspi_return_val_if_fail (obj != NULL, FALSE);
 
   Accessibility_EditableText_copyText (
-    CSPI_OBJREF (obj), (CORBA_long) startPos,
-    (CORBA_long) endPos, cspi_ev ());
+    CSPI_OBJREF (obj), startPos,
+    endPos, cspi_ev ());
 
   cspi_return_val_if_ev ("copyText", FALSE);
 
@@ -200,7 +200,7 @@ AccessibleEditableText_cutText (AccessibleEditableText *obj,
 
   retval = Accessibility_EditableText_cutText (
     CSPI_OBJREF (obj),
-    (CORBA_long) startPos, (CORBA_long) endPos, cspi_ev ());
+    startPos, endPos, cspi_ev ());
 
   cspi_return_val_if_ev ("cutText", FALSE);
 
@@ -233,7 +233,7 @@ AccessibleEditableText_deleteText (AccessibleEditableText *obj,
 
   retval = Accessibility_EditableText_deleteText (
     CSPI_OBJREF (obj),
-    (CORBA_long) startPos, (CORBA_long) endPos, cspi_ev ());
+    startPos, endPos, cspi_ev ());
 
   cspi_return_val_if_ev ("deleteText", FALSE);
 
@@ -262,7 +262,7 @@ AccessibleEditableText_pasteText (AccessibleEditableText *obj,
   cspi_return_val_if_fail (obj != NULL, FALSE);
 
   retval = Accessibility_EditableText_pasteText (
-    CSPI_OBJREF (obj), (CORBA_long) position, cspi_ev ());
+    CSPI_OBJREF (obj), position, cspi_ev ());
 
   cspi_return_val_if_ev ("pasteText", FALSE);
 
index 81c5fc5..e33ae33 100644 (file)
@@ -92,7 +92,7 @@ AccessibleHyperlink_getURI (AccessibleHyperlink *obj,
 
   retval =
     Accessibility_Hyperlink_getURI (CSPI_OBJREF (obj),
-                                   (CORBA_long) i, cspi_ev ());
+                                   i, cspi_ev ());
 
   cspi_return_val_if_ev ("getURI", NULL);
 
@@ -117,7 +117,7 @@ AccessibleHyperlink_getObject (AccessibleHyperlink *obj,
 
   return cspi_object_add (
     Accessibility_Hyperlink_getObject (CSPI_OBJREF (obj),
-                                      (CORBA_long) i, cspi_ev ()));
+                                      i, cspi_ev ()));
 }
 
 /**
@@ -137,14 +137,17 @@ AccessibleHyperlink_getIndexRange (AccessibleHyperlink *obj,
                                    long int *startIndex,
                                    long int *endIndex)
 {
+  CORBA_long si, ei;
+
   cspi_return_if_fail (obj != NULL);
 
-  *startIndex = (long)
-    Accessibility_Hyperlink__get_startIndex (CSPI_OBJREF (obj), cspi_ev ());
-  *endIndex = (long)
-    Accessibility_Hyperlink__get_endIndex (CSPI_OBJREF (obj), cspi_ev ());
+si = Accessibility_Hyperlink__get_startIndex (CSPI_OBJREF (obj), cspi_ev ());
+ cspi_return_if_ev ("startIndex");
+ ei = Accessibility_Hyperlink__get_endIndex (CSPI_OBJREF (obj), cspi_ev ());
 
-  cspi_return_if_ev ("getIndexRange");
+ cspi_return_if_ev ("endIndex");
+ *startIndex = si;
+ *endIndex = ei; 
 }
 
 /**
index 0490b22..1f001ab 100644 (file)
@@ -97,7 +97,7 @@ AccessibleHypertext_getLink (AccessibleHypertext *obj,
 
   retval = cspi_object_add (
     Accessibility_Hypertext_getLink (CSPI_OBJREF (obj),
-                                    (CORBA_long) linkIndex,
+                                    linkIndex,
                                     cspi_ev ()));
   
   cspi_return_val_if_ev ("getLink", NULL); 
@@ -127,7 +127,7 @@ AccessibleHypertext_getLinkIndex (AccessibleHypertext *obj,
 
   retval = 
     Accessibility_Hypertext_getLinkIndex (CSPI_OBJREF (obj),
-                                         (CORBA_long) characterOffset,
+                                         characterOffset,
                                          cspi_ev ());
 
   cspi_return_val_if_ev ("getLinkIndex", -1);
index fec3283..5f8f07f 100644 (file)
@@ -164,7 +164,7 @@ AccessibleImage_getImageExtents (AccessibleImage *obj,
   cspi_return_if_fail (obj != NULL);
 
   bbox = Accessibility_Image_getImageExtents (CSPI_OBJREF (obj),
-                                             (CORBA_short) ctype,
+                                             ctype,
                                              cspi_ev ());
 
   if (!cspi_check_ev ("getImageExtents"))
index 95abd2b..d567d34 100644 (file)
@@ -104,8 +104,6 @@ SPIBoolean
 SPI_registerGlobalEventListener (AccessibleEventListener *listener,
                                 const char              *eventType)
 {
-  SPIBoolean retval;
-
   if (!listener)
     {
       return FALSE;
@@ -116,9 +114,7 @@ SPI_registerGlobalEventListener (AccessibleEventListener *listener,
     cspi_event_listener_get_corba (listener),
     eventType, cspi_ev ());
 
-  retval = !cspi_exception ();
-  return retval;
+  return  !cspi_exception ();
 }
 
 /**
@@ -172,7 +168,7 @@ SPI_deregisterGlobalEventListener (AccessibleEventListener *listener,
   Accessibility_Registry_deregisterGlobalEventListener (
     cspi_registry (), 
     cspi_event_listener_get_corba (listener),
-    (CORBA_char *) eventType, cspi_ev ());
+    eventType, cspi_ev ());
 
   return !cspi_exception ();
 }
@@ -214,7 +210,7 @@ SPI_getDesktop (int i)
 {
   return cspi_object_add (
     Accessibility_Registry_getDesktop (
-      cspi_registry (), (CORBA_short) i, cspi_ev ()));
+      cspi_registry (), i, cspi_ev ()));
 }
 
 /**
@@ -248,7 +244,7 @@ SPI_getDesktopList (Accessible ***desktop_list)
   desktops = Accessibility_Registry_getDesktopList (cspi_registry (),
                                                    cspi_ev ());
 
-  cspi_return_val_if_ev ("getting desktop list", 0);
+  cspi_return_val_if_ev ("getDesktopList", 0);
 
   list = g_new0 (Accessible *, desktops->_length + 1);
 
index 9362b9a..54c884a 100644 (file)
@@ -102,9 +102,9 @@ AccessibleSelection_getSelectedChild (AccessibleSelection *obj,
   
   child = Accessibility_Selection_getSelectedChild (
     CSPI_OBJREF (obj),
-    (CORBA_long) selectedChildIndex, cspi_ev ());
+    selectedChildIndex, cspi_ev ());
 
-  return (Accessible *) cspi_object_add (child);
+  return  cspi_object_add (child);
 }
 
 /**
@@ -130,7 +130,7 @@ AccessibleSelection_selectChild (AccessibleSelection *obj,
 
   retval =
     Accessibility_Selection_selectChild (CSPI_OBJREF (obj),
-                                        (CORBA_long) childIndex, cspi_ev ());
+                                        childIndex, cspi_ev ());
 
   cspi_return_val_if_ev ("selectChild", FALSE);
 
@@ -160,7 +160,7 @@ AccessibleSelection_deselectSelectedChild (AccessibleSelection *obj,
   cspi_return_val_if_fail (obj != NULL, FALSE);
 
   retval = Accessibility_Selection_deselectSelectedChild (
-    CSPI_OBJREF (obj), (CORBA_long) selectedChildIndex, cspi_ev ());
+    CSPI_OBJREF (obj), selectedChildIndex, cspi_ev ());
 
   cspi_return_val_if_ev ("deselectSelectedChild", FALSE);
 
@@ -189,11 +189,11 @@ AccessibleSelection_isChildSelected (AccessibleSelection *obj,
 
   retval = Accessibility_Selection_isChildSelected (
     CSPI_OBJREF (obj),
-    (CORBA_long) childIndex, cspi_ev ());
+    childIndex, cspi_ev ());
 
   cspi_return_val_if_ev ("isChildSelected", FALSE);
 
-  return (SPIBoolean) retval;
+  return retval;
 }
 
 /**
index 6cb3087..2237277 100644 (file)
@@ -58,8 +58,14 @@ AccessibleTable_unref (AccessibleTable *obj)
 Accessible *
 AccessibleTable_getCaption (AccessibleTable *obj)
 {
-  return cspi_object_add (
-    Accessibility_Table__get_caption (CSPI_OBJREF (obj), cspi_ev ()));
+  Accessible *retval;
+
+  cspi_return_val_if_fail (obj != NULL, NULL);
+
+  retval =  cspi_object_add (
+                            Accessibility_Table__get_caption (CSPI_OBJREF (obj), cspi_ev ()));
+  cspi_return_val_if_ev ("getCaption", NULL);
+  return retval;
 }
 
 /**
@@ -74,8 +80,14 @@ AccessibleTable_getCaption (AccessibleTable *obj)
 Accessible *
 AccessibleTable_getSummary (AccessibleTable *obj)
 {
-  return cspi_object_add (
-    Accessibility_Table__get_summary (CSPI_OBJREF (obj), cspi_ev ()));
+  Accessible *retval;
+
+  cspi_return_val_if_fail (obj != NULL, NULL);
+
+retval = cspi_object_add (
+                         Accessibility_Table__get_summary (CSPI_OBJREF (obj), cspi_ev ()));
+ cspi_return_val_if_ev ("getSummary", NULL);
+ return retval;
 }
 
 /**
@@ -124,7 +136,7 @@ AccessibleTable_getNColumns (AccessibleTable *obj)
   retval =
     Accessibility_Table__get_nColumns (CSPI_OBJREF (obj), cspi_ev ());
          
-  cspi_return_val_if_ev ("", -1);
+  cspi_return_val_if_ev ("getNColumns", -1);
 
   return retval;
 }
@@ -146,10 +158,16 @@ AccessibleTable_getAccessibleAt (AccessibleTable *obj,
                                  long int row,
                                  long int column)
 {
-  return cspi_object_add (
-    Accessibility_Table_getAccessibleAt (
-      CSPI_OBJREF (obj), (CORBA_long) row,
-      (CORBA_long) column, cspi_ev ()));
+  Accessible *retval;
+
+  cspi_return_val_if_fail (obj != NULL, NULL);
+
+  retval = cspi_object_add (
+                           Accessibility_Table_getAccessibleAt (
+                                                                CSPI_OBJREF (obj), row,
+                                                                column, cspi_ev ()));
+  cspi_return_val_if_ev ("getAccessibleAt", NULL);
+ return retval;
 }
 
 /**
@@ -177,8 +195,8 @@ AccessibleTable_getIndexAt (AccessibleTable *obj,
 
   retval =
     Accessibility_Table_getIndexAt (
-      CSPI_OBJREF (obj), (CORBA_long) row,
-      (CORBA_long) column, cspi_ev ());
+      CSPI_OBJREF (obj), row,
+      column, cspi_ev ());
          
   cspi_return_val_if_ev ("getIndexAt", -1);
 
@@ -207,9 +225,9 @@ AccessibleTable_getRowAtIndex (AccessibleTable *obj,
 
   retval =
     Accessibility_Table_getRowAtIndex (CSPI_OBJREF (obj),
-                                      (CORBA_long) index, cspi_ev ());
+                                      index, cspi_ev ());
          
-  cspi_return_val_if_ev ("", -1);
+  cspi_return_val_if_ev ("getRowAtIndex", -1);
 
   return retval;
 }
@@ -236,7 +254,7 @@ AccessibleTable_getColumnAtIndex (AccessibleTable *obj,
 
   retval =
     Accessibility_Table_getColumnAtIndex (CSPI_OBJREF (obj),
-                                         (CORBA_long) index, cspi_ev ());
+                                         index, cspi_ev ());
          
   cspi_return_val_if_ev ("getColumnAtIndex", -1);
 
@@ -263,7 +281,7 @@ AccessibleTable_getRowDescription (AccessibleTable *obj,
 
   retval =
     Accessibility_Table_getRowDescription (CSPI_OBJREF (obj),
-                                          (CORBA_long) row, cspi_ev ());
+                                          row, cspi_ev ());
          
   cspi_return_val_if_ev ("getRowDescription", NULL);
 
@@ -290,7 +308,7 @@ AccessibleTable_getColumnDescription (AccessibleTable *obj,
 
   retval =
     Accessibility_Table_getColumnDescription (CSPI_OBJREF (obj),
-                                             (CORBA_long) column, cspi_ev ());
+                                             column, cspi_ev ());
 
   cspi_return_val_if_ev ("getColumnDescription", NULL);
 
@@ -319,8 +337,8 @@ AccessibleTable_getRowExtentAt (AccessibleTable *obj,
 
   retval =
     Accessibility_Table_getRowExtentAt (
-      CSPI_OBJREF (obj), (CORBA_long) row,
-      (CORBA_long) column, cspi_ev ());
+      CSPI_OBJREF (obj), row,
+      column, cspi_ev ());
          
   cspi_return_val_if_ev ("getRowExtentAt", -1);
 
@@ -349,8 +367,8 @@ AccessibleTable_getColumnExtentAt (AccessibleTable *obj,
 
   retval =
     Accessibility_Table_getColumnExtentAt (
-      CSPI_OBJREF (obj), (CORBA_long) row,
-      (CORBA_long) column, cspi_ev ());
+      CSPI_OBJREF (obj), row,
+      column, cspi_ev ());
          
   cspi_return_val_if_ev ("getColumnExtentAt", -1);
 
@@ -371,9 +389,16 @@ Accessible *
 AccessibleTable_getRowHeader (AccessibleTable *obj,
                              long int         row)
 {
-  return cspi_object_add (
-    Accessibility_Table_getRowHeader (CSPI_OBJREF (obj),
-                                     (CORBA_long) row, cspi_ev ()));
+  Accessible *retval;
+
+  cspi_return_val_if_fail (obj != NULL, NULL);
+
+  retval = cspi_object_add (
+                           Accessibility_Table_getRowHeader (CSPI_OBJREF (obj),
+                                                             row, cspi_ev ()));
+  cspi_return_val_if_ev ("getRowHeader", NULL);
+
+ return retval;
 }
 
 /**
@@ -390,9 +415,16 @@ Accessible *
 AccessibleTable_getColumnHeader (AccessibleTable *obj,
                                 long int column)
 {
-  return cspi_object_add (
-    Accessibility_Table_getColumnHeader (CSPI_OBJREF (obj),
-                                     (CORBA_long) column, cspi_ev ()));
+  Accessible *retval;
+
+  cspi_return_val_if_fail (obj != NULL, NULL);
+
+  retval = cspi_object_add (
+                           Accessibility_Table_getColumnHeader (CSPI_OBJREF (obj),
+                                                                column, cspi_ev ()));
+  cspi_return_val_if_ev ("getColumnHeader", NULL);
+
+  return retval;
 }
 
 /**
@@ -422,7 +454,8 @@ AccessibleTable_getNSelectedRows (AccessibleTable *obj)
 static long
 cspi_long_seq_to_array (Accessibility_LongSeq *seq, long int **array)
 {
-  long *j, length, i;
+  long *j;
+  long length, i;
 
   if (!cspi_check_ev ("getSelectionItems"))
     {
@@ -466,6 +499,8 @@ AccessibleTable_getSelectedRows (AccessibleTable *obj,
 
   rows = Accessibility_Table_getSelectedRows (CSPI_OBJREF (obj), cspi_ev ());
 
+  cspi_return_val_if_ev ("getSelectedRows", -1);
+
   return cspi_long_seq_to_array (rows, selectedRows);
 }
 
@@ -516,6 +551,7 @@ AccessibleTable_getSelectedColumns (AccessibleTable *obj,
 
   columns = Accessibility_Table_getSelectedColumns (CSPI_OBJREF (obj), cspi_ev ());
 
+  cspi_return_val_if_ev ("getSelectedColumns", -1);
   return cspi_long_seq_to_array (columns, selectedColumns);
 }
 
@@ -538,7 +574,7 @@ AccessibleTable_isRowSelected (AccessibleTable *obj,
 
   retval =
     Accessibility_Table_isRowSelected (CSPI_OBJREF (obj),
-                                      (CORBA_long) row, cspi_ev ());
+                                      row, cspi_ev ());
 
   cspi_return_val_if_ev ("isRowSelected", FALSE);
 
@@ -565,7 +601,7 @@ AccessibleTable_isColumnSelected (AccessibleTable *obj,
 
   retval =
     Accessibility_Table_isColumnSelected (CSPI_OBJREF (obj),
-                                         (CORBA_long) column, cspi_ev ());
+                                         column, cspi_ev ());
          
   cspi_return_val_if_ev ("isColumnSelected", FALSE);
 
@@ -592,7 +628,7 @@ AccessibleTable_addRowSelection (AccessibleTable *obj,
 
   retval =
     Accessibility_Table_addRowSelection (CSPI_OBJREF (obj),
-                                        (CORBA_long) row, cspi_ev ());
+                                        row, cspi_ev ());
          
   cspi_return_val_if_ev ("addRowSelection", FALSE);
 
@@ -619,7 +655,7 @@ AccessibleTable_addColumnSelection (AccessibleTable *obj,
 
   retval =
     Accessibility_Table_addColumnSelection (CSPI_OBJREF (obj),
-                                           (CORBA_long) column, cspi_ev ());
+                                           column, cspi_ev ());
          
   cspi_return_val_if_ev ("addColumnSelection", FALSE);
 
@@ -646,7 +682,7 @@ AccessibleTable_removeRowSelection (AccessibleTable *obj,
 
   retval =
     Accessibility_Table_removeRowSelection (CSPI_OBJREF (obj),
-                                           (CORBA_long) row, cspi_ev ());
+                                           row, cspi_ev ());
          
   cspi_return_val_if_ev ("removeRowSelection", FALSE);
 
@@ -673,7 +709,7 @@ AccessibleTable_removeColumnSelection (AccessibleTable *obj,
 
   retval =
     Accessibility_Table_removeColumnSelection (CSPI_OBJREF (obj),
-                                              (CORBA_long) column, cspi_ev ());
+                                              column, cspi_ev ());
          
   cspi_return_val_if_ev ("removeColumnSelection", FALSE);
 
@@ -701,8 +737,8 @@ AccessibleTable_isSelected (AccessibleTable *obj,
 
   retval =
     Accessibility_Table_isSelected (CSPI_OBJREF (obj),
-                                   (CORBA_long) row,
-                                   (CORBA_long) column, cspi_ev ());
+                                   row,
+                                   column, cspi_ev ());
          
   cspi_return_val_if_ev ("isSelected", FALSE);
 
index d3a4863..11fab39 100644 (file)
 
 #include <cspi/spi-private.h>
 
+static Accessibility_TEXT_BOUNDARY_TYPE
+get_accessible_text_boundary_type (
+                                                AccessibleTextBoundaryType type)
+{
+  switch (type)
+    {
+    case SPI_TEXT_BOUNDARY_CHAR:
+      return Accessibility_TEXT_BOUNDARY_CHAR;
+      break;
+    case SPI_TEXT_BOUNDARY_CURSOR_POS:
+      /* FixME */
+      return Accessibility_TEXT_BOUNDARY_CHAR;
+      break;
+    case SPI_TEXT_BOUNDARY_WORD_START:
+      return Accessibility_TEXT_BOUNDARY_WORD_START;
+      break;
+    case SPI_TEXT_BOUNDARY_WORD_END:
+      return Accessibility_TEXT_BOUNDARY_WORD_END;
+      break;
+    case SPI_TEXT_BOUNDARY_SENTENCE_START:
+      return Accessibility_TEXT_BOUNDARY_SENTENCE_START;
+      break;
+    case SPI_TEXT_BOUNDARY_SENTENCE_END:
+      return Accessibility_TEXT_BOUNDARY_SENTENCE_END;
+      break;
+    case SPI_TEXT_BOUNDARY_LINE_START:
+      return Accessibility_TEXT_BOUNDARY_LINE_START;
+      break;
+    case SPI_TEXT_BOUNDARY_LINE_END:
+      return Accessibility_TEXT_BOUNDARY_LINE_END;
+      break;
+    case SPI_TEXT_BOUNDARY_ATTRIBUTE_RANGE:
+      /* Fixme */
+      return Accessibility_TEXT_BOUNDARY_CHAR;
+      break;
+    }
+}
+
+
 /**
  * AccessibleText_ref:
  * @obj: a pointer to the #AccessibleText object on which to operate.
@@ -62,8 +101,7 @@ AccessibleText_getCharacterCount (AccessibleText *obj)
 
   cspi_return_val_if_fail (obj != NULL, -1);
 
-  retval = (long)
-    Accessibility_Text__get_characterCount (CSPI_OBJREF (obj), cspi_ev ());
+  retval = Accessibility_Text__get_characterCount (CSPI_OBJREF (obj), cspi_ev ());
 
   cspi_return_val_if_ev ("getCharacterCount", -1);
 
@@ -94,8 +132,8 @@ AccessibleText_getText (AccessibleText *obj,
 
   retval =
     Accessibility_Text_getText (CSPI_OBJREF (obj),
-                               (CORBA_long) startOffset,
-                               (CORBA_long) endOffset,
+                               startOffset,
+                               endOffset,
                                cspi_ev ());
 
   cspi_return_val_if_ev ("getText", NULL);
@@ -152,20 +190,20 @@ AccessibleText_getAttributes (AccessibleText *obj,
 
   if (obj == NULL)
     {
-      *startOffset = *endOffset = 0;
+      *startOffset = *endOffset = -1;
       return NULL;
     }
 
-  retval = (char *)
-    Accessibility_Text_getAttributes (CSPI_OBJREF (obj),
-                                     (CORBA_long) offset,
+  retval = Accessibility_Text_getAttributes (CSPI_OBJREF (obj),
+                                     offset,
                                      &retStartOffset,
                                      &retEndOffset,
                                      cspi_ev ());
 
   if (!cspi_check_ev ("getAttributes"))
     {
-      *startOffset = *endOffset = 0;
+      *startOffset = *endOffset = -1;
+      retval = NULL;
     }
   else
     {
@@ -195,7 +233,7 @@ AccessibleText_setCaretOffset (AccessibleText *obj,
 
   retval =
     Accessibility_Text_setCaretOffset (CSPI_OBJREF (obj),
-                                      (CORBA_long) newOffset, cspi_ev ());
+                                      newOffset, cspi_ev ());
 
   cspi_return_val_if_ev ("setCaretOffset", FALSE);
 
@@ -232,13 +270,28 @@ AccessibleText_getTextBeforeOffset (AccessibleText *obj,
 {
   char *retval;
   CORBA_long retStartOffset, retEndOffset;
-  retval = (char *)
-    Accessibility_Text_getTextBeforeOffset (CSPI_OBJREF (obj),
-                                          (CORBA_long) offset, (Accessibility_TEXT_BOUNDARY_TYPE) type,
+
+  if (obj == NULL)
+    {
+      *startOffset = *endOffset = -1;
+      return NULL;
+    }
+
+  retval = Accessibility_Text_getTextBeforeOffset (CSPI_OBJREF (obj),
+                                          offset,
+                       get_accessible_text_boundary_type (type),
                                           &retStartOffset, &retEndOffset,
                                           cspi_ev ());
-  *startOffset = (long) retStartOffset;
-  *endOffset = (long) retEndOffset;
+  if (!cspi_check_ev ("getTextBeforeOffset"))
+    {
+      *startOffset = *endOffset = -1;
+      retval = NULL;
+    }
+  else
+    {
+      *startOffset = retStartOffset;
+      *endOffset = retEndOffset;
+    }
   return retval;
 }
 
@@ -275,20 +328,20 @@ AccessibleText_getTextAtOffset (AccessibleText *obj,
 
   if (obj == NULL)
     {
-      *startOffset = *endOffset = 0;
+      *startOffset = *endOffset = -1;
       return NULL;
     }
 
   retval = Accessibility_Text_getTextAtOffset (CSPI_OBJREF (obj),
-                                              (CORBA_long) offset,
-                                              (Accessibility_TEXT_BOUNDARY_TYPE) type,
+                                              offset,
+                         get_accessible_text_boundary_type (type),
                                               &corbaStartOffset,
                                               &corbaEndOffset,
                                               cspi_ev ());
 
   if (!cspi_check_ev ("getTextAtOffset"))
     {
-      *startOffset = *endOffset = 0;
+      *startOffset = *endOffset = -1;
       retval = NULL;
     }
   else
@@ -296,9 +349,6 @@ AccessibleText_getTextAtOffset (AccessibleText *obj,
       *startOffset = corbaStartOffset;
       *endOffset   = corbaEndOffset;
     }
-#ifdef CSPI_DEBUG
-  fprintf (stderr, "text offsets %ld to %ld\n", *startOffset, *endOffset);
-#endif
   return retval;
 }
 
@@ -334,26 +384,26 @@ AccessibleText_getTextAfterOffset (AccessibleText *obj,
 
   if (obj == NULL)
     {
-      *startOffset = *endOffset = 0;
+      *startOffset = *endOffset = -1;
       return NULL;
     }
 
-  retval = (char *)
-    Accessibility_Text_getTextAfterOffset (CSPI_OBJREF (obj),
-                                          (CORBA_long) offset, (Accessibility_TEXT_BOUNDARY_TYPE) type,
+  retval = Accessibility_Text_getTextAfterOffset (CSPI_OBJREF (obj),
+                                          offset,
+                            get_accessible_text_boundary_type (type),
                                           &retStartOffset, &retEndOffset,
                                           cspi_ev ());
 
   if (!cspi_check_ev ("getTextAfterOffset"))
     {
-      *startOffset = *endOffset = 0;
+      *startOffset = *endOffset = -1;
+      retval = NULL;
     }
   else
     {
       *startOffset = retStartOffset;
       *endOffset   = retEndOffset;
     }
-
   return retval;
 }
 
@@ -380,7 +430,7 @@ AccessibleText_getCharacterAtOffset (AccessibleText *obj,
 
   retval =
     Accessibility_Text_getCharacterAtOffset (CSPI_OBJREF (obj),
-                                            (CORBA_long) offset,
+                                            offset,
                                             cspi_ev ());
 
   cspi_return_val_if_ev ("getCharacterAtOffset", -1);
@@ -420,23 +470,23 @@ AccessibleText_getCharacterExtents (AccessibleText *obj,
 
   if (obj == NULL)
     {
-      *x = *y = 0;
-      *width = *height = 0;
+      *x = *y = -1;
+      *width = *height = -1;
       return;
     }
 
   Accessibility_Text_getCharacterExtents (CSPI_OBJREF (obj),
-                                         (CORBA_long) offset,
+                                         offset,
                                          &retX,
                                          &retY,
                                          &retWidth,
                                          &retHeight,
-                                         (CORBA_short) type, cspi_ev ());
+                                         type, cspi_ev ());
 
   if (!cspi_check_ev ("getCharacterExtents"))
     {
-      *x = *y = 0;
-      *width = *height = 0;
+      *x = *y = -1;
+      *width = *height = -1;
     }
   else
     {
@@ -473,9 +523,9 @@ AccessibleText_getOffsetAtPoint (AccessibleText *obj,
 
   retval =
     Accessibility_Text_getOffsetAtPoint (CSPI_OBJREF (obj),
-                                        (CORBA_long) x,
-                                        (CORBA_long) y,
-                                        (CORBA_short) type, cspi_ev ());
+                                        x,
+                                        y,
+                                        type, cspi_ev ());
 
   cspi_return_val_if_ev ("getOffsetAtPoint", -1);
 
@@ -535,13 +585,13 @@ AccessibleText_getSelection (AccessibleText *obj,
     }
 
   Accessibility_Text_getSelection (CSPI_OBJREF (obj),
-                                  (CORBA_long) selectionNum,
+                                  selectionNum,
                                   &retStartOffset, &retEndOffset,
                                   cspi_ev ());
 
   if (!cspi_check_ev ("getSelection"))
     {
-      *startOffset = *endOffset = 0;
+      *startOffset = *endOffset = -1;
     }
   else
     {
@@ -570,8 +620,8 @@ AccessibleText_addSelection (AccessibleText *obj,
 
   retval =
     Accessibility_Text_addSelection (
-      CSPI_OBJREF (obj), (CORBA_long) startOffset,
-      (CORBA_long) endOffset, cspi_ev ());
+      CSPI_OBJREF (obj), startOffset,
+      endOffset, cspi_ev ());
 
   cspi_return_val_if_ev ("addSelection", FALSE);
 
@@ -598,7 +648,7 @@ AccessibleText_removeSelection (AccessibleText *obj,
 
   retval =
     Accessibility_Text_removeSelection (
-      CSPI_OBJREF (obj), (CORBA_long) selectionNum, cspi_ev ());
+      CSPI_OBJREF (obj), selectionNum, cspi_ev ());
 
   cspi_return_val_if_ev ("removeSelection", FALSE);
 
@@ -623,16 +673,18 @@ AccessibleText_setSelection (AccessibleText *obj,
                             long int startOffset,
                             long int endOffset)
 {
+  SPIBoolean retval;
+
   cspi_return_val_if_fail (obj != NULL, FALSE);
 
-  Accessibility_Text_setSelection (CSPI_OBJREF (obj),
-                                  (CORBA_long) selectionNum,
-                                  (CORBA_long) startOffset,
-                                  (CORBA_long) endOffset, cspi_ev ());
+  retval = Accessibility_Text_setSelection (CSPI_OBJREF (obj),
+                                  selectionNum,
+                                  startOffset,
+                                  endOffset, cspi_ev ());
 
   cspi_return_val_if_ev ("setSelection", FALSE);
 
-  return TRUE;
+  return retval;
 }