Started fixing IDL docs.
[platform/core/uifw/at-spi2-atk.git] / libspi / accessible.c
index f0ed8ca..f603527 100644 (file)
  * Boston, MA 02111-1307, USA.
  */
 
-/*
- * accessible.c: test for accessibility implementation
- *
- */
-#include <config.h>
-#include <bonobo/Bonobo.h>
+/* accessible.c: the core of the accessibility implementation */
 
+#include <config.h>
 #include <stdio.h>
+#include <libspi/libspi.h>
 
-/*
- * This pulls the CORBA definitions for the "Accessibility::Accessible" server
- */
-#include <libspi/Accessibility.h>
-
-/*
- * This pulls the definition for the BonoboObject (Gtk Type)
- */
-#include "accessible.h"
-#include "component.h"
-#include "editabletext.h"
-#include "hyperlink.h"
-#include "hypertext.h"
-#include "image.h"
-#include "selection.h"
-#include "table.h"
-#include "text.h"
-#include "value.h"
-#include "action.h"
-
-/*
- * Our parent Gtk object type
- */
-#define PARENT_TYPE BONOBO_OBJECT_TYPE
+/* Our parent Gtk object type  */
+#define PARENT_TYPE BONOBO_TYPE_OBJECT
 
-/*
- * A pointer to our parent object class
- */
+/* A pointer to our parent object class */
 static GObjectClass *spi_accessible_parent_class;
 
 /*
@@ -237,7 +210,7 @@ impl_accessibility_accessible_get_relation_set (PortableServer_Servant servant,
     {
       retval->_buffer[i] =
              CORBA_Object_duplicate (bonobo_object_corba_objref (
-                     spi_relation_new (atk_relation_set_get_relation (relation_set, i))),
+                     BONOBO_OBJECT (spi_relation_new (atk_relation_set_get_relation (relation_set, i)))),
                                      ev);
     }
   
@@ -289,57 +262,21 @@ spi_accessible_init (SpiAccessible *accessible)
 {
 }
 
-GType
-spi_accessible_get_type (void)
-{
-        static GType type = 0;
-
-        if (!type) {
-                static const GTypeInfo tinfo = {
-                        sizeof (SpiAccessibleClass),
-                        (GBaseInitFunc) NULL,
-                        (GBaseFinalizeFunc) NULL,
-                        (GClassInitFunc) spi_accessible_class_init,
-                        (GClassFinalizeFunc) NULL,
-                        NULL, /* class data */
-                        sizeof (SpiAccessible),
-                        0, /* n preallocs */
-                        (GInstanceInitFunc) spi_accessible_init,
-                        NULL /* value table */
-                };
-                /*
-                 * Bonobo_type_unique auto-generates a load of
-                 * CORBA structures for us. All derived types must
-                 * use bonobo_type_unique.
-                 */
-                type = bonobo_type_unique (
-                        PARENT_TYPE,
-                        POA_Accessibility_Accessible__init,
-                        NULL,
-                        G_STRUCT_OFFSET (SpiAccessibleClass, epv),
-                        &tinfo,
-                        "SpiAccessible");
-        }
-
-        return type;
-}
+BONOBO_TYPE_FUNC_FULL (SpiAccessible,
+                      Accessibility_Accessible,
+                      PARENT_TYPE,
+                      spi_accessible);
 
 SpiAccessible *
 spi_accessible_new (AtkObject *o)
 {
-    SpiAccessible *retval =
-               SPI_ACCESSIBLE (g_object_new (spi_accessible_get_type (), NULL));
+    SpiAccessible *retval = g_object_new (SPI_ACCESSIBLE_TYPE, NULL);
     CORBA_Environment ev;
     CORBA_exception_init (&ev);
     g_object_ref (o);
     retval->atko = ATK_OBJECT (o);
 
-    /*
-     * TODO: add interface containers/constructors for SPI_EDITABLE_TEXT, SPI_HYPERTEXT,
-     *  SPI_IMAGE, SPI_SELECTION, SPI_TABLE, SPI_TEXT, SPI_VALUE.
-     */
-
-    /* add appropriate ATK interfaces */
+    /* aggregate appropriate SPI interfaces based on ATK interfaces */
 
     if (ATK_IS_ACTION (o))
       {