From 2052528b88cd226ae741c0c5cdfe1e0d223b0770 Mon Sep 17 00:00:00 2001 From: billh Date: Tue, 4 Dec 2001 00:38:48 +0000 Subject: [PATCH] Added implementations for Accessibility_Component_getLayer and Accessibility_Component_getMDIZOrder. git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@131 e2bd861d-eb25-0410-b326-f6ed22b6b98c --- ChangeLog | 5 ++++- libspi/component.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 90db9f4..046ab2f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,12 +1,15 @@ 2001-12-03 Bill Haneman - * 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, diff --git a/libspi/component.c b/libspi/component.c index a9ad7a1..86c5315 100644 --- a/libspi/component.c +++ b/libspi/component.c @@ -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 -- 2.7.4