2001-11-20 Michael Meeks <michael@ximian.com>
[platform/core/uifw/at-spi2-atk.git] / libspi / value.c
index 38d9866..cfe6f0d 100644 (file)
  * Boston, MA 02111-1307, USA.
  */
 
-/*
- * component.c : bonobo wrapper for accessible component implementation
- *
- */
+/* value.c : implements the Value interface */
 #include <config.h>
-#include <bonobo/Bonobo.h>
-
 #include <stdio.h>
+#include <libspi/value.h>
 
-/*
- * This pulls the CORBA definitions for the "Accessibility::SpiAccessible" server
- */
-#include <libspi/Accessibility.h>
-
-/*
- * This pulls the definition of the SpiValue bonobo object
- */
-#include "value.h"
-
-/*
- * Static function declarations
- */
+/* Static function declarations */
 
 static void
 spi_value_class_init (SpiValueClass *klass);
@@ -50,10 +34,10 @@ spi_value_init (SpiValue *value);
 static void
 spi_value_finalize (GObject *obj);
 static CORBA_float
-impl__get_minimumSpiValue (PortableServer_Servant _servant,
+impl__get_minimumValue (PortableServer_Servant _servant,
                        CORBA_Environment * ev);
 static        CORBA_float
-impl__get_maximumSpiValue (PortableServer_Servant _servant,
+impl__get_maximumValue (PortableServer_Servant _servant,
                        CORBA_Environment * ev);
 static CORBA_float
 impl__get_currentValue (PortableServer_Servant _servant,
@@ -68,47 +52,16 @@ impl__set_currentValue (PortableServer_Servant _servant,
 static GObjectClass *parent_class;
 
 
-GType
-spi_value_get_type (void)
-{
-  static GType type = 0;
-
-  if (!type) {
-    static const GTypeInfo tinfo = {
-      sizeof (SpiValueClass),
-      (GBaseInitFunc) NULL,
-      (GBaseFinalizeFunc) NULL,
-      (GClassInitFunc) spi_value_class_init,
-      (GClassFinalizeFunc) NULL,
-      NULL, /* class data */
-      sizeof (SpiValue),
-      0, /* n preallocs */
-      (GInstanceInitFunc) spi_value_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_SpiValue__init,
-                              NULL,
-                              G_STRUCT_OFFSET (SpiValueClass, epv),
-                              &tinfo,
-                              "SpiAccessibleValue");
-  }
-
-  return type;
-}
+BONOBO_TYPE_FUNC_FULL (SpiValue,
+                      Accessibility_Value,
+                      BONOBO_TYPE_OBJECT,
+                      spi_value);
 
 static void
 spi_value_class_init (SpiValueClass *klass)
 {
   GObjectClass * object_class = (GObjectClass *) klass;
-  POA_Accessibility_SpiValue__epv *epv = &klass->epv;
+  POA_Accessibility_Value__epv *epv = &klass->epv;
   parent_class = g_type_class_peek_parent (klass);
 
   object_class->finalize = spi_value_finalize;
@@ -116,8 +69,8 @@ spi_value_class_init (SpiValueClass *klass)
 
   /* Initialize epv table */
 
-  epv->_get_minimumSpiValue = impl__get_minimumSpiValue;
-  epv->_get_maximumSpiValue = impl__get_maximumSpiValue;
+  epv->_get_minimumValue = impl__get_minimumValue;
+  epv->_get_maximumValue = impl__get_maximumValue;
   epv->_get_currentValue = impl__get_currentValue;
   epv->_set_currentValue = impl__set_currentValue;
 }
@@ -149,7 +102,7 @@ spi_value_interface_new (AtkObject *obj)
 
 
 static CORBA_float
-impl__get_minimumSpiValue (PortableServer_Servant _servant,
+impl__get_minimumValue (PortableServer_Servant _servant,
                       CORBA_Environment * ev)
 {
   SpiValue *value = SPI_VALUE (bonobo_object_from_servant (_servant));
@@ -163,7 +116,7 @@ impl__get_minimumSpiValue (PortableServer_Servant _servant,
 
 
 static        CORBA_float
-impl__get_maximumSpiValue (PortableServer_Servant _servant,
+impl__get_maximumValue (PortableServer_Servant _servant,
                        CORBA_Environment * ev)
 {
   SpiValue *value = SPI_VALUE (bonobo_object_from_servant (_servant));