2001-11-13 Michael Meeks <michael@ximian.com>
[platform/core/uifw/at-spi2-atk.git] / libspi / component.c
index efd22c9..6c0f780 100644 (file)
@@ -48,7 +48,7 @@
 /*
  * A pointer to our parent object class
  */
-static GObjectClass *component_parent_class;
+static GObjectClass *spi_component_parent_class;
 
 /*
  * Implemented GObject::finalize
@@ -56,14 +56,14 @@ static GObjectClass *component_parent_class;
 static void
 accessibility_component_object_finalize (GObject *object)
 {
-        Component *component = COMPONENT (object);
+        SpiComponent *component = SPI_COMPONENT (object);
 
-        printf("accessible_component_object_finalize called\n");
+        printf("spi_accessible_component_object_finalize called\n");
         g_object_unref (component->atko);
        component->atko = NULL;
 
-        printf("atko freed, calling parent finalize\n");
-        component_parent_class->finalize (object);
+        printf("component atko freed, calling parent finalize\n");
+        spi_component_parent_class->finalize (object);
 }
 
 /*
@@ -78,11 +78,11 @@ impl_accessibility_component_contains (PortableServer_Servant servant,
 {
   CORBA_boolean retval;
   BonoboObject *obj;
-  Component *component;
+  SpiComponent *component;
 
   obj = bonobo_object_from_servant (servant);
-  g_return_val_if_fail (IS_COMPONENT(obj), FALSE);
-  component = COMPONENT (obj);
+  g_return_val_if_fail (IS_SPI_COMPONENT(obj), FALSE);
+  component = SPI_COMPONENT (obj);
   g_return_val_if_fail (ATK_IS_COMPONENT(component->atko), FALSE);
   retval = atk_component_contains (ATK_COMPONENT (component->atko), (gint) x, (gint) y,
                                   (AtkCoordType) coord_type);
@@ -100,20 +100,20 @@ impl_accessibility_component_get_accessible_at_point (PortableServer_Servant ser
                                                       CORBA_Environment     *ev)
 {
   BonoboObject *obj;
-  Component *component;
+  SpiComponent *component;
   Accessibility_Accessible retval;
   AtkObject *child;
 
   obj = bonobo_object_from_servant (servant);
-  g_return_val_if_fail (IS_COMPONENT(obj), CORBA_OBJECT_NIL);
-  component = COMPONENT (obj);
+  g_return_val_if_fail (IS_SPI_COMPONENT(obj), CORBA_OBJECT_NIL);
+  component = SPI_COMPONENT (obj);
   g_return_val_if_fail (ATK_IS_COMPONENT(component->atko), CORBA_OBJECT_NIL);
 
   child = atk_component_ref_accessible_at_point (ATK_COMPONENT (component->atko),
                                                   (gint) x, (gint) y,
                                                   (AtkCoordType) coord_type);
-  retval = bonobo_object_corba_objref (bonobo_object (accessible_new (child)));
-  return retval;
+  retval = bonobo_object_corba_objref (bonobo_object (spi_accessible_new (child)));
+  return CORBA_Object_duplicate (retval, ev);
 }
 
 /*
@@ -129,12 +129,12 @@ impl_accessibility_component_get_extents (PortableServer_Servant servant,
                                           CORBA_Environment     *ev)
 {
   BonoboObject *obj;
-  Component *component;
+  SpiComponent *component;
   gint ix, iy, iw, ih;
 
   obj = bonobo_object_from_servant (servant);
-  g_return_if_fail (IS_COMPONENT(obj));
-  component = COMPONENT (obj);
+  g_return_if_fail (IS_SPI_COMPONENT(obj));
+  component = SPI_COMPONENT (obj);
   g_return_if_fail (ATK_IS_COMPONENT (component->atko));
 
   atk_component_get_extents (ATK_COMPONENT (component->atko), &ix, &iy, &iw, &ih,
@@ -156,11 +156,11 @@ impl_accessibility_component_get_position (PortableServer_Servant servant,
                                            CORBA_Environment     *ev)
 {
   BonoboObject *obj = bonobo_object_from_servant (servant);
-  Component *component;
+  SpiComponent *component;
   gint ix, iy;
 
-  g_return_if_fail (IS_COMPONENT(obj));
-  component = COMPONENT(obj);
+  g_return_if_fail (IS_SPI_COMPONENT(obj));
+  component = SPI_COMPONENT(obj);
   g_return_if_fail (ATK_IS_COMPONENT(component->atko));
 
   atk_component_get_position (ATK_COMPONENT (component->atko), &ix, &iy,
@@ -178,12 +178,12 @@ impl_accessibility_component_get_size (PortableServer_Servant servant,
                                        CORBA_long * height,
                                        CORBA_Environment     *ev)
 {
-  Component *component;
+  SpiComponent *component;
   BonoboObject *obj = bonobo_object_from_servant (servant);
   gint iw, ih;
 
-  g_return_if_fail (IS_COMPONENT(obj));
-  component = COMPONENT(obj);
+  g_return_if_fail (IS_SPI_COMPONENT(obj));
+  component = SPI_COMPONENT(obj);
   g_return_if_fail (ATK_IS_COMPONENT(component->atko));
   atk_component_get_size (ATK_COMPONENT (component->atko), &iw, &ih);
   *width = (CORBA_long) iw;
@@ -191,11 +191,11 @@ impl_accessibility_component_get_size (PortableServer_Servant servant,
 }
 
 static void
-accessibility_component_class_init (ComponentClass *klass)
+accessibility_component_class_init (SpiComponentClass *klass)
 {
         GObjectClass * object_class = (GObjectClass *) klass;
         POA_Accessibility_Component__epv *epv = &klass->epv;
-        component_parent_class = g_type_class_peek_parent (klass);
+        spi_component_parent_class = g_type_class_peek_parent (klass);
 
         object_class->finalize = accessibility_component_object_finalize;
 
@@ -207,7 +207,7 @@ accessibility_component_class_init (ComponentClass *klass)
 }
 
 static void
-accessibility_component_init (Component *component)
+accessibility_component_init (SpiComponent *component)
 {
 }
 
@@ -218,13 +218,13 @@ accessibility_component_get_type (void)
 
         if (!type) {
                 static const GTypeInfo tinfo = {
-                        sizeof (ComponentClass),
+                        sizeof (SpiComponentClass),
                         (GBaseInitFunc) NULL,
                         (GBaseFinalizeFunc) NULL,
                         (GClassInitFunc) accessibility_component_class_init,
                         (GClassFinalizeFunc) NULL,
                         NULL, /* class data */
-                        sizeof (Component),
+                        sizeof (SpiComponent),
                         0, /* n preallocs */
                         (GInstanceInitFunc) accessibility_component_init,
                         NULL /* value table */
@@ -238,20 +238,20 @@ accessibility_component_get_type (void)
                         PARENT_TYPE,
                         POA_Accessibility_Component__init,
                         NULL,
-                        G_STRUCT_OFFSET (ComponentClass, epv),
+                        G_STRUCT_OFFSET (SpiComponentClass, epv),
                         &tinfo,
-                        "AccessibleComponent");
+                        "SpiAccessibleComponent");
         }
 
         return type;
 }
 
-Component *
-component_interface_new (AtkObject *o)
+SpiComponent *
+spi_component_interface_new (AtkObject *o)
 {
-    Component *retval =
-               COMPONENT (g_object_new (accessibility_component_get_type (), NULL));
+    SpiComponent *retval =
+               SPI_COMPONENT (g_object_new (accessibility_component_get_type (), NULL));
     retval->atko = o;
     g_object_ref (o);
-return retval;
+    return retval;
 }