summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--atk-adaptor/accessible-adaptor.c34
-rw-r--r--atk-adaptor/bridge.c1
-rw-r--r--atk-adaptor/editabletext-adaptor.c32
-rw-r--r--pyatspi/Makefile.am2
-rw-r--r--pyatspi/accessible.py4
-rw-r--r--pyatspi/accessiblecache.py6
-rw-r--r--pyatspi/action.py10
-rw-r--r--pyatspi/application.py74
-rw-r--r--pyatspi/base.py9
-rw-r--r--pyatspi/component.py48
-rw-r--r--pyatspi/desktop.py14
-rw-r--r--pyatspi/deviceevent.py12
-rw-r--r--pyatspi/document.py12
-rw-r--r--pyatspi/editabletext.py33
-rw-r--r--pyatspi/event.py2
-rw-r--r--pyatspi/hyperlink.py32
-rw-r--r--pyatspi/hypertext.py13
-rw-r--r--pyatspi/image.py20
-rw-r--r--pyatspi/registry.py5
-rw-r--r--pyatspi/relation.py1
-rw-r--r--pyatspi/selection.py34
-rw-r--r--pyatspi/selector.py169
-rw-r--r--pyatspi/streamablecontent.py148
-rw-r--r--pyatspi/table.py119
-rw-r--r--pyatspi/text.py34
-rw-r--r--pyatspi/utils.py2
-rw-r--r--pyatspi/value.py24
-rw-r--r--spi-common/spi-dbus.h21
-rw-r--r--tests/pyatspi/accessibletest.py5
-rw-r--r--tests/pyatspi/componenttest.py2
-rw-r--r--xml/Makefile.am3
-rw-r--r--xml/org.freedesktop.atspi.Accessible.xml12
-rw-r--r--xml/org.freedesktop.atspi.Application.xml54
-rw-r--r--xml/org.freedesktop.atspi.Component.xml15
-rw-r--r--xml/org.freedesktop.atspi.Desktop.xml30
-rw-r--r--xml/org.freedesktop.atspi.Document.xml2
-rw-r--r--xml/org.freedesktop.atspi.EditableText.xml13
-rw-r--r--xml/org.freedesktop.atspi.LoginHelper.xml161
-rw-r--r--xml/org.freedesktop.atspi.Selector.xml151
-rw-r--r--xml/org.freedesktop.atspi.StreamableContent.xml170
-rw-r--r--xml/org.freedesktop.atspi.Text.xml6
41 files changed, 249 insertions, 1290 deletions
diff --git a/atk-adaptor/accessible-adaptor.c b/atk-adaptor/accessible-adaptor.c
index 5abd827..1536236 100644
--- a/atk-adaptor/accessible-adaptor.c
+++ b/atk-adaptor/accessible-adaptor.c
@@ -517,37 +517,39 @@ impl_getAttributes (DBusConnection *bus,
{
AtkObject *object = (AtkObject *) user_data;
DBusMessage *reply;
+
+ GSList *attr;
AtkAttributeSet *attributes;
- AtkAttribute *attr = NULL;
- char **retval;
+ DBusMessageIter iter, dictIter, dictEntryIter;
gint n_attributes = 0;
- gint i;
g_return_val_if_fail (ATK_IS_OBJECT (user_data),
droute_not_yet_handled_error (message));
attributes = atk_object_get_attributes (object);
+
if (attributes)
n_attributes = g_slist_length (attributes);
- retval = (char **) g_malloc (n_attributes * sizeof (char *));
+ attr = attributes;
- for (i = 0; i < n_attributes; ++i)
+ reply = dbus_message_new_method_return (message);
+ dbus_message_iter_init_append (reply, &iter);
+ dbus_message_iter_open_container (&iter, DBUS_TYPE_ARRAY, "{ss}", &dictIter);
+ while (attr)
{
- attr = g_slist_nth_data (attributes, i);
- retval[i] = g_strconcat (attr->name, ":", attr->value, NULL);
+ AtkAttribute *attribute = (AtkAttribute *) attr->data;
+ dbus_message_iter_open_container (&dictIter, DBUS_TYPE_DICT_ENTRY, NULL, &dictEntryIter);
+ dbus_message_iter_append_basic (&dictEntryIter, DBUS_TYPE_STRING, &attribute->name);
+ dbus_message_iter_append_basic (&dictEntryIter, DBUS_TYPE_STRING, &attribute->value);
+ dbus_message_iter_close_container (&dictIter, &dictEntryIter);
+ attr = g_slist_next (attr);
}
+ dbus_message_iter_close_container (&iter, &dictIter);
+
if (attributes)
atk_attribute_set_free (attributes);
- reply = dbus_message_new_method_return (message);
- if (reply)
- {
- dbus_message_append_args (reply, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING,
- &retval, n_attributes, DBUS_TYPE_INVALID);
- }
- for (i = 0; i < n_attributes; i++)
- g_free (retval[i]);
- g_free (retval);
+
return reply;
}
diff --git a/atk-adaptor/bridge.c b/atk-adaptor/bridge.c
index 6fab38e..b99f982 100644
--- a/atk-adaptor/bridge.c
+++ b/atk-adaptor/bridge.c
@@ -297,6 +297,7 @@ adaptor_init (gint *argc, gchar **argv[])
spi_initialize_tree (treepath);
spi_initialize_accessible (accpath);
+ spi_initialize_application (accpath);
spi_initialize_action(accpath);
spi_initialize_collection (accpath);
spi_initialize_component (accpath);
diff --git a/atk-adaptor/editabletext-adaptor.c b/atk-adaptor/editabletext-adaptor.c
index 4f2f484..417b24d 100644
--- a/atk-adaptor/editabletext-adaptor.c
+++ b/atk-adaptor/editabletext-adaptor.c
@@ -91,37 +91,6 @@ impl_insertText (DBusConnection * bus, DBusMessage * message, void *user_data)
}
static DBusMessage *
-impl_setAttributes (DBusConnection * bus, DBusMessage * message,
- void *user_data)
-{
- AtkEditableText *editable = (AtkEditableText *) user_data;
- const char *attributes;
- dbus_int32_t startPos, endPos;
- dbus_bool_t rv;
- DBusError error;
- DBusMessage *reply;
-
- g_return_val_if_fail (ATK_IS_EDITABLE_TEXT (user_data),
- droute_not_yet_handled_error (message));
- dbus_error_init (&error);
- if (!dbus_message_get_args
- (message, &error, DBUS_TYPE_STRING, &attributes, DBUS_TYPE_INT32,
- &startPos, DBUS_TYPE_INT32, &endPos, DBUS_TYPE_INVALID))
- {
- return droute_invalid_arguments_error (message);
- }
- // TODO implement
- rv = FALSE;
- reply = dbus_message_new_method_return (message);
- if (reply)
- {
- dbus_message_append_args (reply, DBUS_TYPE_BOOLEAN, &rv,
- DBUS_TYPE_INVALID);
- }
- return reply;
-}
-
-static DBusMessage *
impl_copyText (DBusConnection * bus, DBusMessage * message, void *user_data)
{
AtkEditableText *editable = (AtkEditableText *) user_data;
@@ -233,7 +202,6 @@ impl_pasteText (DBusConnection * bus, DBusMessage * message, void *user_data)
static DRouteMethod methods[] = {
{impl_setTextContents, "setTextContents"},
{impl_insertText, "insertText"},
- {impl_setAttributes, "setAttributes"},
{impl_copyText, "copyText"},
{impl_cutText, "cutText"},
{impl_deleteText, "deleteText"},
diff --git a/pyatspi/Makefile.am b/pyatspi/Makefile.am
index 0520b38..cd4e6f8 100644
--- a/pyatspi/Makefile.am
+++ b/pyatspi/Makefile.am
@@ -26,9 +26,7 @@ pyatspi_PYTHON = \
relation.py \
role.py \
selection.py \
- selector.py \
state.py \
- streamablecontent.py \
table.py \
text.py \
utils.py \
diff --git a/pyatspi/accessible.py b/pyatspi/accessible.py
index 549f022..ab590bf 100644
--- a/pyatspi/accessible.py
+++ b/pyatspi/accessible.py
@@ -140,7 +140,7 @@ class Accessible(BaseProxy):
with each string comprising an name-value pair format 'name:value'.
"""
func = self.get_dbus_method("getAttributes", dbus_interface=ATSPI_ACCESSIBLE)
- return func()
+ return [key + ':' + value for key, value in func().iteritems()]
def getChildAtIndex(self, index):
"""
@@ -224,7 +224,7 @@ class Accessible(BaseProxy):
point to the same object.
"""
return (self._app_name == accessible._app_name) and \
- (self._acc_path == accessible._acc_path)
+ (self._acc_path == accessible._acc_path)
def get_childCount(self):
diff --git a/pyatspi/accessiblecache.py b/pyatspi/accessiblecache.py
index 37dbe96..747747a 100644
--- a/pyatspi/accessiblecache.py
+++ b/pyatspi/accessiblecache.py
@@ -118,7 +118,7 @@ class AccessibleCache(object):
self._bus_name,
"org.freedesktop.atspi.Event.Object",
"property-change",
- ("name", 0, 0, newdata.name))
+ ("accessible-name", 0, 0, newdata.name))
self._registry._notifyNameChange(event)
if olddata.description != newdata.description:
@@ -127,7 +127,7 @@ class AccessibleCache(object):
self._bus_name,
"org.freedesktop.atspi.Event.Object",
"property-change",
- ("description", 0, 0, description))
+ ("accessible-description", 0, 0, description))
self._registry._notifyDescriptionChange(event)
if olddata.parent != newdata.parent:
@@ -136,7 +136,7 @@ class AccessibleCache(object):
self._bus_name,
"org.freedesktop.atspi.Event.Object",
"property-change",
- ("parent", 0, 0, ""))
+ ("accessible-parent", 0, 0, ""))
self._registry._notifyParentChange(event)
removed, added = _list_items_added_removed (olddata.children, newdata.children)
diff --git a/pyatspi/action.py b/pyatspi/action.py
index 796e6a2..f3489d7 100644
--- a/pyatspi/action.py
+++ b/pyatspi/action.py
@@ -16,12 +16,16 @@ from interfaces import *
from accessible import Accessible
from factory import accessible_factory
+import dbus
+
__all__ = [
"Action",
]
#------------------------------------------------------------------------------
+#TODO Perhaps use the 'getActions' method to reduce round-trips.
+
class Action(Accessible):
"""
An interface through which a user-actionable user interface component
@@ -85,15 +89,13 @@ class Action(Accessible):
return func(index)
def get_nActions(self):
- return self._pgetter(self._dbus_interface, "nActions")
- def set_nActions(self, value):
- self._psetter(self._dbus_interface, "nActions", value)
+ return dbus.Int32(self._pgetter(self._dbus_interface, "nActions"))
_nActionsDoc = \
"""
nActions: a long containing the number of actions this object
supports.
"""
- nActions = property(fget=get_nActions, fset=set_nActions, doc=_nActionsDoc)
+ nActions = property(fget=get_nActions, doc=_nActionsDoc)
# Register the accessible class with the factory.
accessible_factory.register_accessible_class(ATSPI_ACTION, Action)
diff --git a/pyatspi/application.py b/pyatspi/application.py
index a72693b..ca126fe 100644
--- a/pyatspi/application.py
+++ b/pyatspi/application.py
@@ -16,6 +16,8 @@ from interfaces import *
from factory import accessible_factory
from accessible import Accessible
+import dbus
+
__all__ = [
"Application",
]
@@ -30,7 +32,7 @@ class Application(Accessible):
windows.
"""
- def getLocale(self, *args, **kwargs):
+ def getLocale(self, locale_type):
"""
Gets the locale in which the application is currently operating.
For the current message locale, use lctype LOCALE_TYPE_MESSAGES.
@@ -40,85 +42,25 @@ class Application(Accessible):
description.
"""
func = self.get_dbus_method("getLocale", dbus_interface=ATSPI_APPLICATION)
- return func(*args, **kwargs)
-
- def pause(self, *args, **kwargs):
- """
- Request that the application temporarily stop sending events.
- In most cases this should pause the application's main event
- loop.
- @return : true if the request succeeded, false otherwise.
- """
- func = self.get_dbus_method("pause", dbus_interface=ATSPI_APPLICATION)
- return func(*args, **kwargs)
-
- def registerObjectEventListener(self, *args, **kwargs):
- """
- registerObjectEventListener:
- @param : listener
- an EventListener object which will receive the requested events
- @param : eventName
- a UTF-8 string indicating the type of (toolkit-specific) event
- being requested. Register with this application toolkit for "Accessibility::Accessible"
- event notifications.
- """
- func = self.get_dbus_method("registerObjectEventListener", dbus_interface=ATSPI_APPLICATION)
- return func(*args, **kwargs)
-
- def registerToolkitEventListener(self, *args, **kwargs):
- """
- @param : listener
- an EventListener object which will receive the requested events
- from the application's toolkits via toolit 'bridges'
- @param : eventName
- a UTF-8 string indicating the type of (toolkit-specific) event
- being requested. Not all applications can generate toolkit events
- of a given type.
- Register with this application's toolkit for "toolkit-specific"
- event notifications.
- """
- func = self.get_dbus_method("registerToolkitEventListener", dbus_interface=ATSPI_APPLICATION)
- return func(*args, **kwargs)
-
- def resume(self, *args, **kwargs):
- """
- Request that the application resume sending events.
- @return : True if the request succeeded, False otherwise.
- """
- func = self.get_dbus_method("resume", dbus_interface=ATSPI_APPLICATION)
- return func(*args, **kwargs)
-
- def get_id(self):
- return self._pgetter(self._dbus_interface, "id")
- def set_id(self, value):
- self._psetter(self._dbus_interface, "id", value)
- _idDoc = \
- """
- The application instance's unique ID as assigned by the registry.
- """
- id = property(fget=get_id, fset=set_id, doc=_idDoc)
+ return func(local_type)
def get_toolkitName(self):
- return self._pgetter(self._dbus_interface, "toolkitName")
- def set_toolkitName(self, value):
- self._psetter(self._dbus_interface, "toolkitName", value)
+ return dbus.String(self._pgetter(self._dbus_interface, "toolkitName"))
_toolkitNameDoc = \
"""
A string indicating the type of user interface toolkit which
is used by the application.
"""
- toolkitName = property(fget=get_toolkitName, fset=set_toolkitName, doc=_toolkitNameDoc)
+ toolkitName = property(fget=get_toolkitName, doc=_toolkitNameDoc)
def get_version(self):
- return self._pgetter(self._dbus_interface, "version")
- def set_version(self, value):
- self._psetter(self._dbus_interface, "version", value)
+ return dbus.String(self._pgetter(self._dbus_interface, "version"))
_versionDoc = \
"""
A string indicating the version number of the application's accessibility
bridge implementation.
"""
- version = property(fget=get_version, fset=set_version, doc=_versionDoc)
+ version = property(fget=get_version, doc=_versionDoc)
# Register the accessible class with the factory.
accessible_factory.register_accessible_class(ATSPI_APPLICATION, Application)
diff --git a/pyatspi/base.py b/pyatspi/base.py
index 37faf2c..9a675d5 100644
--- a/pyatspi/base.py
+++ b/pyatspi/base.py
@@ -23,6 +23,7 @@ __all__ = [
"AccessibleObjectNotAvailable",
"Enum",
"BaseProxy",
+ "_repack_tuple",
]
class AccessibleObjectNoLongerExists(Exception):
@@ -33,6 +34,14 @@ class AccessibleObjectNotAvailable(Exception):
#------------------------------------------------------------------------------
+def _repack_tuple (tup):
+ """
+ Re-packs a tuple moving the last element to the beginning.
+ """
+ return (tup[-1] ,) + tup[:-1]
+
+#------------------------------------------------------------------------------
+
class Enum(dbus.UInt32):
def __str__(self):
return self._enum_lookup[int(self)]
diff --git a/pyatspi/component.py b/pyatspi/component.py
index cd606db..dc8fc45 100644
--- a/pyatspi/component.py
+++ b/pyatspi/component.py
@@ -17,7 +17,7 @@ from base import Enum
from factory import accessible_factory
from accessible import BoundingBox, Accessible
-from dbus.types import Int16
+from dbus.types import UInt32
__all__ = [
"CoordType",
@@ -87,32 +87,24 @@ class Component(Accessible):
purposes of this interface.
"""
- def contains(self, *args, **kwargs):
+ def contains(self, x, y, coord_type):
"""
@return True if the specified point lies within the Component's
bounding box, False otherwise.
"""
func = self.get_dbus_method("contains", dbus_interface=ATSPI_COMPONENT)
- return func(*args, **kwargs)
+ return func(x, y, coord_type)
- def deregisterFocusHandler(self, *args, **kwargs):
- """
- Request that an EventListener registered via registerFocusHandler
- no longer be notified when this object receives keyboard focus.
- """
- func = self.get_dbus_method("deregisterFocusHandler", dbus_interface=ATSPI_COMPONENT)
- return func(*args, **kwargs)
-
- def getAccessibleAtPoint(self, *args, **kwargs):
+ def getAccessibleAtPoint(self, x, y, coord_type):
"""
@return the Accessible child whose bounding box contains the
specified point.
"""
- #TODO this needs a real implementation
+ #TODO Need to return an actual accessible object rather than a random string.
func = self.get_dbus_method("getAccessibleAtPoint", dbus_interface=ATSPI_COMPONENT)
- return func(*args, **kwargs)
+ return func(x, y, coord_type)
- def getAlpha(self, *args, **kwargs):
+ def getAlpha(self):
"""
Obtain the alpha value of the component. An alpha value of 1.0
or greater indicates that the object is fully opaque, and an
@@ -120,7 +112,7 @@ class Component(Accessible):
Negative alpha values have no defined meaning at this time.
"""
func = self.get_dbus_method("getAlpha", dbus_interface=ATSPI_COMPONENT)
- return func(*args, **kwargs)
+ return func()
def getExtents(self, coord_type):
"""
@@ -131,15 +123,15 @@ class Component(Accessible):
visual representation.
"""
func = self.get_dbus_method("getExtents", dbus_interface=ATSPI_COMPONENT)
- extents = func(Int16(coord_type))
+ extents = func(UInt32(coord_type))
return BoundingBox(*extents)
- def getLayer(self, *args, **kwargs):
+ def getLayer(self):
"""
@return the ComponentLayer in which this object resides.
"""
func = self.get_dbus_method("getLayer", dbus_interface=ATSPI_COMPONENT)
- return ComponentLayer(func(*args, **kwargs))
+ return ComponentLayer(func())
def getMDIZOrder(self):
"""
@@ -166,9 +158,9 @@ class Component(Accessible):
y coordinate.
"""
func = self.get_dbus_method("getPosition", dbus_interface=ATSPI_COMPONENT)
- return func(Int16(coord_type))
+ return func(UInt32(coord_type))
- def getSize(self, *args, **kwargs):
+ def getSize(self):
"""
Obtain the size, in the coordinate system specified by coord_type,
of the rectangular area which fully contains the object's visual
@@ -179,24 +171,16 @@ class Component(Accessible):
the object's vertical extents in the specified coordinate system.
"""
func = self.get_dbus_method("getSize", dbus_interface=ATSPI_COMPONENT)
- return func(*args, **kwargs)
+ return func()
- def grabFocus(self, *args, **kwargs):
+ def grabFocus(self):
"""
Request that the object obtain keyboard focus.
@return True if keyboard focus was successfully transferred to
the Component.
"""
func = self.get_dbus_method("grabFocus", dbus_interface=ATSPI_COMPONENT)
- return func(*args, **kwargs)
-
- def registerFocusHandler(self, *args, **kwargs):
- """
- Register an EventListener for notification when this object receives
- keyboard focus.
- """
- func = self.get_dbus_method("registerFocusHandler", dbus_interface=ATSPI_COMPONENT)
- return func(*args, **kwargs)
+ return func()
# Register the accessible class with the factory.
accessible_factory.register_accessible_class(ATSPI_COMPONENT, Component)
diff --git a/pyatspi/desktop.py b/pyatspi/desktop.py
index eb26ae0..3f5aac7 100644
--- a/pyatspi/desktop.py
+++ b/pyatspi/desktop.py
@@ -51,13 +51,6 @@ class DesktopComponent(object):
"""
return False
- def deregisterFocusHandler(self, *args, **kwargs):
- """
- Request that an EventListener registered via registerFocusHandler
- no longer be notified when this object receives keyboard focus.
- """
- pass
-
def getAccessibleAtPoint(self, *args, **kwargs):
"""
@return the Accessible child whose bounding box contains the
@@ -137,13 +130,6 @@ class DesktopComponent(object):
"""
return False
- def registerFocusHandler(self, *args, **kwargs):
- """
- Register an EventListener for notification when this object receives
- keyboard focus.
- """
- pass
-
#------------------------------------------------------------------------------
class Desktop(object):
diff --git a/pyatspi/deviceevent.py b/pyatspi/deviceevent.py
index b644224..472bc92 100644
--- a/pyatspi/deviceevent.py
+++ b/pyatspi/deviceevent.py
@@ -174,6 +174,7 @@ class DeviceEvent(list):
@return: Event description
@rtype: string
"""
+ import constants
if self.type == constants.KEY_PRESSED_EVENT:
kind = 'pressed'
elif self.type == constants.KEY_RELEASED_EVENT:
@@ -469,6 +470,7 @@ class KeyboardDeviceEventListener(_service.Object):
self._upath = self._get_unique_path()
_service.Object.__init__(self, registry._bus, self._upath)
self.mode = EventListenerMode(synchronous, preemptive, global_)
+ self._registry = registry
def register(self, dc, key_set, mask, kind):
"""
@@ -535,7 +537,13 @@ class KeyboardDeviceEventListener(_service.Object):
@rtype: boolean
"""
# wrap the device event
- ev = event.DeviceEvent(ev)
- return self.registry.handleDeviceEvent(ev, self)
+ event = DeviceEvent(ev)
+ # TODO Find out where the exceptions are falling in to.
+ try:
+ return self._registry.handleDeviceEvent(event, self)
+ except Exception, e:
+ import traceback
+ traceback.print_exe()
+ return False
#END---------------------------------------------------------------------------
diff --git a/pyatspi/document.py b/pyatspi/document.py
index be256b6..038b1fd 100644
--- a/pyatspi/document.py
+++ b/pyatspi/document.py
@@ -33,7 +33,7 @@ class Document(Accessible):
as well.
"""
- def getAttributeValue(self, *args, **kwargs):
+ def getAttributeValue(self, key):
"""
Gets the value of a single attribute, if specified for the document
as a whole.
@@ -45,9 +45,9 @@ class Document(Accessible):
for the object.
"""
func = self.get_dbus_method("getAttributeValue", dbus_interface=ATSPI_DOCUMENT)
- return func(*args, **kwargs)
+ return func(key)
- def getAttributes(self, *args, **kwargs):
+ def getAttributes(self):
"""
Gets all attributes specified for a document as a whole. For
attributes which change within the document content, see Accessibility::Text::getAttributes
@@ -56,9 +56,9 @@ class Document(Accessible):
as name-value pairs.
"""
func = self.get_dbus_method("getAttributes", dbus_interface=ATSPI_DOCUMENT)
- return func(*args, **kwargs)
+ return [key + ':' + value for key, value in func().values()]
- def getLocale(self, *args, **kwargs):
+ def getLocale(self):
"""
Gets the locale associated with the document's content. e.g.
the locale for LOCALE_TYPE_MESSAGES.
@@ -66,7 +66,7 @@ class Document(Accessible):
description.
"""
func = self.get_dbus_method("getLocale", dbus_interface=ATSPI_DOCUMENT)
- return func(*args, **kwargs)
+ return func()
# Register the accessible class with the factory.
accessible_factory.register_accessible_class(ATSPI_DOCUMENT, Document)
diff --git a/pyatspi/editabletext.py b/pyatspi/editabletext.py
index 8c9d6a9..23cdf48 100644
--- a/pyatspi/editabletext.py
+++ b/pyatspi/editabletext.py
@@ -30,7 +30,7 @@ class EditableText(Text):
cutText, and pasteText.
"""
- def copyText(self, *args, **kwargs):
+ def copyText(self, start, end):
"""
Copy a range of text into the system clipboard.
@param : startPos
@@ -41,9 +41,9 @@ class EditableText(Text):
text being copied.
"""
func = self.get_dbus_method("copyText", dbus_interface=ATSPI_EDITABLE_TEXT)
- return func(*args, **kwargs)
+ return func(start, end)
- def cutText(self, *args, **kwargs):
+ def cutText(self, start, end):
"""
Excise a range of text from a Text object, copying it into the
system clipboard.
@@ -56,9 +56,9 @@ class EditableText(Text):
@return True if the text was successfully cut, False otherwise.
"""
func = self.get_dbus_method("cutText", dbus_interface=ATSPI_EDITABLE_TEXT)
- return func(*args, **kwargs)
+ return func(start, end)
- def deleteText(self, *args, **kwargs):
+ def deleteText(self, start, end):
"""
Excise a range of text from a Text object without copying it
into the system clipboard.
@@ -71,9 +71,9 @@ class EditableText(Text):
@return True if the text was successfully deleted, False otherwise.
"""
func = self.get_dbus_method("deleteText", dbus_interface=ATSPI_EDITABLE_TEXT)
- return func(*args, **kwargs)
+ return func(start, end)
- def insertText(self, *args, **kwargs):
+ def insertText(self, position, text, length):
"""
Insert new text contents into an existing text object at a given
location, while retaining the old contents.
@@ -91,9 +91,9 @@ class EditableText(Text):
otherwise.
"""
func = self.get_dbus_method("insertText", dbus_interface=ATSPI_EDITABLE_TEXT)
- return func(*args, **kwargs)
+ return func(position, text, length)
- def pasteText(self, *args, **kwargs):
+ def pasteText(self, position):
"""
Copy the text contents of the system clipboard, if any, into
a Text object, inserting it at a particular character offset.
@@ -103,18 +103,9 @@ class EditableText(Text):
object, False otherwise.
"""
func = self.get_dbus_method("pasteText", dbus_interface=ATSPI_EDITABLE_TEXT)
- return func(*args, **kwargs)
+ return func(position)
- def setAttributes(self, *args, **kwargs):
- """
- Apply a particular set of attributes to a range of text.
- @return True if the text attributes were successfully modified,
- False otherwise.
- """
- func = self.get_dbus_method("setAttributes", dbus_interface=ATSPI_EDITABLE_TEXT)
- return func(*args, **kwargs)
-
- def setTextContents(self, *args, **kwargs):
+ def setTextContents(self, contents):
"""
Replace the text contents with a new string, discarding the old
contents.
@@ -125,7 +116,7 @@ class EditableText(Text):
otherwise.
"""
func = self.get_dbus_method("setTextContents", dbus_interface=ATSPI_EDITABLE_TEXT)
- return func(*args, **kwargs)
+ return func(contents)
# Register the accessible class with the factory.
accessible_factory.register_accessible_class(ATSPI_EDITABLE_TEXT, EditableText)
diff --git a/pyatspi/event.py b/pyatspi/event.py
index ea416cb..948535f 100644
--- a/pyatspi/event.py
+++ b/pyatspi/event.py
@@ -88,7 +88,7 @@ class EventType(str):
@raise AttributeError: When the given event name is not a valid string
"""
stripped = name.strip(self._SEPARATOR)
- separated = stripped.split(self._SEPARATOR, 3)
+ separated = stripped.split(self._SEPARATOR, 3)
self._separated = _ELessList(separated)
self.klass = self._separated[0]
diff --git a/pyatspi/hyperlink.py b/pyatspi/hyperlink.py
index a57f646..c92eebd 100644
--- a/pyatspi/hyperlink.py
+++ b/pyatspi/hyperlink.py
@@ -16,6 +16,8 @@ from interfaces import *
from accessible import Accessible
from factory import accessible_factory
+import dbus
+
__all__ = [
"Hyperlink",
]
@@ -35,7 +37,7 @@ class Hyperlink(Accessible):
interface.
"""
- def getObject(self, *args, **kwargs):
+ def getObject(self, index):
"""
Gets the i'th object, (where i is an integer between 0 and Hyperlink::numAnchors
- 1, inclusive) associated with a Hyperlink. The objects returned
@@ -49,9 +51,9 @@ class Hyperlink(Accessible):
ith anchor can be accessed.
"""
func = self.get_dbus_method("getObject", dbus_interface=ATSPI_HYPERLINK)
- return func(*args, **kwargs)
+ return func(index)
- def getURI(self, *args, **kwargs):
+ def getURI(self, index):
"""
Obtain a resource locator ('URI') which can be used to access
the content to which this link "points" or is connected.
@@ -59,9 +61,9 @@ class Hyperlink(Accessible):
'ith' anchor, if one exists, or a NIL string otherwise.
"""
func = self.get_dbus_method("getURI", dbus_interface=ATSPI_HYPERLINK)
- return func(*args, **kwargs)
+ return func(index)
- def isValid(self, *args, **kwargs):
+ def isValid(self):
"""
Check the hyperlink to see if a connection to its backing content
can be established, or if its URI is valid.
@@ -70,12 +72,10 @@ class Hyperlink(Accessible):
can not be established.
"""
func = self.get_dbus_method("isValid", dbus_interface=ATSPI_HYPERLINK)
- return func(*args, **kwargs)
+ return func()
def get_endIndex(self):
- return self._pgetter(self._dbus_interface, "endIndex")
- def set_endIndex(self, value):
- self._psetter(self._dbus_interface, "endIndex", value)
+ return dbus.Int32(self._pgetter(self._dbus_interface, "endIndex"))
_endIndexDoc = \
"""
the ending offset within the containing Hypertext content with
@@ -83,28 +83,24 @@ class Hyperlink(Accessible):
first element past the range within the Hypertext associated
with this Hyperlink.
"""
- endIndex = property(fget=get_endIndex, fset=set_endIndex, doc=_endIndexDoc)
+ endIndex = property(fget=get_endIndex, doc=_endIndexDoc)
def get_nAnchors(self):
- return self._pgetter(self._dbus_interface, "nAnchors")
- def set_nAnchors(self, value):
- self._psetter(self._dbus_interface, "nAnchors", value)
+ return dbus.Int16(self._pgetter(self._dbus_interface, "nAnchors"))
_nAnchorsDoc = \
"""
the number of separate anchors associated with this Hyperlink
"""
- nAnchors = property(fget=get_nAnchors, fset=set_nAnchors, doc=_nAnchorsDoc)
+ nAnchors = property(fget=get_nAnchors, doc=_nAnchorsDoc)
def get_startIndex(self):
- return self._pgetter(self._dbus_interface, "startIndex")
- def set_startIndex(self, value):
- self._psetter(self._dbus_interface, "startIndex", value)
+ return dbus.Int32(self._pgetter(self._dbus_interface, "startIndex"))
_startIndexDoc = \
"""
the starting offset within the containing Hypertext content with
which this Hyperlink is associated
"""
- startIndex = property(fget=get_startIndex, fset=set_startIndex, doc=_startIndexDoc)
+ startIndex = property(fget=get_startIndex, doc=_startIndexDoc)
# Register the accessible class with the factory.
accessible_factory.register_accessible_class(ATSPI_HYPERLINK, Hyperlink)
diff --git a/pyatspi/hypertext.py b/pyatspi/hypertext.py
index 27aebff..c8a1a84 100644
--- a/pyatspi/hypertext.py
+++ b/pyatspi/hypertext.py
@@ -31,7 +31,7 @@ class Hypertext(Accessible):
offsets within the Hypertext's included content.
"""
- def getLink(self, *args, **kwargs):
+ def getLink(self, index):
"""
Get one of the Hyperlinks associated with this Hypertext object,
by index.
@@ -40,9 +40,10 @@ class Hypertext(Accessible):
@return the Hyperlink in this Hypertext object.
"""
func = self.get_dbus_method("getLink", dbus_interface=ATSPI_HYPERTEXT)
- return func(*args, **kwargs)
+ #TODO Lookup the accessible object and call queryHyperlink on it.
+ return func(index)
- def getLinkIndex(self, *args, **kwargs):
+ def getLinkIndex(self, character_index):
"""
Get the hyperlink index, if any, associated with a particular
character offset in the Hypertext object. For Hypertext implementors
@@ -53,16 +54,16 @@ class Hypertext(Accessible):
that character offset.
"""
func = self.get_dbus_method("getLinkIndex", dbus_interface=ATSPI_HYPERTEXT)
- return func(*args, **kwargs)
+ return func(character_index)
- def getNLinks(self, *args, **kwargs):
+ def getNLinks(self):
"""
Query the hypertext object for the number of Hyperlinks it contains.
@return the number of Hyperlinks associated with this Hypertext
object, as a long integer.
"""
func = self.get_dbus_method("getNLinks", dbus_interface=ATSPI_HYPERTEXT)
- return func(*args, **kwargs)
+ return func()
# Register the accessible class with the factory.
accessible_factory.register_accessible_class(ATSPI_HYPERTEXT, Hypertext)
diff --git a/pyatspi/image.py b/pyatspi/image.py
index 49c4095..f09f09b 100644
--- a/pyatspi/image.py
+++ b/pyatspi/image.py
@@ -51,7 +51,7 @@ class Image(Accessible):
func = self.get_dbus_method("getImageExtents", dbus_interface=ATSPI_IMAGE)
return BoundingBox(*func(dbus.Int16(coordType)))
- def getImagePosition(self, *args, **kwargs):
+ def getImagePosition(self, coord_type):
"""
Get the coordinates of the current image position on screen.
@param : x
@@ -66,9 +66,9 @@ class Image(Accessible):
window.
"""
func = self.get_dbus_method("getImagePosition", dbus_interface=ATSPI_IMAGE)
- return func(*args, **kwargs)
+ return func(coord_type)
- def getImageSize(self, *args, **kwargs):
+ def getImageSize(self):
"""
Obtain the width and height of the current onscreen view of the
image. The extents returned do not account for any viewport clipping
@@ -82,29 +82,25 @@ class Image(Accessible):
image height in pixels)
"""
func = self.get_dbus_method("getImageSize", dbus_interface=ATSPI_IMAGE)
- return func(*args, **kwargs)
+ return func()
def get_imageDescription(self):
- return self._pgetter(self._dbus_interface, "imageDescription")
- def set_imageDescription(self, value):
- self._psetter(self._dbus_interface, "imageDescription", value)
+ return dbus.String(self._pgetter(self._dbus_interface, "imageDescription"))
_imageDescriptionDoc = \
"""
A UTF-8 string providing a textual description of what is visually
depicted in the image.
"""
- imageDescription = property(fget=get_imageDescription, fset=set_imageDescription, doc=_imageDescriptionDoc)
+ imageDescription = property(fget=get_imageDescription, doc=_imageDescriptionDoc)
def get_imageLocale(self):
- return self._pgetter(self._dbus_interface, "imageLocale")
- def set_imageLocale(self, value):
- self._psetter(self._dbus_interface, "imageLocale", value)
+ return dbus.String(self._pgetter(self._dbus_interface, "imageLocale"))
_imageLocaleDoc = \
"""
A string corresponding to the POSIX LC_MESSAGES locale used by
the imageDescription.
"""
- imageLocale = property(fget=get_imageLocale, fset=set_imageLocale, doc=_imageLocaleDoc)
+ imageLocale = property(fget=get_imageLocale, doc=_imageLocaleDoc)
# Register the accessible class with the factory.
accessible_factory.register_accessible_class(ATSPI_IMAGE, Image)
diff --git a/pyatspi/registry.py b/pyatspi/registry.py
index 8dc2036..db374fa 100644
--- a/pyatspi/registry.py
+++ b/pyatspi/registry.py
@@ -349,6 +349,7 @@ class _Registry(object):
AT-SPI is in the foreground? (requires xevie)
@type global_: boolean
"""
+ """
try:
# see if we already have an observer for this client
ob = self.deviceClients[client]
@@ -363,6 +364,8 @@ class _Registry(object):
mask = utils.allModifiers()
# register for new keystrokes on the observer
ob.register(self.dev, key_set, mask, kind)
+ """
+ pass
def deregisterKeystrokeListener(self,
client,
@@ -419,7 +422,7 @@ class _Registry(object):
"""
try:
# try to get the client registered for this event type
- client = self.clients[ob]
+ client = self.deviceClients[ob]
except KeyError:
# client may have unregistered recently, ignore event
return False
diff --git a/pyatspi/relation.py b/pyatspi/relation.py
index 4be9317..6d1ede0 100644
--- a/pyatspi/relation.py
+++ b/pyatspi/relation.py
@@ -116,6 +116,7 @@ class Relation(object):
"""
@return the RelationType of this Relation.
"""
+ # TODO Return a relation enum type
return self._type
def getRelationTypeName(self):
diff --git a/pyatspi/selection.py b/pyatspi/selection.py
index de665db..7b56b4a 100644
--- a/pyatspi/selection.py
+++ b/pyatspi/selection.py
@@ -16,6 +16,8 @@ from interfaces import *
from accessible import Accessible
from factory import accessible_factory
+import dbus
+
__all__ = [
"Selection",
]
@@ -33,7 +35,7 @@ class Selection(Accessible):
not programmatically selectable) has State::STATE_SELECTABLE.
"""
- def clearSelection(self, *args, **kwargs):
+ def clearSelection(self):
"""
Attempt to clear all selections (i.e. deselect all children)
of a Selection. Not all Selection implementations allow the removal
@@ -42,7 +44,7 @@ class Selection(Accessible):
otherwise.
"""
func = self.get_dbus_method("clearSelection", dbus_interface=ATSPI_SELECTION)
- return func(*args, **kwargs)
+ return func()
def deselectChild(self, *args, **kwargs):
"""
@@ -57,7 +59,7 @@ class Selection(Accessible):
func = self.get_dbus_method("deselectChild", dbus_interface=ATSPI_SELECTION)
return func(*args, **kwargs)
- def deselectSelectedChild(self, *args, **kwargs):
+ def deselectSelectedChild(self, index):
"""
Remove a child to the selected children list of a Selection.
@param : selectedChildIndex
@@ -69,9 +71,9 @@ class Selection(Accessible):
otherwise.
"""
func = self.get_dbus_method("deselectSelectedChild", dbus_interface=ATSPI_SELECTION)
- return func(*args, **kwargs)
+ return func(index)
- def getSelectedChild(self, *args, **kwargs):
+ def getSelectedChild(self, index):
"""
Get the i-th selected Accessible child of a Selection.
@param : selectedChildIndex
@@ -81,9 +83,11 @@ class Selection(Accessible):
by selectedChildIndex.
"""
func = self.get_dbus_method("getSelectedChild", dbus_interface=ATSPI_SELECTION)
- return func(*args, **kwargs)
+ return self._cache.create_accessible(self._app_name,
+ func(index),
+ interfaces.ATSPI_ACCESSIBLE)
- def isChildSelected(self, *args, **kwargs):
+ def isChildSelected(self, index):
"""
Determine whether a particular child of an Selection implementor
is currently selected. Note that childIndex is the zero-offset
@@ -94,9 +98,9 @@ class Selection(Accessible):
otherwise.
"""
func = self.get_dbus_method("isChildSelected", dbus_interface=ATSPI_SELECTION)
- return func(*args, **kwargs)
+ return func(index)
- def selectAll(self, *args, **kwargs):
+ def selectAll(self):
"""
Attempt to select all of the children of a Selection implementor.
Not all Selection implementors support this operation (for instance,
@@ -105,9 +109,9 @@ class Selection(Accessible):
@return True if successful, False otherwise.
"""
func = self.get_dbus_method("selectAll", dbus_interface=ATSPI_SELECTION)
- return func(*args, **kwargs)
+ return func()
- def selectChild(self, *args, **kwargs):
+ def selectChild(self, index):
"""
Add a child to the selected children list of a Selection.
@param : childIndex
@@ -116,18 +120,16 @@ class Selection(Accessible):
@return True if the child was successfully selected, False otherwise.
"""
func = self.get_dbus_method("selectChild", dbus_interface=ATSPI_SELECTION)
- return func(*args, **kwargs)
+ return func(index)
def get_nSelectedChildren(self):
- return self._pgetter(self._dbus_interface, "nSelectedChildren")
- def set_nSelectedChildren(self, value):
- self._psetter(self._dbus_interface, "nSelectedChildren", value)
+ return dbus.Int32(self._pgetter(self._dbus_interface, "nSelectedChildren"))
_nSelectedChildrenDoc = \
"""
The number of children of a Selection implementor which are currently
selected.
"""
- nSelectedChildren = property(fget=get_nSelectedChildren, fset=set_nSelectedChildren, doc=_nSelectedChildrenDoc)
+ nSelectedChildren = property(fget=get_nSelectedChildren, doc=_nSelectedChildrenDoc)
# Register the accessible class with the factory.
accessible_factory.register_accessible_class(ATSPI_SELECTION, Selection)
diff --git a/pyatspi/selector.py b/pyatspi/selector.py
deleted file mode 100644
index a4916c0..0000000
--- a/pyatspi/selector.py
+++ /dev/null
@@ -1,169 +0,0 @@
-#Copyright (C) 2008 Codethink Ltd
-
-#This library is free software; you can redistribute it and/or
-#modify it under the terms of the GNU Lesser General Public
-#License version 2 as published by the Free Software Foundation.
-
-#This program is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-#GNU General Public License for more details.
-#You should have received a copy of the GNU Lesser General Public License
-#along with this program; if not, write to the Free Software
-#Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-from interfaces import *
-from base import BaseProxy, Enum
-from accessible import Accessible
-from factory import accessible_factory
-
-__all__ = [
- "Selector",
- "Command",
- "CommandListener",
- ]
-
-#------------------------------------------------------------------------------
-
-class Command(list):
- def __new__(cls, name, id):
- list.__new__(cls, (name, id))
- def __init__(self, name, id):
- list.__init__(self, (name, id))
-
- def _get_name(self):
- return self[0]
- def _set_name(self, val):
- self[0] = val
- name = property(fget=_get_name, fset=_set_name)
- def _get_id(self):
- return self[1]
- def _set_id(self, val):
- self[1] = val
- id = property(fget=_get_id, fset=_set_id)
-
-#------------------------------------------------------------------------------
-
-class CommandListener(BaseProxy):
- """
- An interface which should be implemented by assistive technologies
- or other clients of the Selector interface, over which notifications
- to the list of available commands is made. The notifyCommands()
- method of the client is then called by the Selector instance.
- """
- def notifyCommands(self, *args, **kwargs):
- """
- Notify the CommandListener instance of changes to the currently
- available commands, by sending the current CommandList.
- @param : commands
- The newly-available list of Command objects which may be invoked
- by the listener.
- """
- func = self.get_dbus_method("notifyCommands", dbus_interface=ATSPI_COMMAND_LISTENER)
- return func(*args, **kwargs)
-
-#------------------------------------------------------------------------------
-
-class Selector(Accessible):
- """
- This interface is intended for use by assistive technologies
- and related user-agents. Via this interface, an assistive technology
- or user agent may expose a series of choices or selections in
- textual form, which can be activated on demand by a client of
- the Selector interface.
- Examples of the use of this interface include voice-command and
- remote-control applications, in which the user interaction is
- wholly or partly delegated by the implementor to an external
- agent.
- """
-
- def activateCommand(self, *args, **kwargs):
- """
- Request that the Selector invoke the specified Command.
- @param : cmd
- the Command to activate/invoke.
- @return a CommandResult indicating whether the request was honored,
- and the reason for failure if the Command could not be activated
- or invoked.
- """
- func = self.get_dbus_method("activateCommand", dbus_interface=ATSPI_SELECTOR)
- return func(*args, **kwargs)
-
- def deregisterChangeListener(self, *args, **kwargs):
- """
- Tell the Selector instance to cease notifying the specified CommandListener
- of changes to the command list.
- @param : listener
- the CommandListener to remove from the notification list.
- """
- func = self.get_dbus_method("deregisterChangeListener", dbus_interface=ATSPI_SELECTOR)
- return func(*args, **kwargs)
-
- def getCommands(self, *args, **kwargs):
- """
- Query the Selector for the current CommandList.
- @return the currently available CommandList
- """
- func = self.get_dbus_method("getCommands", dbus_interface=ATSPI_SELECTOR)
- return func(*args, **kwargs)
-
- def refreshCommands(self, *args, **kwargs):
- """
- Ask the Selector to re-calculate its CommandList.
- @return TRUE if the CommandList changed.
- """
- func = self.get_dbus_method("refreshCommands", dbus_interface=ATSPI_SELECTOR)
- return func(*args, **kwargs)
-
- def registerChangeListener(self, *args, **kwargs):
- """
- Register a :CommandListener instance for notification of changes
- to the command set.
- @param : listener
- the CommandListener to be notified of changes.
- """
- func = self.get_dbus_method("registerChangeListener", dbus_interface=ATSPI_SELECTOR)
- return func(*args, **kwargs)
-
- def replaceCommands(self, *args, **kwargs):
- """
- @return TRUE if the replacement request was successful, FALSE
- if the request could not be honored.
- """
- func = self.get_dbus_method("replaceCommands", dbus_interface=ATSPI_SELECTOR)
- return func(*args, **kwargs)
-
- def get_supportsReplace(self):
- return self._pgetter(self._dbus_interface, "supportsReplace")
- def set_supportsReplace(self, value):
- self._psetter(self._dbus_interface, "supportsReplace", value)
- _supportsReplaceDoc = \
- """
- This attribute is TRUE if this Selector allows its CommandList
- to be specified by the client
- """
- supportsReplace = property(fget=get_supportsReplace, fset=set_supportsReplace, doc=_supportsReplaceDoc)
-
- class CommandResult(Enum):
- """
- A code returned by a call to activateCommand, indicating the
- result of the activation request.
- """
- _enum_lookup = {
- 0:'COMMAND_RESULT_INVALID',
- 1:'COMMAND_RESULT_SUCCESS',
- 2:'COMMAND_RESULT_FAILED',
- 3:'COMMAND_RESULT_OBSOLETE',
- 4:'COMMAND_RESULT_LAST_DEFINED',
- }
-
- COMMAND_RESULT_FAILED = CommandResult(2)
- COMMAND_RESULT_INVALID = CommandResult(0)
- COMMAND_RESULT_LAST_DEFINED = CommandResult(4)
- COMMAND_RESULT_OBSOLETE = CommandResult(3)
- COMMAND_RESULT_SUCCESS = CommandResult(1)
-
-# Register the accessible class with the factory.
-accessible_factory.register_accessible_class(ATSPI_SELECTOR, Selector)
-
-#END----------------------------------------------------------------------------
diff --git a/pyatspi/streamablecontent.py b/pyatspi/streamablecontent.py
deleted file mode 100644
index 1a52bc4..0000000
--- a/pyatspi/streamablecontent.py
+++ /dev/null
@@ -1,148 +0,0 @@
-#Copyright (C) 2008 Codethink Ltd
-
-
-#modify it under the terms of the GNU Lesser General Public
-#License version 2 as published by the Free Software Foundation.
-
-#This program is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-#GNU General Public License for more details.
-#You should have received a copy of the GNU Lesser General Public License
-#along with this program; if not, write to the Free Software
-#Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-from interfaces import *
-from base import BaseProxy, Enum
-from accessible import Accessible
-from factory import accessible_factory
-
-__all__ = [
- "ContentStream",
- "StreamableContent",
- ]
-
-#------------------------------------------------------------------------------
-
-class ContentStream(BaseProxy):
- """
- An interface by which the requested data from a StreamableContent
- object may be read by the client.
- """
-
- def close(self, *args, **kwargs):
- """
- close the stream and release associated resources. A client should
- not perform further operations on a StreamableContent::Stream
- object after closing it.
- """
- func = self.get_dbus_method("close", dbus_interface=ATSPI_STREAMABLE_CONTENT)
- return func(*args, **kwargs)
-
- def read(self, *args, **kwargs):
- """
- Request/read a specified amount of data from a Stream.
- @return the number of bytes actually read into the client buffer.
- """
- func = self.get_dbus_method("read", dbus_interface=ATSPI_STREAMABLE_CONTENT)
- return func(*args, **kwargs)
-
- def seek(self, *args, **kwargs):
- """
- Seek to a specified position in the Stream.
- @param : offset
- an offset specifying the requested position in the stream, relative
- to the SeekType specified in whence.
- @param : whence
- a SeekType specifying the reference point from which the seek
- offset is calculated. Some forms of seek are not supported by
- certain implementations of Stream, in which case a NotSupported
- exception will be raised.
- @return the actual resulting offset, if no exception was raised.
- """
- func = self.get_dbus_method("seek", dbus_interface=ATSPI_STREAMABLE_CONTENT)
- return func(*args, **kwargs)
-
- class IOError(Exception):
- pass
-
- class NoPermission(Exception):
- pass
-
- class NotSupported(Exception):
- pass
-
- class SeekType(Enum):
- """
- Specifies the meaning of a seek 'offset'. Not all SeekTypes are
- supported by all StreamableContent data sources, for instance
- some streams may not support seeking from the beginning or other
- types of 'backwards' seeks.
- """
- _enum_lookup = {
- 0:'SEEK_SET',
- 1:'SEEK_CURRENT',
- 2:'SEEK_END',
- }
-
- SEEK_CURRENT = SeekType(1)
- SEEK_END = SeekType(2)
- SEEK_SET = SeekType(0)
-
-#------------------------------------------------------------------------------
-
-class StreamableContent(Accessible):
- """
- An interface whereby an object allows its backing content to
- be streamed to clients. Negotiation of content type is allowed.
- Clients may examine the backing data and transform, convert,
- or parse the content in order to present it in an alternate form
- to end-users.
- """
-
- def getContent(self, *args, **kwargs):
- """
- DEPRECATED, use getStream instead.
- """
- func = self.get_dbus_method("getContent", dbus_interface=ATSPI_STREAMABLE_CONTENT)
- return func(*args, **kwargs)
-
- def getContentTypes(self, *args, **kwargs):
- """
- getContentTypes:
- @return the list of available mimetypes for this object's content.
- """
- func = self.get_dbus_method("getContentTypes", dbus_interface=ATSPI_STREAMABLE_CONTENT)
- return func(*args, **kwargs)
-
- def getStream(self, *args, **kwargs):
- """
- Retrieve this object's content, in a format appropriate to a
- requested mimetype, as a ContentStream instance.
- @param : contentType
- a string specifying the desired mimetype for the content stream.
- @return a Stream whose mimetype matches contentType, if available,
- or NIL.
- """
- func = self.get_dbus_method("getStream", dbus_interface=ATSPI_STREAMABLE_CONTENT)
- return func(*args, **kwargs)
-
- def getURI(self, *args, **kwargs):
- """
- Get a URI pointing to the content of the specified type, if such
- a URI can be obtained. Not all streamable content providers have
- URI representations.
- @param : contentType
- a string specifying the desired mimetype for the content stream.
- If NULL, then a URI for the default content type will be returned,
- if available.
- @return a string which constitutes a URI for a stream of the
- specified content type, or NULL if no such URI can be obtained.
- """
- func = self.get_dbus_method("getURI", dbus_interface=ATSPI_STREAMABLE_CONTENT)
- return func(*args, **kwargs)
-
-# Register the accessible class with the factory.
-accessible_factory.register_accessible_class(ATSPI_STREAMABLE_CONTENT, StreamableContent)
-
-#END----------------------------------------------------------------------------
diff --git a/pyatspi/table.py b/pyatspi/table.py
index 7034e4d..80127a0 100644
--- a/pyatspi/table.py
+++ b/pyatspi/table.py
@@ -16,6 +16,8 @@ from interfaces import *
from accessible import Accessible
from factory import accessible_factory
+import dbus
+
__all__ = [
"Table",
]
@@ -38,7 +40,7 @@ class Table(Accessible):
as appropriate to their onscreen representation and/or behavior.
"""
- def addColumnSelection(self, *args, **kwargs):
+ def addColumnSelection(self, column):
"""
Select the specified column, adding it to the current column
selection, if the table's selection model permits it.
@@ -47,9 +49,9 @@ class Table(Accessible):
False if not.
"""
func = self.get_dbus_method("addColumnSelection", dbus_interface=ATSPI_TABLE)
- return func(*args, **kwargs)
+ return func(column)
- def addRowSelection(self, *args, **kwargs):
+ def addRowSelection(self, row):
"""
Select the specified row, adding it to the current row selection,
if the table's selection model permits it.
@@ -58,9 +60,9 @@ class Table(Accessible):
False if not.
"""
func = self.get_dbus_method("addRowSelection", dbus_interface=ATSPI_TABLE)
- return func(*args, **kwargs)
+ return func(row)
- def getAccessibleAt(self, *args, **kwargs):
+ def getAccessibleAt(self, row, column):
"""
Get the table cell at the specified row and column indices.
@param : row
@@ -70,10 +72,11 @@ class Table(Accessible):
@return an Accessible object representing the specified table
cell.
"""
+ #TODO Return an accessible object instead of a path.
func = self.get_dbus_method("getAccessibleAt", dbus_interface=ATSPI_TABLE)
- return func(*args, **kwargs)
+ return func(row, column)
- def getColumnAtIndex(self, *args, **kwargs):
+ def getColumnAtIndex(self, index):
"""
Get the table column index occupied by the child at a particular
1-D child index.
@@ -83,9 +86,9 @@ class Table(Accessible):
the child of a table, at the specified 1-D (zero-offset) index.
"""
func = self.get_dbus_method("getColumnAtIndex", dbus_interface=ATSPI_TABLE)
- return func(*args, **kwargs)
+ return func(index)
- def getColumnDescription(self, *args, **kwargs):
+ def getColumnDescription(self, column):
"""
Get a text description of a particular table column. This differs
from AccessibleTable_getColumnHeader, which returns an Accessible.
@@ -95,9 +98,9 @@ class Table(Accessible):
if available.
"""
func = self.get_dbus_method("getColumnDescription", dbus_interface=ATSPI_TABLE)
- return func(*args, **kwargs)
+ return func(column)
- def getColumnExtentAt(self, *args, **kwargs):
+ def getColumnExtentAt(self, row, column):
"""
Get the number of columns spanned by the table cell at the specific
row and column. (some tables can have cells which span multiple
@@ -110,9 +113,9 @@ class Table(Accessible):
by the specified cell.
"""
func = self.get_dbus_method("getColumnExtentAt", dbus_interface=ATSPI_TABLE)
- return func(*args, **kwargs)
+ return func(row, column)
- def getColumnHeader(self, *args, **kwargs):
+ def getColumnHeader(self, index):
"""
Get the header associated with a table column, if available,
as an instance of Accessible. This differs from getColumnDescription,
@@ -123,9 +126,10 @@ class Table(Accessible):
if available.
"""
func = self.get_dbus_method("getColumnHeader", dbus_interface=ATSPI_TABLE)
- return func(*args, **kwargs)
+ #TODO Return an accessible object
+ return func(index)
- def getIndexAt(self, *args, **kwargs):
+ def getIndexAt(self, row, column):
"""
Get the 1-D child index corresponding to the specified 2-D row
and column indices.
@@ -137,9 +141,9 @@ class Table(Accessible):
cell in the table, in a form usable by Accessible::getChildAtIndex.
"""
func = self.get_dbus_method("getIndexAt", dbus_interface=ATSPI_TABLE)
- return func(*args, **kwargs)
+ return func(row, column)
- def getRowAtIndex(self, *args, **kwargs):
+ def getRowAtIndex(self, index):
"""
Get the table row index occupied by the child at a particular
1-D child index.
@@ -149,9 +153,9 @@ class Table(Accessible):
child of a table, at the specified 1-D (zero-offset) index.
"""
func = self.get_dbus_method("getRowAtIndex", dbus_interface=ATSPI_TABLE)
- return func(*args, **kwargs)
+ return func(index)
- def getRowColumnExtentsAtIndex(self, *args, **kwargs):
+ def getRowColumnExtentsAtIndex(self, index):
"""
Given a child index, determine the row and column indices and
extents, and whether the cell is currently selected. If the child
@@ -188,9 +192,9 @@ class Table(Accessible):
returned, the values of the out parameters are undefined.
"""
func = self.get_dbus_method("getRowColumnExtentsAtIndex", dbus_interface=ATSPI_TABLE)
- return func(*args, **kwargs)
+ return func(index)
- def getRowDescription(self, *args, **kwargs):
+ def getRowDescription(self, index):
"""
Get a text description of a particular table row. This differs
from AccessibleTable_getRowHeader, which returns an Accessible.
@@ -200,9 +204,9 @@ class Table(Accessible):
available.
"""
func = self.get_dbus_method("getRowDescription", dbus_interface=ATSPI_TABLE)
- return func(*args, **kwargs)
+ return func(index)
- def getRowExtentAt(self, *args, **kwargs):
+ def getRowExtentAt(self, row, column):
"""
Get the number of rows spanned by the table cell at the specific
row and column. (some tables can have cells which span multiple
@@ -215,9 +219,9 @@ class Table(Accessible):
by the specified cell.
"""
func = self.get_dbus_method("getRowExtentAt", dbus_interface=ATSPI_TABLE)
- return func(*args, **kwargs)
+ return func(row, column)
- def getRowHeader(self, *args, **kwargs):
+ def getRowHeader(self, row):
"""
Get the header associated with a table row, if available. This
differs from getRowDescription, which returns a string.
@@ -227,27 +231,28 @@ class Table(Accessible):
if available.
"""
func = self.get_dbus_method("getRowHeader", dbus_interface=ATSPI_TABLE)
- return func(*args, **kwargs)
+ #TODO Return an accessible object
+ return func(row)
- def getSelectedColumns(self, *args, **kwargs):
+ def getSelectedColumns(self):
"""
Obtain the indices of all columns which are currently selected.
@return a sequence of integers comprising the indices of columns
currently selected.
"""
func = self.get_dbus_method("getSelectedColumns", dbus_interface=ATSPI_TABLE)
- return func(*args, **kwargs)
+ return func()
- def getSelectedRows(self, *args, **kwargs):
+ def getSelectedRows(self):
"""
Obtain the indices of all rows which are currently selected.
@return a sequence of integers comprising the indices of rows
currently selected.
"""
func = self.get_dbus_method("getSelectedRows", dbus_interface=ATSPI_TABLE)
- return func(*args, **kwargs)
+ return func()
- def isColumnSelected(self, *args, **kwargs):
+ def isColumnSelected(self, column):
"""
Determine whether a table column is selected.
@param : column
@@ -256,9 +261,9 @@ class Table(Accessible):
if not.
"""
func = self.get_dbus_method("isColumnSelected", dbus_interface=ATSPI_TABLE)
- return func(*args, **kwargs)
+ return func(column)
- def isRowSelected(self, *args, **kwargs):
+ def isRowSelected(self, row):
"""
Determine whether a table row is selected.
@param : row
@@ -267,9 +272,9 @@ class Table(Accessible):
if not.
"""
func = self.get_dbus_method("isRowSelected", dbus_interface=ATSPI_TABLE)
- return func(*args, **kwargs)
+ return func(row)
- def isSelected(self, *args, **kwargs):
+ def isSelected(self, row, column):
"""
Determine whether the cell at a specific row and column is selected.
@param : row
@@ -280,9 +285,9 @@ class Table(Accessible):
if not.
"""
func = self.get_dbus_method("isSelected", dbus_interface=ATSPI_TABLE)
- return func(*args, **kwargs)
+ return func(row, column)
- def removeColumnSelection(self, *args, **kwargs):
+ def removeColumnSelection(self, column):
"""
Remove the specified column from current column selection, if
the table's selection model permits it.
@@ -291,9 +296,9 @@ class Table(Accessible):
False if not.
"""
func = self.get_dbus_method("removeColumnSelection", dbus_interface=ATSPI_TABLE)
- return func(*args, **kwargs)
+ return func(column)
- def removeRowSelection(self, *args, **kwargs):
+ def removeRowSelection(self, row):
"""
Remove the specified row from current row selection, if the table's
selection model permits it.
@@ -302,22 +307,19 @@ class Table(Accessible):
False if not.
"""
func = self.get_dbus_method("removeRowSelection", dbus_interface=ATSPI_TABLE)
- return func(*args, **kwargs)
+ return func(row)
def get_caption(self):
+ #TODO Return an accessible object
return self._pgetter(self._dbus_interface, "caption")
- def set_caption(self, value):
- self._psetter(self._dbus_interface, "caption", value)
_captionDoc = \
"""
An Accessible which represents of a caption for a Table.
"""
- caption = property(fget=get_caption, fset=set_caption, doc=_captionDoc)
+ caption = property(fget=get_caption, doc=_captionDoc)
def get_nColumns(self):
- return self._pgetter(self._dbus_interface, "nColumns")
- def set_nColumns(self, value):
- self._psetter(self._dbus_interface, "nColumns", value)
+ return dbus.Int32(self._pgetter(self._dbus_interface, "nColumns"))
_nColumnsDoc = \
"""
The total number of columns in this table (including empty columns),
@@ -325,53 +327,46 @@ class Table(Accessible):
which are scrolled out of view or clipped by the current viewport
are included.
"""
- nColumns = property(fget=get_nColumns, fset=set_nColumns, doc=_nColumnsDoc)
+ nColumns = property(fget=get_nColumns, doc=_nColumnsDoc)
def get_nRows(self):
- return self._pgetter(self._dbus_interface, "nRows")
- def set_nRows(self, value):
- self._psetter(self._dbus_interface, "nRows", value)
+ return dbus.Int32(self._pgetter(self._dbus_interface, "nRows"))
_nRowsDoc = \
"""
The total number of rows in this table (including empty rows),
exclusive of any rows which are programmatically hidden. Rows
which are merely scrolled out of view are included.
"""
- nRows = property(fget=get_nRows, fset=set_nRows, doc=_nRowsDoc)
+ nRows = property(fget=get_nRows, doc=_nRowsDoc)
def get_nSelectedColumns(self):
- return self._pgetter(self._dbus_interface, "nSelectedColumns")
- def set_nSelectedColumns(self, value):
- self._psetter(self._dbus_interface, "nSelectedColumns", value)
+ return dbus.Int32(self._pgetter(self._dbus_interface, "nSelectedColumns"))
_nSelectedColumnsDoc = \
"""
The number of columns currently selected. A selected column is
one in which all included cells are selected.
"""
- nSelectedColumns = property(fget=get_nSelectedColumns, fset=set_nSelectedColumns, doc=_nSelectedColumnsDoc)
+ nSelectedColumns = property(fget=get_nSelectedColumns, doc=_nSelectedColumnsDoc)
def get_nSelectedRows(self):
- return self._pgetter(self._dbus_interface, "nSelectedRows")
- def set_nSelectedRows(self, value):
- self._psetter(self._dbus_interface, "nSelectedRows", value)
+ return dbus.Int32(self._pgetter(self._dbus_interface, "nSelectedRows"))
_nSelectedRowsDoc = \
"""
The number of rows currently selected. A selected row is one
in which all included cells are selected.
"""
- nSelectedRows = property(fget=get_nSelectedRows, fset=set_nSelectedRows, doc=_nSelectedRowsDoc)
+ nSelectedRows = property(fget=get_nSelectedRows, doc=_nSelectedRowsDoc)
def get_summary(self):
+ #TODO Return an accessible object
return self._pgetter(self._dbus_interface, "summary")
- def set_summary(self, value):
- self._psetter(self._dbus_interface, "summary", value)
_summaryDoc = \
"""
An accessible object which summarizes the contents of a Table.
This object is frequently itself a Table instance, albeit a simplified
one.
"""
- summary = property(fget=get_summary, fset=set_summary, doc=_summaryDoc)
+ summary = property(fget=get_summary, doc=_summaryDoc)
# Register the accessible class with the factory.
accessible_factory.register_accessible_class(ATSPI_TABLE, Table)
diff --git a/pyatspi/text.py b/pyatspi/text.py
index ef22f88..90a9240 100644
--- a/pyatspi/text.py
+++ b/pyatspi/text.py
@@ -16,7 +16,7 @@ import dbus
from interfaces import *
from accessible import Accessible
-from base import Enum
+from base import Enum, _repack_tuple
from factory import accessible_factory
__all__ = [
@@ -116,7 +116,7 @@ class Text(Accessible):
func = self.get_dbus_method("addSelection", dbus_interface=ATSPI_TEXT)
return func(*args, **kwargs)
- def getAttributeRun(self, *args, **kwargs):
+ def getAttributeRun(self, offset, startOffset, endOffset, includeDefaults):
"""
Query a particular text object for the text attributes defined
at a given offset, obtaining the start and end of the "attribute
@@ -166,7 +166,8 @@ class Text(Accessible):
the 'default' attributes.
"""
func = self.get_dbus_method("getAttributeRun", dbus_interface=ATSPI_TEXT)
- return func(*args, **kwargs)
+ attr = func(offset, startOffset, endOffset, includeDefaults)
+ return [key + ':' + value for key, value in attr.values()]
def getAttributeValue(self, *args, **kwargs):
"""
@@ -200,9 +201,10 @@ class Text(Accessible):
of colon-delimited name-value pairs.
"""
func = self.get_dbus_method("getAttributes", dbus_interface=ATSPI_TEXT)
- return func(dbus.Int32(offset))
+ return [key + ':' + value for key, value in func(dbus.Int32(offset)).values()]
def getBoundedRanges(self, *args, **kwargs):
+ #TODO Return a list of range structures
"""
Return the text content within a bounding box, as a list of Range
structures. Depending on the TEXT_CLIP_TYPE parameters, glyphs
@@ -276,7 +278,7 @@ class Text(Accessible):
func = self.get_dbus_method("getCharacterExtents", dbus_interface=ATSPI_TEXT)
return func(*args, **kwargs)
- def getDefaultAttributeSet(self, *args, **kwargs):
+ def getDefaultAttributeSet(self):
"""
Return an AttributeSet containing the text attributes which apply
to all text in the object by virtue of the default settings of
@@ -288,16 +290,16 @@ class Text(Accessible):
the default or implied text weight in the default AttributeSet.
"""
func = self.get_dbus_method("getDefaultAttributeSet", dbus_interface=ATSPI_TEXT)
- return func(*args, **kwargs)
+ return [key + ':' + value for key, value in func().values()]
- def getDefaultAttributes(self, *args, **kwargs):
+ def getDefaultAttributes(self):
"""
Deprecated in favor of getDefaultAttributeSet.
@return the attributes which apply to the entire text content,
but which were not explicitly specified by the content creator.
"""
func = self.get_dbus_method("getDefaultAttributes", dbus_interface=ATSPI_TEXT)
- return func(*args, **kwargs)
+ return [key + ':' + value for key, value in func().values()]
def getNSelections(self, *args, **kwargs):
"""
@@ -414,7 +416,7 @@ class Text(Accessible):
func = self.get_dbus_method("getTextAfterOffset", dbus_interface=ATSPI_TEXT)
return func(*args, **kwargs)
- def getTextAtOffset(self, *args, **kwargs):
+ def getTextAtOffset(self, offset, type):
"""
Obtain a subset of the text content of an object which includes
the specified offset, delimited by character, word, line, or
@@ -439,7 +441,7 @@ class Text(Accessible):
the object, delimited by the specified boundary condition.
"""
func = self.get_dbus_method("getTextAtOffset", dbus_interface=ATSPI_TEXT)
- return func(*args, **kwargs)
+ return _repack_tuple(func(offset, type))
def getTextBeforeOffset(self, *args, **kwargs):
"""
@@ -513,9 +515,7 @@ class Text(Accessible):
return func(*args, **kwargs)
def get_caretOffset(self):
- return self._pgetter(self._dbus_interface, "caretOffset")
- def set_caretOffset(self, value):
- self._psetter(self._dbus_interface, "caretOffset", value)
+ return dbus.Int32(self._pgetter(self._dbus_interface, "caretOffset"))
_caretOffsetDoc = \
"""
The current offset of the text caret in the Text object. This
@@ -525,18 +525,16 @@ class Text(Accessible):
as a character offset, as opposed to a byte offset into a text
buffer or a column offset.
"""
- caretOffset = property(fget=get_caretOffset, fset=set_caretOffset, doc=_caretOffsetDoc)
+ caretOffset = property(fget=get_caretOffset, doc=_caretOffsetDoc)
def get_characterCount(self):
- return self._pgetter(self._dbus_interface, "characterCount")
- def set_characterCount(self, value):
- self._psetter(self._dbus_interface, "characterCount", value)
+ return dbus.Int32(self._pgetter(self._dbus_interface, "characterCount"))
_characterCountDoc = \
"""
The total current number of characters in the Text object, including
whitespace and non-spacing characters.
"""
- characterCount = property(fget=get_characterCount, fset=set_characterCount, doc=_characterCountDoc)
+ characterCount = property(fget=get_characterCount, doc=_characterCountDoc)
class Range(list):
def __new__(cls, startOffset, endOffset, content, data):
diff --git a/pyatspi/utils.py b/pyatspi/utils.py
index fb7cfba..61cad1e 100644
--- a/pyatspi/utils.py
+++ b/pyatspi/utils.py
@@ -33,7 +33,7 @@ __all__ = [
"listInterfaces",
"stringToConst",
"stateToString",
- "stateToString",
+ "relationToString",
"allModifiers",
"findDescendant",
"findAllDescendants",
diff --git a/pyatspi/value.py b/pyatspi/value.py
index 32c51fe..121d5c8 100644
--- a/pyatspi/value.py
+++ b/pyatspi/value.py
@@ -16,6 +16,8 @@ from interfaces import *
from accessible import Accessible
from factory import accessible_factory
+import dbus
+
__all__ = [
"Value",
]
@@ -31,9 +33,9 @@ class Value(Accessible):
"""
def get_currentValue(self):
- return self._pgetter(self._dbus_interface, "currentValue")
+ return dbus.Double(self._pgetter(self._dbus_interface, "currentValue"))
def set_currentValue(self, value):
- self._psetter(self._dbus_interface, "currentValue", value)
+ self._psetter(self._dbus_interface, "currentValue", dbus.Double(value, variant_level=1))
_currentValueDoc = \
"""
The current value of the valuator.
@@ -41,36 +43,30 @@ class Value(Accessible):
currentValue = property(fget=get_currentValue, fset=set_currentValue, doc=_currentValueDoc)
def get_maximumValue(self):
- return self._pgetter(self._dbus_interface, "maximumValue")
- def set_maximumValue(self, value):
- self._psetter(self._dbus_interface, "maximumValue", value)
+ return dbus.Double(self._pgetter(self._dbus_interface, "maximumValue"))
_maximumValueDoc = \
"""
The maximum value allowed by this valuator.
"""
- maximumValue = property(fget=get_maximumValue, fset=set_maximumValue, doc=_maximumValueDoc)
+ maximumValue = property(fget=get_maximumValue, doc=_maximumValueDoc)
def get_minimumIncrement(self):
- return self._pgetter(self._dbus_interface, "minimumIncrement")
- def set_minimumIncrement(self, value):
- self._psetter(self._dbus_interface, "minimumIncrement", value)
+ return dbus.Double(self._pgetter(self._dbus_interface, "minimumIncrement"))
_minimumIncrementDoc = \
"""
The smallest incremental change which this valuator allows. If
0, the incremental changes to the valuator are limited only by
the precision of a double precision value on the platform.
"""
- minimumIncrement = property(fget=get_minimumIncrement, fset=set_minimumIncrement, doc=_minimumIncrementDoc)
+ minimumIncrement = property(fget=get_minimumIncrement, doc=_minimumIncrementDoc)
def get_minimumValue(self):
- return self._pgetter(self._dbus_interface, "minimumValue")
- def set_minimumValue(self, value):
- self._psetter(self._dbus_interface, "minimumValue", value)
+ return dbus.Double(self._pgetter(self._dbus_interface, "minimumValue"))
_minimumValueDoc = \
"""
The minimum value allowed by this valuator.
"""
- minimumValue = property(fget=get_minimumValue, fset=set_minimumValue, doc=_minimumValueDoc)
+ minimumValue = property(fget=get_minimumValue, doc=_minimumValueDoc)
# Register the accessible class with the factory.
accessible_factory.register_accessible_class(ATSPI_VALUE, Value)
diff --git a/spi-common/spi-dbus.h b/spi-common/spi-dbus.h
index 1251373..e8c2a3c 100644
--- a/spi-common/spi-dbus.h
+++ b/spi-common/spi-dbus.h
@@ -31,15 +31,24 @@
extern int _dbg;
+#define SPI_DBUS_NAME_REGISTRY "org.freedesktop.atspi.Registry"
#define SPI_DBUS_PATH_DEC "/org/freedesktop/atspi/registry/deviceeventcontroller"
+#define SPI_DBUS_PATH_REGISTRY "/org/freedesktop/atspi/registry"
+#define SPI_DBUS_PATH_DESKTOP "/org/freedesktop/atspi/registry/desktop"
+#define SPI_DBUS_PATH_NULL "/org/freedesktop/accessible/null"
+#define SPI_DBUS_INTERFACE_REGISTRY "org.freedesktop.atspi.Registry"
+
+#define SPI_DBUS_INTERFACE_DEC "org.freedesktop.atspi.DeviceEventController"
+#define SPI_DBUS_INTERFACE_DEVICE_EVENT_LISTENER "org.freedesktop.atspi.DeviceEventListener"
+
+#define SPI_DBUS_INTERFACE_DESKTOP "org.freedesktop.atspi.Desktop"
+
+#define SPI_DBUS_INTERFACE_TREE "org.freedesktop.atspi.Tree"
#define SPI_DBUS_INTERFACE_ACCESSIBLE "org.freedesktop.atspi.Accessible"
#define SPI_DBUS_INTERFACE_ACTION "org.freedesktop.atspi.Action"
#define SPI_DBUS_INTERFACE_APPLICATION "org.freedesktop.atspi.Application"
#define SPI_DBUS_INTERFACE_COLLECTION "org.freedesktop.atspi.Collection"
#define SPI_DBUS_INTERFACE_COMPONENT "org.freedesktop.atspi.Component"
-#define SPI_DBUS_INTERFACE_DEC "org.freedesktop.atspi.DeviceEventController"
-#define SPI_DBUS_INTERFACE_DEVICE_EVENT_LISTENER "org.freedesktop.atspi.DeviceEventListener"
-#define SPI_DBUS_INTERFACE_DESKTOP "org.freedesktop.atspi.Desktop"
#define SPI_DBUS_INTERFACE_DOCUMENT "org.freedesktop.atspi.Document"
#define SPI_DBUS_INTERFACE_EDITABLE_TEXT "org.freedesktop.atspi.EditableText"
#define SPI_DBUS_INTERFACE_EVENT_KEYBOARD "org.freedesktop.atspi.Event.Keyboard"
@@ -47,16 +56,10 @@ extern int _dbg;
#define SPI_DBUS_INTERFACE_HYPERLINK "org.freedesktop.atspi.Hyperlink"
#define SPI_DBUS_INTERFACE_HYPERTEXT "org.freedesktop.atspi.Hypertext"
#define SPI_DBUS_INTERFACE_IMAGE "org.freedesktop.atspi.Image"
-#define SPI_DBUS_INTERFACE_REGISTRY "org.freedesktop.atspi.Registry"
#define SPI_DBUS_INTERFACE_SELECTION "org.freedesktop.atspi.Selection"
#define SPI_DBUS_INTERFACE_TABLE "org.freedesktop.atspi.Table"
#define SPI_DBUS_INTERFACE_TEXT "org.freedesktop.atspi.Text"
-#define SPI_DBUS_INTERFACE_TREE "org.freedesktop.atspi.Tree"
#define SPI_DBUS_INTERFACE_VALUE "org.freedesktop.atspi.Value"
-#define SPI_DBUS_NAME_REGISTRY "org.freedesktop.atspi.Registry"
-#define SPI_DBUS_PATH_DESKTOP "/org/freedesktop/atspi/registry/desktop"
-#define SPI_DBUS_PATH_NULL "/org/freedesktop/accessible/null"
-#define SPI_DBUS_PATH_REGISTRY "/org/freedesktop/atspi/registry"
DBusMessage *spi_dbus_general_error(DBusMessage *message);
DBusMessage *spi_dbus_return_rect(DBusMessage *message, gint ix, gint iy, gint iwidth, gint iheight);
diff --git a/tests/pyatspi/accessibletest.py b/tests/pyatspi/accessibletest.py
index d94e0af..6cd2cdd 100644
--- a/tests/pyatspi/accessibletest.py
+++ b/tests/pyatspi/accessibletest.py
@@ -110,9 +110,10 @@ class AccessibleTest(_PasyTest):
root = self._desktop.getChildAtIndex(0)
attr = root.getAttributes()
res = ["foo:bar", "baz:qux", "quux:corge"]
+ attr.sort()
+ res.sort()
test.assertEqual(attr, res, "Attributes expected %s, recieved %s" % (attr, res))
-
def test_parent(self, test):
root = self._desktop.getChildAtIndex(0)
@@ -151,7 +152,7 @@ class AccessibleTest(_PasyTest):
def test_getRole(self, test):
root = self._desktop.getChildAtIndex(0)
test.assertEqual(root.getRole(), 69,
- "Expected role - \"69\". Recieved - \"%d\"" % (root.getRole(),))
+ "Expected role - \"69\". Recieved - \"%d\"" % (int(root.getRole()),))
def test_getRoleName(self, test):
root = self._desktop.getChildAtIndex(0)
diff --git a/tests/pyatspi/componenttest.py b/tests/pyatspi/componenttest.py
index c6a9253..fe30c88 100644
--- a/tests/pyatspi/componenttest.py
+++ b/tests/pyatspi/componenttest.py
@@ -113,7 +113,7 @@ class ComponentTest(_PasyTest):
layer = comp.getLayer()
test.assertEqual(layer, expected,
"Layer not correct. Expected %d, Recieved %d"
- % (layer, expected))
+ % (int(layer), int(expected)))
def test_getMDIZOrder(self, test):
root = self._desktop.getChildAtIndex(0)
diff --git a/xml/Makefile.am b/xml/Makefile.am
index 7b571ae..0c464a9 100644
--- a/xml/Makefile.am
+++ b/xml/Makefile.am
@@ -11,7 +11,6 @@ XML_SPEC= \
org.freedesktop.atspi.Hyperlink.xml \
org.freedesktop.atspi.Hypertext.xml \
org.freedesktop.atspi.Image.xml \
- org.freedesktop.atspi.LoginHelper.xml \
org.freedesktop.atspi.DeviceEvent.xml \
org.freedesktop.atspi.Registry.xml \
org.freedesktop.atspi.DeviceEventController.xml \
@@ -19,9 +18,7 @@ XML_SPEC= \
org.freedesktop.atspi.Relation.xml \
org.freedesktop.atspi.Role.xml \
org.freedesktop.atspi.Selection.xml \
- org.freedesktop.atspi.Selector.xml \
org.freedesktop.atspi.State.xml \
- org.freedesktop.atspi.StreamableContent.xml \
org.freedesktop.atspi.Table.xml \
org.freedesktop.atspi.Text.xml \
org.freedesktop.atspi.Tree.xml \
diff --git a/xml/org.freedesktop.atspi.Accessible.xml b/xml/org.freedesktop.atspi.Accessible.xml
index f34eba9..502d2c7 100644
--- a/xml/org.freedesktop.atspi.Accessible.xml
+++ b/xml/org.freedesktop.atspi.Accessible.xml
@@ -104,16 +104,6 @@
The number of children contained by this object.
</tp:docstring>
</tp:property>
- <method name="getChildren">
- <tp:docstring>
- Get the accessible children of this object.
- </tp:docstring>
- <arg direction="out" type="ao" tp:type="AccessibleSet">
- <tp:docstring>
- The Accessible children of this object.
- </tp:docstring>
- </arg>
- </method>
<method name="getChildAtIndex">
<tp:docstring>
Get the accessible child of this object at \c index.
@@ -228,7 +218,7 @@
"text attributes". (See Text.getAttributeRun)</p>
</tp:docstring>
- <arg direction="out" type="as" tp:type="AttributeSet">
+ <arg direction="out" type="{ss}" tp:type="AttributeSet">
<tp:docstring>
An AttributeSet encapsulating any "attribute values" currently defined for the object.
</tp:docstring>
diff --git a/xml/org.freedesktop.atspi.Application.xml b/xml/org.freedesktop.atspi.Application.xml
index 4f67ea8..71e028a 100644
--- a/xml/org.freedesktop.atspi.Application.xml
+++ b/xml/org.freedesktop.atspi.Application.xml
@@ -27,60 +27,6 @@
accessibility bridge implementation.</p>
</tp:docstring>
</tp:property>
- <tp:property name="id" type="i" access="readwrite">
- <tp:docstring>
- The application instance's unique ID as assigned by the registry.
- </tp:docstring>
- </tp:property>
- <method name="registerToolkitEventListener">
- <arg direction="in" name="listener" type="o" tp:type="EventListener">
- <tp:docstring>
- An EventListener object which will receive the requestedevents from the application's toolkits via toolit 'bridges'
- </tp:docstring>
- </arg>
- <arg direction="in" name="eventName" type="s">
- <tp:docstring>
- <p> A UTF-8 string indicating the type of (toolkit-specific) eventbeing requested. Not all applications can generate toolkit events of a given type. Register with this application's toolkit for "toolkit-specific" event notifications.</p>
-
- <p>For most event support, clients should use non-toolkit-specific events whenever possible, Registry.registerGlobalEventListener - this method is provided as a 'back door' when generic names do not exist for the events in question.</p>
- </tp:docstring>
- </arg>
- </method>
- <method name="registerObjectEventListener">
- <arg direction="in" name="listener" type="o" tp:type="EventListener">
- <tp:docstring>
- An EventListener object which will receive the requested events
- </tp:docstring>
- </arg>
- <arg direction="in" name="eventName" type="s">
- <tp:docstring>
- A UTF-8 string indicating the type of (toolkit-specific) event being requested. Register with this application toolkit for "Accessibility.Accessible" event notifications. DEPRECATED
- </tp:docstring>
- </arg>
- </method>
- <method name="pause">
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>Request that the application temporarily stop sending events.
- In most cases this should pause the application's main event loop.</p>
- </tp:docstring>
- <arg direction="out" type="b" tp:type="boolean">
- <tp:docstring>
- <p>True if the request succeeded, false otherwise.</p>
-
- <p>This method is not implemented in most toolkits, and therefore should be treated with caution.</p>
- </tp:docstring>
- </arg>
- </method>
- <method name="resume">
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>Request that the application resume sending events.</p>
- </tp:docstring>
- <arg direction="out" type="b" tp:type="boolean">
- <tp:docstring>
- True if the request succeeded, False otherwise.
- </tp:docstring>
- </arg>
- </method>
<method name="getLocale">
<tp:docstring xmlns="http://www.w3.org/1999/xhtml">
<p>Gets the locale in which the application is currently operating.
diff --git a/xml/org.freedesktop.atspi.Component.xml b/xml/org.freedesktop.atspi.Component.xml
index 26ee741..8eefd2c 100644
--- a/xml/org.freedesktop.atspi.Component.xml
+++ b/xml/org.freedesktop.atspi.Component.xml
@@ -197,21 +197,6 @@
</tp:docstring>
</arg>
</method>
- <method name="registerFocusHandler">
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>Register an EventListener for notification when this object receives keyboard focus.
- You probably want to register for focus events via
- Registry.registerGlobalEventListener instead. </p>
- </tp:docstring>
- <arg direction="in" name="handler" type="o" tp:type="EventListener"/>
- </method>
- <method name="deregisterFocusHandler">
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>Request that an EventListener registered via registerFocusHandler no longer be notified
- when this object receives keyboard focus.</p>
- </tp:docstring>
- <arg direction="in" name="handler" type="o" tp:type="EventListener"/>
- </method>
<method name="getAlpha">
<tp:docstring xmlns="http://www.w3.org/1999/xhtml">
<p>Obtain the alpha value of the component. An alpha value of 1.0 or greater
diff --git a/xml/org.freedesktop.atspi.Desktop.xml b/xml/org.freedesktop.atspi.Desktop.xml
index d0a21d4..2f188c9 100644
--- a/xml/org.freedesktop.atspi.Desktop.xml
+++ b/xml/org.freedesktop.atspi.Desktop.xml
@@ -1,35 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<node xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0" name="/node">
<interface name="org.freedesktop.atspi.Desktop">
- <tp:property name="childCount" type="i" access="read">
- <tp:docstring>
- The number of children contained by this object.
- </tp:docstring>
- </tp:property>
- <method name="getChildren">
- <tp:docstring>
- Get the Accessible children of this object.
- </tp:docstring>
- <arg direction="out" type="as" tp:type="AccessibleSet">
- <tp:docstring>
- The Accessible children of this object.
- </tp:docstring>
- </arg>
- </method>
- <method name="getChildAtIndex">
- <tp:docstring>
- Get the accessible child of this object at <code>index</code>.
- </tp:docstring>
- <arg direction="in" name="index" type="i">
- <tp:docstring>
- An parameter indicating which child is requested (zero-indexed).
- </tp:docstring>
- </arg>
- <arg direction="out" type="s" tp:type="Accessible">
- <tp:docstring>
- The 'nth' Accessible child of this object.
- </tp:docstring>
- </arg>
- </method>
</interface>
</node>
diff --git a/xml/org.freedesktop.atspi.Document.xml b/xml/org.freedesktop.atspi.Document.xml
index f6eb77e..9911377 100644
--- a/xml/org.freedesktop.atspi.Document.xml
+++ b/xml/org.freedesktop.atspi.Document.xml
@@ -42,7 +42,7 @@
For attributes which change within
the document content, see Text.getAttributes instead. </p>
</tp:docstring>
- <arg direction="out" type="as" tp:type="AttributeSet">
+ <arg direction="out" type="{ss}" tp:type="AttributeSet">
<tp:docstring>
A list of strings containing the attributes of the document, as name-value pairs.
</tp:docstring>
diff --git a/xml/org.freedesktop.atspi.EditableText.xml b/xml/org.freedesktop.atspi.EditableText.xml
index c8731ed..43ef104 100644
--- a/xml/org.freedesktop.atspi.EditableText.xml
+++ b/xml/org.freedesktop.atspi.EditableText.xml
@@ -59,19 +59,6 @@
</tp:docstring>
</arg>
</method>
- <method name="setAttributes">
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>Apply a particular set of attributes to a range of text. </p>
- </tp:docstring>
- <arg direction="in" name="attributes" type="s"/>
- <arg direction="in" name="startPos" type="i"/>
- <arg direction="in" name="endPos" type="i"/>
- <arg direction="out" type="b" tp:type="boolean">
- <tp:docstring>
- <code>True</code> if the text attributes were successfully modified, <code>False</code> otherwise.
- </tp:docstring>
- </arg>
- </method>
<method name="copyText">
<tp:docstring xmlns="http://www.w3.org/1999/xhtml">
<p>Copy a range of text into the system clipboard.
diff --git a/xml/org.freedesktop.atspi.LoginHelper.xml b/xml/org.freedesktop.atspi.LoginHelper.xml
deleted file mode 100644
index 08f3c4f..0000000
--- a/xml/org.freedesktop.atspi.LoginHelper.xml
+++ /dev/null
@@ -1,161 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<node xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0" name="/node">
-<interface name="org.freedesktop.atspi.LoginHelper">
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>An interface for use by assistive technologies by which
- they can access system information and services on a 'need to know'
- basis while the screen is locked, during user authentication, or
- during other sensitive operations. </p>
-
- <p>This interface is intended for use by assistive technologies
- and related user-enabling services, and by applications and
- utilities which may wish to restrict access to certain system
- devices and services during security-sensitive states, e.g. when
- the screen is locked or during authentication into some secure
- service. </p>
-
- <p>Such 'applications' (for instance, screen lock dialogs and
- security-enabled web browsers) use the LoginHelper client
- interfaces, and the bonobo-activation query service, to
- query for assistive technologies which advertise the LoginHelper
- service. The client then queries these assistive technologies
- for their device I/O requirements, via the getDeviceReqs call.
- The client may then issue the advisory request setSafe (TRUE),
- which requests that the LoginHelper -implementing service make a
- best-effort attempt to make itself more secure (for instance,
- an onscreen keyboard might turn off word prediction, and a
- screenreader may turn off keyboard echo via speech). The return
- value of setSafe is an advisory indication of whether this attempt
- was successful (no specific guarantees are implied).
- Once the 'security sensitive' state is exited, the client should
- call setSafe (FALSE). </p>
-
- <p>The return values from getDeviceReqs inform the client of which
- services the LoginHelper service (e. g. assistive technology) needs
- in order to do its job. The client may use this information to
- loosen any restrictions on access which it may currently have in
- place (for instance, keyboard grabs, etc.). If it does not do so,
- the likely outcome is that the end-user will experience loss
- of access to the system. </p>
- </tp:docstring>
- <tp:struct name="WindowInfo">
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>A structure containing info about toplevel X windows that
- the LoginHelper instance wishes to have raised. </p>
- </tp:docstring>
- <tp:member type="i" tp:name="winID">
- </tp:member>
- </tp:struct>
- <tp:enum name="DeviceReq" type="u">
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>The system and device access and services which the LoginHelper-implementing
- assistive technology requires in order to enable the user to use the system. </p>
- </tp:docstring>
- <tp:enumvalue suffix="GUI_EVENTS">
- <tp:docstring>
- Needs access to the GUI event subsystem (e.g. Xserver)
- </tp:docstring>
- </tp:enumvalue>
- <tp:enumvalue suffix="CORE_KEYBOARD" value="1">
- <tp:docstring>
- Needs access to the system keyboard events (read and write)
- </tp:docstring>
- </tp:enumvalue>
- <tp:enumvalue suffix="CORE_POINTER" value="2">
- <tp:docstring>
- Needs access to the onscreen pointer (e.g. mouse pointer)
- </tp:docstring>
- </tp:enumvalue>
- <tp:enumvalue suffix="EXT_INPUT" value="3">
- <tp:docstring>
- Reads XInput extended input devices
- </tp:docstring>
- </tp:enumvalue>
- <tp:enumvalue suffix="POST_WINDOWS" value="4">
- <tp:docstring>
- Posts Windows, and needs for toplevel windows to be visible
- </tp:docstring>
- </tp:enumvalue>
- <tp:enumvalue suffix="AUDIO_OUT" value="5">
- <tp:docstring>
- Writes to audio device
- </tp:docstring>
- </tp:enumvalue>
- <tp:enumvalue suffix="AUDIO_IN" value="6">
- <tp:docstring>
- Reads from audio device
- </tp:docstring>
- </tp:enumvalue>
- <tp:enumvalue suffix="NETWORK" value="7">
- <tp:docstring>
- Requires access to general network services, including remote access
- </tp:docstring>
- </tp:enumvalue>
- <tp:enumvalue suffix="LOCALHOST" value="8">
- <tp:docstring>
- Requires network services hosted on LOCALHOST only
- </tp:docstring>
- </tp:enumvalue>
- <tp:enumvalue suffix="SERIAL_OUT" value="9">
- <tp:docstring>
- Writes to a serial port
- </tp:docstring>
- </tp:enumvalue>
- <tp:enumvalue suffix="SERIAL_IN" value="10">
- <tp:docstring>
- !&lt;: Reads from a serial port
- </tp:docstring>
- </tp:enumvalue>
- </tp:enum>
- <method name="setSafe">
- <tp:docstring>
- setSafe:
- </tp:docstring>
- <arg direction="in" name="safe_mode" type="b" tp:type="boolean">
- <tp:docstring>
- <code>True</code> if the client is requesting that 'safe mode' be initiated.
- <code>False</code> if the client is advising that 'safe mode' may be
- exited. i.e. Normal operation may be resumed.
-
- Request a LoginHelper to enter "safe" mode, orinform LoginHelper that "safe" mode may be exited.
- If safe_mode is <code>True</code>, but the return value is <code>False</code> ,the requesting
- client may wish to deny services to the LoginHelper, for instance avoid raising its toplevels.
- The return value is purely advisory, and no guarantees are intended about what the implementing
- LoginHelper will do to improve security when in "safe" mode.
- </tp:docstring>
- </arg>
- <arg direction="out" type="b" tp:type="boolean">
- <tp:docstring>
- whether the LoginHelper is now "safe" or not.
- </tp:docstring>
- </arg>
- </method>
- <method name="getDeviceReqs">
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>Query a LoginHelper for the types of
- device I/O it requires, in order to do its job.
- For instance, a LoginHelper which needs to receive keyboard
- events will include
- Accessibility_LoginHelper_CORE_KEYBOARD in this list. </p>
- </tp:docstring>
- <arg direction="out" type="u" tp:type="DeviceReqList">
- <tp:docstring>
- A sequence of LoginHelper_DeviceReq indicatingthe device I/O required in order to facilitate end-user
- access to the system.
- </tp:docstring>
- </arg>
- </method>
- <method name="getRaiseWindows">
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>Get a list of window IDs that need raising on login.</p>
- </tp:docstring>
- <arg direction="out" type="ai" tp:type="WindowList">
- <tp:docstring>
- A sequence containing window IDS for toplevels whichneed to be raised/made
- visible during user authentication, inorder for the LoginHelper to facilitate
- end-user access to the system.
- </tp:docstring>
- </arg>
- </method>
-</interface>
-</node>
diff --git a/xml/org.freedesktop.atspi.Selector.xml b/xml/org.freedesktop.atspi.Selector.xml
deleted file mode 100644
index a06a18e..0000000
--- a/xml/org.freedesktop.atspi.Selector.xml
+++ /dev/null
@@ -1,151 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<node xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0" name="/node">
-<tp:struct name="Command">
- <tp:docstring>
- A structure which encapsulates both a string representation of a command and a unique command ID
- </tp:docstring>
- <tp:member type="s" tp:name="name"/>
- <tp:member type="i" tp:name="id"/>
-</tp:struct>
-<method name="notifyCommands">
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>Notify the CommandListener instance of changes to the currently
- available commands, by sending the current CommandList. </p>
- </tp:docstring>
- <arg direction="in" name="commands" type="a(si)" tp:type="CommandList">
- <tp:docstring>
- <p>The newly-available list of Command objects which
- may be invoked by the listener.</p>
- </tp:docstring>
- </arg>
-</method>
-<interface name="org.freedesktop.atspi.Selector">
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>This interface is intended for use by assistive technologies
- and related user-agents. Via this interface, an assistive technology or
- user agent may expose a series of choices or selections in textual form,
- which can be activated on demand by a client of the Selector interface. </p>
-
- <p>Examples of the use of this interface include voice-command and remote-control
- applications, in which the user interaction is wholly or partly delegated by the
- implementor to an external agent.</p>
- </tp:docstring>
- <tp:enum name="CommandResult" type="u">
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>A code returned by a call to activateCommand, indicating
- the result of the activation request.</p>
- </tp:docstring>
- <tp:enumvalue suffix="COMMAND_RESULT_INVALID">
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>The command was invalid or ill-formed; usually indicates
- an error condition. </p>
- </tp:docstring>
- </tp:enumvalue>
- <tp:enumvalue suffix="COMMAND_RESULT_SUCCESS" value="1">
- <tp:docstring>
- The command was successfully activated.
- </tp:docstring>
- </tp:enumvalue>
- <tp:enumvalue suffix="COMMAND_RESULT_FAILED" value="2">
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>The command was valid, but could not be activated.
- This may be due to problems with permissions or error conditions.</p>
- </tp:docstring>
- </tp:enumvalue>
- <tp:enumvalue suffix="COMMAND_RESULT_OBSOLETE" value="3">
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>The command is no longer valid in the current program context.
- This may mean that the application has changed state in such a
- way that the specified command it no longer applicable, or
- because changes to the application state have rendered it
- ambiguous. Commands should be re-fetched and a new selection
- made.</p>
- </tp:docstring>
- </tp:enumvalue>
- <tp:enumvalue suffix="COMMAND_RESULT_LAST_DEFINED" value="4">
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>Defines size of enumeration;
- do not use this value as a parameter.</p>
- </tp:docstring>
- </tp:enumvalue>
- </tp:enum>
- <tp:property name="supportsReplace" type="b" access="read">
- <tp:docstring>
- This attribute is <code>True</code> if this Selector allows its CommandList to be specified by the client
- </tp:docstring>
- </tp:property>
- <method name="getCommands">
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>Query the Selector for the current CommandList.</p>
- </tp:docstring>
- <arg direction="out" type="a(si)" tp:type="CommandList">
- <tp:docstring>
- The currently available CommandList
- </tp:docstring>
- </arg>
- </method>
- <method name="replaceCommands">
- <arg direction="in" name="commands" type="a(si)" tp:type="CommandList"/>
- <arg direction="out" type="b" tp:type="boolean">
- <tp:docstring>
- <code>True</code> if the replacement request was successful, <code>True</code> if the
- request could not be honored.
- </tp:docstring>
- </arg>
- </method>
- <method name="refreshCommands">
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>Ask the Selector to re-calculate its CommandList.</p>
- <p>In most cases the Selector will continuously
- update its CommandList without recourse to this call.
- This call is equivalent to getCommands, except that
- after refreshCommands the new CommandList will be returned
- via any registered CommandListener instances rather than
- synchronously via this call.</p>
- </tp:docstring>
- <arg direction="out" type="b" tp:type="boolean">
- <tp:docstring>
- <code>True</code> if the CommandList changed.
- </tp:docstring>
- </arg>
- </method>
- <method name="activateCommand">
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>Request that the Selector invoke the specified Command.</p>
- </tp:docstring>
- <arg direction="in" name="cmd" type="(si)" tp:type="Command">
- <tp:docstring>
- <p>The Command to activate/invoke.</p>
- </tp:docstring>
- </arg>
- <arg direction="out" type="u" tp:type="CommandResult">
- <tp:docstring>
- A CommandResult indicating whether the request was honored, and the reason for failure if the Command could not be activated or invoked.
- </tp:docstring>
- </arg>
- </method>
- <method name="registerChangeListener">
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>Register a :CommandListener instance for notification of
- changes to the command set.</p>
- </tp:docstring>
- <arg direction="in" name="listener" type="o" tp:type="CommandListener">
- <tp:docstring>
- <p>The CommandListener to be notified of changes.</p>
- </tp:docstring>
- </arg>
- </method>
- <method name="deregisterChangeListener">
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>Tell the Selector instance to cease notifying the
- specified CommandListener of changes to the command list.</p>
- </tp:docstring>
- <arg direction="in" name="listener" type="o" tp:type="CommandListener">
- <tp:docstring>
- <p>The CommandListener to remove from the
- notification list.</p>
- </tp:docstring>
- </arg>
- </method>
-</interface>
-</node>
diff --git a/xml/org.freedesktop.atspi.StreamableContent.xml b/xml/org.freedesktop.atspi.StreamableContent.xml
deleted file mode 100644
index 6fed868..0000000
--- a/xml/org.freedesktop.atspi.StreamableContent.xml
+++ /dev/null
@@ -1,170 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<node xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0" name="/node">
-<interface name="org.freedesktop.atspi.ContentStream">
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>An interface by which the requested data from a StreamableContent object
- may be read by the client.</p>
- </tp:docstring>
-</interface>
-<tp:enum name="SeekType" type="u">
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>Specifies the meaning of a seek 'offset'. Not all SeekTypes are
- supported by all StreamableContent data sources, for instance
- some streams may not support seeking from the beginning or other
- types of 'backwards' seeks.</p>
- </tp:docstring>
- <tp:enumvalue suffix="SEEK_SET">
- <tp:docstring>
- Seek from the start of the stream or data source.
- </tp:docstring>
- </tp:enumvalue>
- <tp:enumvalue suffix="SEEK_CURRENT" value="1">
- <tp:docstring>
- Seek relative to the current position.
- </tp:docstring>
- </tp:enumvalue>
- <tp:enumvalue suffix="SEEK_END" value="2">
- <tp:docstring>
- Seek from the end of the file, stream, or data source.
- </tp:docstring>
- </tp:enumvalue>
-</tp:enum>
-<tp:errors xmlns="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0" namespace="org.freedesktop.atspi.error">
- <tp:error name="IOError">
- <tp:docstring>
- Indicates that a transmission error has occurred while reading or seeking the stream or data source.
- </tp:docstring>
- </tp:error>
- <tp:error name="NotSupported">
- <tp:docstring>
- Indicates that the requested operation is not supported by the stream instance.
- </tp:docstring>
- </tp:error>
- <tp:error name="NoPermission">
- <tp:docstring>
- The operation is supported, but the current requestor does not havepermission to t the request, for instance does not have permission to read the stream.
- </tp:docstring>
- </tp:error>
-</tp:errors>
-<method name="seek">
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>Seek to a specified position in the Stream.</p>
- </tp:docstring>
- <arg direction="in" name="offset" type="i">
- <tp:docstring>
- An offset specifying the requested position in the stream,
- relative to the SeekType specified in <code>whence.</code>
- </tp:docstring>
- </arg>
- <arg direction="in" name="whence" type="u" tp:type="SeekType">
- <tp:docstring>
- A SeekType specifying the reference point from which the
- seek offset is calculated. Some forms of seek are not supported by certain
- implementations of Stream, in which case a NotSupported exception will be raised.
- </tp:docstring>
- </arg>
- <arg direction="out" type="i">
- <tp:docstring>
- The actual resulting offset, if no exception was raised.
- </tp:docstring>
- </arg>
- <tp:possible-errors>
- <tp:error name="org.freedesktop.atspi.error.(NoPermission"/>
- <tp:error name="org.freedesktop.atspi.error.IOError"/>
- <tp:error name="org.freedesktop.atspi.error.NotSupported"/>
- </tp:possible-errors>
-</method>
-<method name="read">
- <tp:docstring>
- Request/read a specified amount of data from a Stream.
- </tp:docstring>
- <arg direction="in" name="count" type="i"/>
- <arg direction="out" name="buffer" type="ay" tp:type="iobuf"/>
- <arg direction="out" type="i">
- <tp:docstring>
- The number of bytes actually read into the client buffer.
- </tp:docstring>
- </arg>
- <tp:possible-errors>
- <tp:error name="org.freedesktop.atspi.error.(NoPermission"/>
- <tp:error name="org.freedesktop.atspi.error.IOError"/>
- </tp:possible-errors>
-</method>
-<method name="close">
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>close the stream and release associated resources.
- A client should not perform further operations on a
- StreamableContent.Stream object after closing it.</p>
- </tp:docstring>
-</method>
-<interface name="org.freedesktop.atspi.StreamableContent">
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>An interface whereby an object allows its backing content
- to be streamed to clients. Negotiation of content type
- is allowed. Clients may examine the backing data and
- transform, convert, or parse the content in order to
- present it in an alternate form to end-users. </p>
-
- <p>The StreamableContent interface is particularly useful for saving,
- printing, or post-processing entire documents, or for persisting
- alternate views of a document.
- If document content itself is being serialized, stored, or converted,
- then use of the StreamableContent interface can help address performance
- issues. Unlike most AT-SPI/Accessibility interfaces, this interface
- is not strongly tied to the current user-agent view of the
- a particular document, but may in some cases give access to the
- underlying model data.</p>
- </tp:docstring>
- <method name="getContentTypes">
- <arg direction="out" type="as" tp:type="StringSeq">
- <tp:docstring>
- The list of available mimetypes for this object's content.
- </tp:docstring>
- </arg>
- </method>
- <method name="getContent">
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>DEPRECATED, use getStream instead.
- getContent:
- Retrieve this object's content, in a format appropriate to a
- requested mimetype. </p>
- </tp:docstring>
- <arg direction="in" name="contentType" type="s">
- </arg>
- </method>
- <method name="getStream">
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>Retrieve this object's content, in a format appropriate to a
- requested mimetype, as a ::ContentStream instance. </p>
-
- </tp:docstring>
- <arg direction="in" name="contentType" type="s">
- <tp:docstring>
- <p>A string specifying the desired mimetype for the content stream.</p>
- </tp:docstring>
- </arg>
- <arg direction="out" type="FIXME" tp:type="ContentStream">
- <tp:docstring>
- A Stream whose mimetype matches contentType,if available, or NIL.
- </tp:docstring>
- </arg>
- </method>
- <method name="getURI">
- <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
- <p>Get a URI pointing to the content of the specified type, if such a URI
- can be obtained. Not all streamable content providers have URI representations. </p>
- </tp:docstring>
- <arg direction="in" name="contentType" type="s">
- <tp:docstring>
- <p>A string specifying the desired mimetype for the content stream.
- If NULL, then a URI for the default content type will be returned, if available. </p>
- </tp:docstring>
- </arg>
- <arg direction="out" type="s">
- <tp:docstring>
- A string which constitutes a URI for a stream of the specifiedcontent type, or NULL if no such URI can be obtained.
- </tp:docstring>
- </arg>
- </method>
-</interface>
-</node>
diff --git a/xml/org.freedesktop.atspi.Text.xml b/xml/org.freedesktop.atspi.Text.xml
index 50ede9c..b2e2221 100644
--- a/xml/org.freedesktop.atspi.Text.xml
+++ b/xml/org.freedesktop.atspi.Text.xml
@@ -353,7 +353,7 @@
<arg direction="in" name="offset" type="i"/>
<arg direction="out" name="startOffset" type="i"/>
<arg direction="out" name="endOffset" type="i"/>
- <arg direction="out" type="s">
+ <arg direction="out" type="{ss}">
<tp:docstring>
The attributes at offset, as a semicolon-delimited set of colon-delimited name-value pairs. @see getAttributeRun
</tp:docstring>
@@ -363,7 +363,7 @@
<tp:docstring>
Deprecated in favor of getDefaultAttributeSet.
</tp:docstring>
- <arg direction="out" type="s">
+ <arg direction="out" type="{ss}">
<tp:docstring>
The attributes which apply to the entire text content, but which were not explicitlyspecified by the content creator.
</tp:docstring>
@@ -675,7 +675,7 @@
the default values. See also Text.getDefaultAttributes.
</tp:docstring>
</arg>
- <arg direction="out" type="as" tp:type="AttributeSet">
+ <arg direction="out" type="{ss}" tp:type="AttributeSet">
<tp:docstring>
The AttributeSet defined at offset, optionally including the 'default' attributes.
</tp:docstring>