#Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
import interfaces
-from base import BaseProxy
+from base import BaseProxy, Enum
from factory import create_accessible, add_accessible_class
-from stateset import StateSet, _marshal_state_set
+from state import StateSet, _marshal_state_set
from relation import _marshal_relation_set
+from role import Role
__all__ = [
+ "LOCALE_TYPE",
+ "LOCALE_TYPE_COLLATE",
+ "LOCALE_TYPE_CTYPE",
+ "LOCALE_TYPE_MESSAGES",
+ "LOCALE_TYPE_MONETARY",
+ "LOCALE_TYPE_NUMERIC",
+ "LOCALE_TYPE_TIME",
+ "BoundingBox",
"Accessible",
]
#------------------------------------------------------------------------------
+class LOCALE_TYPE(Enum):
+ _enum_lookup = {
+ 0:'LOCALE_TYPE_MESSAGES',
+ 1:'LOCALE_TYPE_COLLATE',
+ 2:'LOCALE_TYPE_CTYPE',
+ 3:'LOCALE_TYPE_MONETARY',
+ 4:'LOCALE_TYPE_NUMERIC',
+ 5:'LOCALE_TYPE_TIME',
+ }
+
+LOCALE_TYPE_COLLATE = LOCALE_TYPE(1)
+LOCALE_TYPE_CTYPE = LOCALE_TYPE(2)
+LOCALE_TYPE_MESSAGES = LOCALE_TYPE(0)
+LOCALE_TYPE_MONETARY = LOCALE_TYPE(3)
+LOCALE_TYPE_NUMERIC = LOCALE_TYPE(4)
+LOCALE_TYPE_TIME = LOCALE_TYPE(5)
+
+#------------------------------------------------------------------------------
+
+class BoundingBox(list):
+ def __new__(cls, x, y, width, height):
+ return list.__new__(cls, (x, y, width, height))
+ def __init__(self, x, y, width, height):
+ list.__init__(self, (x, y, width, height))
+
+ def _get_x(self):
+ return self[0]
+ def _set_x(self, val):
+ self[0] = val
+ x = property(fget=_get_x, fset=_set_x)
+ def _get_y(self):
+ return self[1]
+ def _set_y(self, val):
+ self[1] = val
+ y = property(fget=_get_y, fset=_set_y)
+ def _get_width(self):
+ return self[2]
+ def _set_width(self, val):
+ self[2] = val
+ width = property(fget=_get_width, fset=_set_width)
+ def _get_height(self):
+ return self[3]
+ def _set_height(self, val):
+ self[3] = val
+ height = property(fget=_get_height, fset=_set_height)
+
+#------------------------------------------------------------------------------
+
class Accessible(BaseProxy):
"""
The base interface which is implemented by all accessible objects.
'children' and position in the accessible-object hierarchy,
whether or not they actually have children.
"""
+
+ def __len__(self):
+ return self.getChildCount()
+
+ def __getitem__(self, index):
+ return self.getChildAtIndex(index)
def getApplication(self):
"""
self._app_name,
application_root,
interfaces.ATSPI_APPLICATION,
- dbus_object=self._dbus_object)
+ connection=self._cache._connection)
def getAttributes(self):
"""
self._app_name,
path,
interfaces.ATSPI_ACCESSIBLE,
- dbus_object=self._dbus_object)
+ connection=self._cache._connection)
def getIndexInParent(self):
"""
@return : a Role indicating the type of UI role played by this
object.
"""
- return self.cached_data.role
+ return Role(self.cached_data.role)
def getRoleName(self):
"""
self._app_name,
self.cached_data.parent,
interfaces.ATSPI_ACCESSIBLE,
- dbus_object=self._dbus_object)
+ connection=self._cache._connection)
_parentDoc = \
"""