Index: text.c
===================================================================
RCS file: /cvs/gnome/at-spi/libspi/text.c,v
retrieving revision 1.24
diff -u -r1.24 text.c
--- text.c	16 Jan 2006 14:16:44 -0000	1.24
+++ text.c	10 Jul 2006 19:42:39 -0000
@@ -27,6 +27,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <bonobo/bonobo-exception.h>
 #include <atk/atktext.h>
 #include <libspi/text.h>
 #include <libspi/spi-private.h>
@@ -255,7 +256,7 @@
 }
 
 
-static CORBA_char *
+CORBA_char *
 _string_from_attribute_set (AtkAttributeSet *set)
 {
   gchar *attributes, *tmp, *tmp2;
@@ -671,6 +672,78 @@
 }
 
 
+
+static Accessibility_AttributeSet *	
+impl_getAttributeRun (PortableServer_Servant servant,		   
+		      const CORBA_long offset, 
+		      CORBA_long *startOffset, CORBA_long *endOffset, 
+		      const CORBA_boolean includeDefaults, 
+		      CORBA_Environment *ev){
+		      
+     AtkAttributeSet *attributes;
+     gint intstart_offset, intend_offset;
+     Accessibility_AttributeSet *retval;
+     AtkText *text = get_text_from_servant (servant);
+     gint n_attributes = 0;
+     gint i;
+     
+     g_return_val_if_fail (text != NULL, NULL);
+
+     attributes = atk_text_get_run_attributes (text, offset,
+					       &intstart_offset, &intend_offset);
+
+     *startOffset = intstart_offset;
+     *endOffset = intend_offset; 
+
+     retval = CORBA_sequence_CORBA_string__alloc ();
+     retval->_length = retval->_maximum = n_attributes;
+     retval->_buffer = CORBA_sequence_CORBA_string_allocbuf (n_attributes);
+     CORBA_sequence_set_release (retval, CORBA_TRUE);
+     
+     for (i = 0; i < n_attributes; ++i)
+     {
+	  retval->_buffer[i] = CORBA_string_dup (g_slist_nth_data (attributes, i));
+     }
+
+     atk_attribute_set_free (attributes);
+
+     return retval;
+
+}
+
+static Accessibility_AttributeSet *
+impl_getDefaultAttributeSet (PortableServer_Servant servant,
+			     CORBA_Environment *ev){
+     AtkAttributeSet *attributes;
+     Accessibility_AttributeSet *retval;
+     AtkText *text = get_text_from_servant (servant);
+     gint n_attributes = 0;
+     gint i;
+     
+     g_return_val_if_fail (text != NULL, NULL);
+     
+     attributes = atk_text_get_default_attributes (text);
+     
+     bonobo_return_val_if_fail (attributes != NULL, NULL, ev);
+     
+     n_attributes = g_slist_length (attributes);
+
+     retval = CORBA_sequence_CORBA_string__alloc ();
+     retval->_length = retval->_maximum = n_attributes;
+     retval->_buffer = CORBA_sequence_CORBA_string_allocbuf (n_attributes);
+     CORBA_sequence_set_release (retval, CORBA_TRUE);
+     
+     for (i = 0; i < n_attributes; ++i)
+     {
+	  retval->_buffer[i] = CORBA_string_dup (g_slist_nth_data (attributes, i));
+     }
+     atk_attribute_set_free (attributes);
+     
+     return retval;  
+     
+}
+
+
 static void
 spi_text_class_init (SpiTextClass *klass)
 {
@@ -698,6 +771,8 @@
   epv->getRangeExtents = impl_getRangeExtents;
   epv->getBoundedRanges = impl_getBoundedRanges;
   epv->getAttributeValue = impl_getAttributeValue;
+  epv->getAttributeRun = impl_getAttributeRun;
+  epv->getDefaultAttributeSet = impl_getDefaultAttributeSet;
 }
 
 static void
