From: billh Date: Thu, 3 Jan 2002 20:23:00 +0000 (+0000) Subject: Added test for SpiRemoteObject to spi_accessible_new() constructor, X-Git-Tag: AT_SPI2_CORE_0_1_3~990 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a5b8573ce92636e315d1bfe4af7a430782740b46;p=platform%2Fupstream%2Fat-spi2-core.git Added test for SpiRemoteObject to spi_accessible_new() constructor, which allows support for remote atk objects. git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@198 e2bd861d-eb25-0410-b326-f6ed22b6b98c --- diff --git a/ChangeLog b/ChangeLog index 0a451e1..5526be3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,10 @@ -2002-01-01 Bill Haneman +2002-03-01 Bill Haneman + + * libspi/accessible.c (spi_accessible_new ()) : + Added check to see if AtkObject is an SpiRemoteObject before + creating an SpiAccessible. + +2002-02-01 Bill Haneman * libspi/remoteobject.h: * libspi/remoteobject.c: diff --git a/docs/reference/cspi/tmpl/spi_relation.sgml b/docs/reference/cspi/tmpl/spi_relation.sgml index fcf6eff..01c4d6a 100644 --- a/docs/reference/cspi/tmpl/spi_relation.sgml +++ b/docs/reference/cspi/tmpl/spi_relation.sgml @@ -19,11 +19,15 @@ AccessibleRelations and RelationSets +@SPI_RELATION_NULL: @SPI_RELATION_LABEL_FOR: @SPI_RELATION_LABELED_BY: @SPI_RELATION_CONTROLLER_FOR: @SPI_RELATION_CONTROLLED_BY: @SPI_RELATION_MEMBER_OF: +@SPI_RELATION_NODE_CHILD_OF: +@SPI_RELATION_EXTENDED: +@SPI_RELATION_LAST_DEFINED: diff --git a/libspi/accessible.c b/libspi/accessible.c index c3801ef..4f408f2 100644 --- a/libspi/accessible.c +++ b/libspi/accessible.c @@ -452,71 +452,79 @@ spi_accessible_new (AtkObject *o) return retval; } - retval = g_object_new (SPI_ACCESSIBLE_TYPE, NULL); - - spi_base_construct (SPI_BASE (retval), G_OBJECT(o)); + else if (SPI_IS_REMOTE_OBJECT (o)) + { + retval = spi_remote_object_get_accessible (o); + } + else + { + retval = g_object_new (SPI_ACCESSIBLE_TYPE, NULL); + + spi_base_construct (SPI_BASE (retval), G_OBJECT(o)); + + spi_base_construct (SPI_BASE (retval), G_OBJECT(o)); + + /* aggregate appropriate SPI interfaces based on ATK interfaces */ + + if (ATK_IS_ACTION (o)) + { + bonobo_object_add_interface (bonobo_object (retval), + BONOBO_OBJECT (spi_action_interface_new (o))); + } + + if (ATK_IS_COMPONENT (o)) + { + bonobo_object_add_interface (bonobo_object (retval), + BONOBO_OBJECT (spi_component_interface_new (o))); + } + + if (ATK_IS_EDITABLE_TEXT (o)) + { + bonobo_object_add_interface (bonobo_object (retval), + BONOBO_OBJECT(spi_editable_text_interface_new (o))); + } + + else if (ATK_IS_TEXT (o)) + { + bonobo_object_add_interface (bonobo_object (retval), + BONOBO_OBJECT (spi_text_interface_new (o))); + } + + if (ATK_IS_HYPERTEXT (o)) + { + bonobo_object_add_interface (bonobo_object (retval), + BONOBO_OBJECT (spi_hypertext_interface_new (o))); + } + + if (ATK_IS_IMAGE (o)) + { + bonobo_object_add_interface (bonobo_object (retval), + BONOBO_OBJECT (spi_image_interface_new (o))); + } + + if (ATK_IS_SELECTION (o)) + { + bonobo_object_add_interface (bonobo_object (retval), + BONOBO_OBJECT (spi_selection_interface_new (o))); + } + + if (ATK_IS_TABLE (o)) + { + bonobo_object_add_interface (bonobo_object (retval), + BONOBO_OBJECT (spi_table_interface_new (o))); + } + + if (ATK_IS_VALUE (o)) + { + bonobo_object_add_interface (bonobo_object (retval), + BONOBO_OBJECT (spi_value_interface_new (o))); + } + } g_hash_table_insert (get_public_refs (), o, retval); g_signal_connect (G_OBJECT (retval), "destroy", G_CALLBACK (de_register_public_ref), NULL); - - /* aggregate appropriate SPI interfaces based on ATK interfaces */ - - if (ATK_IS_ACTION (o)) - { - bonobo_object_add_interface (bonobo_object (retval), - BONOBO_OBJECT (spi_action_interface_new (o))); - } - - if (ATK_IS_COMPONENT (o)) - { - bonobo_object_add_interface (bonobo_object (retval), - BONOBO_OBJECT (spi_component_interface_new (o))); - } - - if (ATK_IS_EDITABLE_TEXT (o)) - { - bonobo_object_add_interface (bonobo_object (retval), - BONOBO_OBJECT(spi_editable_text_interface_new (o))); - } - - else if (ATK_IS_TEXT (o)) - { - bonobo_object_add_interface (bonobo_object (retval), - BONOBO_OBJECT (spi_text_interface_new (o))); - } - - if (ATK_IS_HYPERTEXT (o)) - { - bonobo_object_add_interface (bonobo_object (retval), - BONOBO_OBJECT (spi_hypertext_interface_new (o))); - } - - if (ATK_IS_IMAGE (o)) - { - bonobo_object_add_interface (bonobo_object (retval), - BONOBO_OBJECT (spi_image_interface_new (o))); - } - - if (ATK_IS_SELECTION (o)) - { - bonobo_object_add_interface (bonobo_object (retval), - BONOBO_OBJECT (spi_selection_interface_new (o))); - } - - if (ATK_IS_TABLE (o)) - { - bonobo_object_add_interface (bonobo_object (retval), - BONOBO_OBJECT (spi_table_interface_new (o))); - } - - if (ATK_IS_VALUE (o)) - { - bonobo_object_add_interface (bonobo_object (retval), - BONOBO_OBJECT (spi_value_interface_new (o))); - } - return retval; } diff --git a/libspi/libspi.h b/libspi/libspi.h index 1d07ad6..1da52f5 100644 --- a/libspi/libspi.h +++ b/libspi/libspi.h @@ -39,5 +39,6 @@ #include #include #include +#include #endif /* LIBSPI_H_ */