Fixed bug in Accessible_getDescription().
authorbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Fri, 16 Nov 2001 14:03:45 +0000 (14:03 +0000)
committerbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Fri, 16 Nov 2001 14:03:45 +0000 (14:03 +0000)
Added docs for AccessibleEditableText and AccessibleHyperlink.

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

ChangeLog
at-bridge/bridge.c
atk-bridge/bridge.c
cspi/spi.h
cspi/spi_editabletext.c
cspi/spi_hypertext.c
libspi/accessible.c
test/simple-at.c

index 0dd0c9d..1cbdf6d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2001-16-11  Bill Haneman <bill.haneman@sun.com>
 
+       * libspi/accessible.c:
+       Fixed a bug that caused SEGV  if an accessible
+       object's description is NULL, and a client
+       requests it.  An empty string is now returned.
+
+       * cspi/spi_editabletext.c:
+       * cspi/spi_hypertext.c:
+       Added docs.  Doc coverage now 70%.
+
+2001-16-11  Bill Haneman <bill.haneman@sun.com>
+
        One last namespacing revision:
        * libspi/accessibleeventlistener.[ch]:
        Renamed SpiAccessibleEventListener to SpiEventListener,
index 2ee7616..dc89a7a 100644 (file)
@@ -30,6 +30,8 @@
 #include "accessible.h"
 #include "application.h"
 
+#define SPI_BRIDGE_DEBUG 1
+
 #define APP_STATIC_BUFF_SZ 64
 
 typedef struct _ArgStruct ArgStruct;
index 2ee7616..dc89a7a 100644 (file)
@@ -30,6 +30,8 @@
 #include "accessible.h"
 #include "application.h"
 
+#define SPI_BRIDGE_DEBUG 1
+
 #define APP_STATIC_BUFF_SZ 64
 
 typedef struct _ArgStruct ArgStruct;
index 80b5110..d702338 100644 (file)
@@ -1032,7 +1032,7 @@ AccessibleHypertext_getLink (AccessibleHypertext *obj,
 
 long
 AccessibleHypertext_getLinkIndex (AccessibleHypertext *obj,
-                                  long int characterIndex);
+                                  long int characterOffset);
 
 /*
  *
index e64bf2d..576da71 100644 (file)
@@ -19,7 +19,7 @@ AccessibleEditableText_ref (AccessibleEditableText *obj)
 
 
 /**
- * AccessibleEditableText_ref:
+ * AccessibleEditableText_unref:
  * @obj: a pointer to the #AccessibleEditableText object on which to operate.
  *
  * Decrement the reference count for an #AccessibleEdiitableText object.
index 64cc99d..c9a65ff 100644 (file)
@@ -1,3 +1,14 @@
+/**
+ * AccessibleHypertext_ref:
+ * @obj: a pointer to the #AccessibleHypertext object on which to operate.
+ *
+ * Increment the reference count for an #AccessibleHypertext object.
+ *       Since AccessibleHypertext is derived from AccessibleText,
+ *       this is the same as AccessibleText_unref().
+ *
+ * Returns: (no return code implemented yet).
+ *
+ **/
 int
 AccessibleHypertext_ref (AccessibleHypertext *obj)
 {
@@ -6,7 +17,17 @@ AccessibleHypertext_ref (AccessibleHypertext *obj)
 }
 
 
-
+/**
+ * AccessibleHypertext_unref:
+ * @obj: a pointer to the #AccessibleHypertext object on which to operate.
+ *
+ * Decrement the reference count for an #AccessibleHypertext object.
+ *       Since AccessibleHypertext is derived from AccessibleText,
+ *       this is the same as AccessibleText_unref().
+ *
+ * Returns: (no return code implemented yet).
+ *
+ **/
 int
 AccessibleHypertext_unref (AccessibleHypertext *obj)
 {
@@ -16,6 +37,20 @@ AccessibleHypertext_unref (AccessibleHypertext *obj)
 
 
 
+/**
+ * AccessibleHypertext_getNLinks:
+ * @obj: a pointer to the #AccessibleHypertext implementor on which to operate.
+ *
+ * Get the total number of #AccessibleHyperlinks which an
+ *        #AccessibleHypertext implementor has.
+ *
+ * Returns: a #long indicating the number of #AccessibleHyperlinks
+ *        of the #AccessibleHypertext implementor, or -1 if
+ *        the number cannot be determined (for example, if the
+ *        #AccessibleHypertext object is so large that it is not
+ *        all currently in the memory cache).
+ *
+ **/
 long
 AccessibleHypertext_getNLinks (AccessibleHypertext *obj)
 {
@@ -24,9 +59,19 @@ AccessibleHypertext_getNLinks (AccessibleHypertext *obj)
 }
 
 
+/**
+ * AccessibleHypertext_getLink:
+ * @obj: a pointer to the #AccessibleHypertext implementor on which to operate.
+ * @linkIndex: a (zero-index) long integer indicating which hyperlink to query.
+ *
+ * Get the #AccessibleHyperlink object at a specified index.
+ *
+ * Returns: the #AccessibleHyperlink object specified by #linkIndex.
+ *
+ **/
 AccessibleHyperlink *
 AccessibleHypertext_getLink (AccessibleHypertext *obj,
-                             long linkIndex)
+                             long int linkIndex)
 {
   return (AccessibleHyperlink *)
     Accessibility_Hypertext_getLink (*obj,
@@ -34,14 +79,26 @@ AccessibleHypertext_getLink (AccessibleHypertext *obj,
 }
 
 
-
+/**
+ * AccessibleHypertext_getLinkIndex:
+ * @obj: a pointer to the #AccessibleHypertext implementor on which to operate.
+ * @characterOffset: an integer specifying the character offset to query.
+ *
+ * Get the index of the #AccessibleHyperlink object at a specified
+ *        character offset.
+ *
+ * Returns: the linkIndex of the #AccessibleHyperlink active at
+ *        character offset @characterOffset, or -1 if there is
+ *        no hyperlink at the specified character offset.
+ *
+ **/
 long
 AccessibleHypertext_getLinkIndex (AccessibleHypertext *obj,
-                                  long characterIndex)
+                                  long int characterOffset)
 {
   return (long)
     Accessibility_Hypertext_getLinkIndex (*obj,
-                                         (CORBA_long) characterIndex, &ev);
+                                         (CORBA_long) characterOffset, &ev);
 }
 
 
index 8e2b8e2..e2b5822 100644 (file)
@@ -117,6 +117,10 @@ impl_accessibility_accessible_get_description (PortableServer_Servant servant,
   CORBA_char * retval;
   SpiAccessible *accessible = SPI_ACCESSIBLE (bonobo_object_from_servant (servant));
   retval = CORBA_string_dup (atk_object_get_description (accessible->atko));
+  if (retval )
+    retval = CORBA_string_dup (retval);
+  else
+    retval = CORBA_string_dup ("");
 
   return retval;
 }
index 7b2a6f3..94fa106 100644 (file)
@@ -172,6 +172,8 @@ report_button_press (void *p)
   AccessibleEvent *ev = (AccessibleEvent *) p;
   fprintf (stderr, "%s event from %s\n", ev->type,
            Accessible_getName (&ev->source));
+  fprintf (stderr, "Object description %s\n",
+           Accessible_getDescription (&ev->source));
 }