X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=libspi%2Faccessible.c;h=db19bff9eb01655cd5ce866171cede722e79b761;hb=47fb2ca13ddf2a891a0439c8046a7800ef5d8aee;hp=db9ab014f10b9b3ce7cd12ebd5f136c7bf9cc792;hpb=5f74d3142949e03330ebaee17bf8ac6e46a4c5f8;p=platform%2Fcore%2Fuifw%2Fat-spi2-atk.git diff --git a/libspi/accessible.c b/libspi/accessible.c index db9ab01..db19bff 100644 --- a/libspi/accessible.c +++ b/libspi/accessible.c @@ -452,7 +452,8 @@ impl_accessibility_accessible_get_attributes (PortableServer_Servant servant, CORBA_Environment *ev) { Accessibility_AttributeSet *retval; - GSList *attributes; + AtkAttributeSet *attributes = NULL; + AtkAttribute *attr = NULL; gint n_attributes = 0; gint i; @@ -460,8 +461,10 @@ impl_accessibility_accessible_get_attributes (PortableServer_Servant servant, g_return_val_if_fail (object != NULL, NULL); attributes = atk_object_get_attributes (object); - - bonobo_return_val_if_fail (attributes != NULL, NULL, ev); + + if (attributes == NULL) + return NULL; + n_attributes = g_slist_length (attributes); retval = CORBA_sequence_CORBA_string__alloc (); @@ -471,8 +474,11 @@ impl_accessibility_accessible_get_attributes (PortableServer_Servant servant, for (i = 0; i < n_attributes; ++i) { - retval->_buffer[i] = CORBA_string_dup (g_slist_nth_data (attributes, i)); + attr = g_slist_nth_data (attributes, i); + retval->_buffer[i] = CORBA_string_dup (g_strconcat (attr->name, ":", attr->value, NULL)); } + + atk_attribute_set_free (attributes); return retval; } @@ -623,6 +629,21 @@ spi_accessible_construct (GType type, AtkObject *o) bonobo_object_add_interface (bonobo_object (retval), BONOBO_OBJECT (spi_streamable_interface_new (o))); } + if (ATK_IS_DOCUMENT (o)) + { + bonobo_object_add_interface (bonobo_object (retval), + BONOBO_OBJECT (spi_document_interface_new (o))); + } + if (ATK_IS_HYPERLINK_IMPL (o)) + { + /* !!! the cast below is used instead of the ATK_HYPERLINK macro, since + the object 'o' is not really a hyperlink, but is in fact an AtkHyperlinkImpl. + Ouch. This works since it gets cast back to GObject, but it's nasty and needs + to be cleaned up. + */ + bonobo_object_add_interface (bonobo_object (retval), + BONOBO_OBJECT (spi_hyperlink_new ((AtkHyperlink*)o))); + } return retval; }