* libspi/Makefile.am:
[platform/core/uifw/at-spi2-atk.git] / libspi / value.c
index e576486..520b397 100644 (file)
@@ -2,7 +2,8 @@
  * AT-SPI - Assistive Technology Service Provider Interface
  * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
  *
- * Copyright 2001 Sun Microsystems Inc.
+ * Copyright 2001, 2002 Sun Microsystems Inc.,
+ * Copyright 2001, 2002 Ximian, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -22,6 +23,7 @@
 
 /* value.c : implements the Value interface */
 #include <config.h>
+#include <math.h>
 #include <stdio.h>
 #include <libspi/value.h>
 
@@ -55,7 +57,7 @@ impl__set_currentValue (PortableServer_Servant _servant,
 BONOBO_TYPE_FUNC_FULL (SpiValue,
                       Accessibility_Value,
                       PARENT_TYPE,
-                      spi_value);
+                      spi_value)
 
 
 static void
@@ -83,7 +85,7 @@ spi_value_interface_new (AtkObject *obj)
 {
   SpiValue *new_value = g_object_new (SPI_VALUE_TYPE, NULL);
 
-  spi_base_construct (SPI_BASE (new_value), obj);
+  spi_base_construct (SPI_BASE (new_value), G_OBJECT(obj));
 
   return new_value;
 }
@@ -94,12 +96,9 @@ get_value_from_servant (PortableServer_Servant servant)
 {
   SpiBase *object = SPI_BASE (bonobo_object_from_servant (servant));
 
-  if (!object)
-    {
-      return NULL;
-    }
-
-  return ATK_VALUE (object->atko);
+  g_return_val_if_fail (object, NULL);
+  g_return_val_if_fail (ATK_IS_OBJECT(object->gobj), NULL);
+  return ATK_VALUE (object->gobj);
 }
 
 static double