Started fixing IDL docs.
[platform/core/uifw/at-spi2-atk.git] / libspi / action.c
index 26440d3..1a23332 100644 (file)
  * Boston, MA 02111-1307, USA.
  */
 
-/*
- * component.c : bonobo wrapper for accessible component implementation
- *
- */
-#include <config.h>
-#include <bonobo/Bonobo.h>
+/* component.c : bonobo wrapper for accessible component implementation */
 
+#include <config.h>
 #include <stdio.h>
-
-/*
- * This pulls the CORBA definitions for the "Accessibility::SpiAccessible" server
- */
-#include <libspi/Accessibility.h>
-
-/*
- * This pulls the definition of the SpiAction bonobo object
- */
-#include "action.h"
+#include <libspi/action.h>
 
 /*
  * Static function declarations
@@ -50,14 +37,14 @@ spi_action_init (SpiAction *action);
 static void
 spi_action_finalize (GObject *obj);
 static CORBA_long
-impl__get_nSpiActions(PortableServer_Servant servant,
+impl__get_nActions(PortableServer_Servant servant,
                 CORBA_Environment * ev);
 static CORBA_string
 impl_getDescription (PortableServer_Servant servant,
                     const CORBA_long index,
                     CORBA_Environment * ev);
 static CORBA_boolean 
-impl_doSpiAction (PortableServer_Servant servant,
+impl_doAction (PortableServer_Servant servant,
               const CORBA_long index, CORBA_Environment * ev);
 static CORBA_string
 impl_getName (PortableServer_Servant servant,
@@ -70,47 +57,16 @@ impl_getKeyBinding (PortableServer_Servant servant,
 
 static GObjectClass *parent_class;
 
-GType
-spi_action_get_type (void)
-{
-  static GType type = 0;
-
-  if (!type) {
-    static const GTypeInfo tinfo = {
-      sizeof (SpiActionClass),
-      (GBaseInitFunc) NULL,
-      (GBaseFinalizeFunc) NULL,
-      (GClassInitFunc) spi_action_class_init,
-      (GClassFinalizeFunc) NULL,
-      NULL, /* class data */
-      sizeof (SpiAction),
-      0, /* n preallocs */
-      (GInstanceInitFunc) spi_action_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 (
-                              BONOBO_OBJECT_TYPE,
-                              POA_Accessibility_SpiAction__init,
-                              NULL,
-                              G_STRUCT_OFFSET (SpiActionClass, epv),
-                              &tinfo,
-                              "SpiAccessibleAction");
-  }
-
-  return type;
-}
+BONOBO_TYPE_FUNC_FULL (SpiAction,
+                      Accessibility_Action,
+                      BONOBO_TYPE_OBJECT,
+                      spi_action);
 
 static void
 spi_action_class_init (SpiActionClass *klass)
 {
   GObjectClass * object_class = (GObjectClass *) klass;
-  POA_Accessibility_SpiAction__epv *epv = &klass->epv;
+  POA_Accessibility_Action__epv *epv = &klass->epv;
   parent_class = g_type_class_peek_parent (klass);
 
   object_class->finalize = spi_action_finalize;
@@ -118,8 +74,8 @@ spi_action_class_init (SpiActionClass *klass)
 
   /* Initialize epv table */
 
-  epv->_get_nSpiActions = impl__get_nSpiActions;
-  epv->doSpiAction = impl_doSpiAction;
+  epv->_get_nActions = impl__get_nActions;
+  epv->doAction = impl_doAction;
   epv->getDescription = impl_getDescription;
   epv->getName = impl_getName;
   epv->getKeyBinding = impl_getKeyBinding;
@@ -142,15 +98,14 @@ spi_action_finalize (GObject *obj)
 SpiAction *
 spi_action_interface_new (AtkObject *obj)
 {
-  SpiAction *new_action = 
-    SPI_ACTION(g_object_new (SPI_ACTION_TYPE, NULL));
+  SpiAction *new_action = g_object_new (SPI_ACTION_TYPE, NULL);
   new_action->atko = obj;
   g_object_ref (obj);
   return new_action;
 }
 
 static CORBA_long
-impl__get_nSpiActions(PortableServer_Servant servant,
+impl__get_nActions(PortableServer_Servant servant,
            CORBA_Environment * ev)
 {
   SpiAction *action = SPI_ACTION (bonobo_object_from_servant(servant));
@@ -158,7 +113,7 @@ impl__get_nSpiActions(PortableServer_Servant servant,
 }
 
 static CORBA_boolean
-impl_doSpiAction (PortableServer_Servant servant,
+impl_doAction (PortableServer_Servant servant,
               const CORBA_long index, CORBA_Environment * ev)
 {
   SpiAction *action = SPI_ACTION (bonobo_object_from_servant (servant));
@@ -172,7 +127,7 @@ impl_getDescription (PortableServer_Servant servant,
                CORBA_Environment * ev)
 {
   SpiAction *action = SPI_ACTION (bonobo_object_from_servant(servant));
-  CORBA_char *rv;
+  const gchar *rv;
   
   rv = atk_action_get_description (ATK_ACTION(action->atko), (gint) index);
   if (rv)
@@ -188,7 +143,7 @@ impl_getName (PortableServer_Servant servant,
                CORBA_Environment * ev)
 {
   SpiAction *action = SPI_ACTION (bonobo_object_from_servant(servant));
-  CORBA_char *rv;
+  const gchar *rv;
   
   rv = atk_action_get_name (ATK_ACTION(action->atko), (gint) index);
   if (rv)
@@ -203,7 +158,7 @@ impl_getKeyBinding (PortableServer_Servant servant,
                    CORBA_Environment * ev)
 {
   SpiAction *action = SPI_ACTION (bonobo_object_from_servant(servant));
-  CORBA_char *rv;
+  const gchar *rv;
   
   rv = atk_action_get_keybinding (ATK_ACTION(action->atko), (gint) index);
   if (rv)