Added implementations for Accessibility_Component_getLayer and
authorbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Tue, 4 Dec 2001 00:38:48 +0000 (00:38 +0000)
committerbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Tue, 4 Dec 2001 00:38:48 +0000 (00:38 +0000)
Accessibility_Component_getMDIZOrder.

git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@131 e2bd861d-eb25-0410-b326-f6ed22b6b98c

ChangeLog
libspi/component.c

index 90db9f4..046ab2f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,12 +1,15 @@
 2001-12-03  Bill Haneman  <bill.haneman@sun.com>
 
-        * idl/Component.idl:
+       * idl/Component.idl:
        Added two methods, getLayer () and getMDIZOrder (), to reflect
        the new ATK methods atk_object_get_layer and
        atk_object_get_mdi_z_order. (Which arguably should be part of the
        AtkComponent API and AtkObject).  Also added an enum,
        ComponentLayer, for the first method's return value.
 
+       * libspi/component.c:
+       Added implementations for these methods.
+
        * cspi/spi_component.c:
        * cspi/spi.h:
        Added cspi binding methods for above, 
index a9ad7a1..86c5315 100644 (file)
@@ -173,6 +173,51 @@ impl_accessibility_component_get_size (PortableServer_Servant servant,
   *height = (CORBA_long) ih;
 }
 
+static Accessibility_ComponentLayer
+impl_accessibility_component_get_layer (PortableServer_Servant servant,
+                                       CORBA_Environment     *ev)
+{
+  SpiComponent *component;
+  AtkLayer atklayer;
+  BonoboObject *obj = bonobo_object_from_servant (servant);
+
+  g_return_if_fail (IS_SPI_COMPONENT(obj));
+  component = SPI_COMPONENT(obj);
+  g_return_if_fail (ATK_IS_COMPONENT(component->atko));
+  atklayer = atk_object_get_layer (ATK_OBJECT (component->atko));
+  switch (atklayer)
+    {
+      case ATK_LAYER_BACKGROUND:
+        return Accessibility_LAYER_BACKGROUND;
+      case ATK_LAYER_CANVAS:
+        return Accessibility_LAYER_CANVAS;
+      case ATK_LAYER_WIDGET:
+        return Accessibility_LAYER_WIDGET;
+      case ATK_LAYER_MDI:
+        return Accessibility_LAYER_MDI;
+      case ATK_LAYER_POPUP:
+        return Accessibility_LAYER_POPUP;
+      case ATK_LAYER_OVERLAY:
+        return Accessibility_LAYER_OVERLAY;
+      default:
+        break;      
+    }
+  return Accessibility_LAYER_INVALID;
+}
+
+static CORBA_short
+impl_accessibility_component_get_mdi_z_order (PortableServer_Servant servant,
+                                             CORBA_Environment     *ev)
+{
+  SpiComponent *component;
+  BonoboObject *obj = bonobo_object_from_servant (servant);
+
+  g_return_if_fail (IS_SPI_COMPONENT(obj));
+  component = SPI_COMPONENT(obj);
+  g_return_if_fail (ATK_IS_COMPONENT(component->atko));
+  return (CORBA_short) atk_object_get_mdi_zorder (ATK_OBJECT (component->atko));
+}
+
 static void
 spi_component_class_init (SpiComponentClass *klass)
 {
@@ -187,6 +232,8 @@ spi_component_class_init (SpiComponentClass *klass)
         epv->getExtents = impl_accessibility_component_get_extents;
         epv->getPosition = impl_accessibility_component_get_position;
         epv->getSize = impl_accessibility_component_get_size;
+       epv->getLayer = impl_accessibility_component_get_layer;
+       epv->getMDIZOrder = impl_accessibility_component_get_mdi_z_order;
 }
 
 static void