Added test for SpiRemoteObject to spi_accessible_new() constructor,
authorbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Thu, 3 Jan 2002 20:23:00 +0000 (20:23 +0000)
committerbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Thu, 3 Jan 2002 20:23:00 +0000 (20:23 +0000)
which allows support for remote atk objects.

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

ChangeLog
docs/reference/cspi/tmpl/spi_relation.sgml
libspi/accessible.c
libspi/libspi.h

index 0a451e1..5526be3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,10 @@
-2002-01-01  Bill Haneman <bill.haneman@sun.com>
+2002-03-01  Bill Haneman <bill.haneman@sun.com>
+
+       * libspi/accessible.c (spi_accessible_new ()) :
+       Added check to see if AtkObject is an SpiRemoteObject before
+       creating an SpiAccessible.
+       
+2002-02-01  Bill Haneman <bill.haneman@sun.com>
 
        * libspi/remoteobject.h:
        * libspi/remoteobject.c:
index fcf6eff..01c4d6a 100644 (file)
@@ -19,11 +19,15 @@ AccessibleRelations and RelationSets
 
 </para>
 
+@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: 
 
 <!-- ##### FUNCTION AccessibleRelation_ref ##### -->
 <para>
index c3801ef..4f408f2 100644 (file)
@@ -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;
 }
 
index 1d07ad6..1da52f5 100644 (file)
@@ -39,5 +39,6 @@
 #include <libspi/eventlistener.h>
 #include <libspi/keystrokelistener.h>
 #include <libspi/keymasks.h>
+#include <libspi/remoteobject.h>
 
 #endif /* LIBSPI_H_ */