2008-09-08 Mark Doffman <mark.doffman@codethink.co.uk>
[platform/core/uifw/at-spi2-atk.git] / pyatspi / desktop.py
index 37898c2..1cbf1e8 100644 (file)
@@ -189,6 +189,9 @@ class Desktop(object):
        self._cache = cache
        self._app_name = '/'
 
+    def __nonzero__(self):
+           return True
+
     def __len__(self):
            return self.getChildCount()
 
@@ -242,7 +245,7 @@ class Desktop(object):
         an in parameter indicating which child is requested (zero-indexed).
         @return : the 'nth' Accessible child of this object.
         """
-       return self._cache.get_application_at_index(index)
+       return self._cache.get_application_at_index(index, self)
     
     def getIndexInParent(self):
         """
@@ -307,7 +310,7 @@ class Desktop(object):
         point to the same object.
         """
         return self == accessible
-    
+
     def get_childCount(self):
         return self._cache.get_application_count()
     _childCountDoc = \
@@ -315,6 +318,8 @@ class Desktop(object):
         childCount: the number of children contained by this object.
         """
     childCount = property(fget=get_childCount, doc=_childCountDoc)
+
+    getChildCount = get_childCount
     
     def get_description(self):
         return ''
@@ -340,6 +345,10 @@ class Desktop(object):
         """
     parent = property(fget=get_parent, doc=_parentDoc)
 
+    @property
+    def interfaces(self):
+        return [interfaces.ATSPI_ACCESSIBLE, interfaces.ATSPI_COMPONENT]
+
     def queryInterface(self, interface):
        """
        Gets a different accessible interface for this object