[pyatspi2] Adapt for event registration api changes, and register events needed for cache



commit 3dacd9cd7af54da745630b96adb83f59b64266f8
Author: Mike Gorse <mgorse novell com>
Date:   Mon Aug 16 18:37:12 2010 -0400

    Adapt for event registration api changes, and register events needed for cache

 pyatspi/appevent.py |   13 +++++++------
 pyatspi/cache.py    |   18 ++++++++++++++++++
 2 files changed, 25 insertions(+), 6 deletions(-)
---
diff --git a/pyatspi/appevent.py b/pyatspi/appevent.py
index 58dd52f..8395982 100644
--- a/pyatspi/appevent.py
+++ b/pyatspi/appevent.py
@@ -16,6 +16,7 @@ import string
 import gobject
 import interfaces
 from interfaces import ATSPI_REGISTRY_NAME, ATSPI_ROOT_PATH
+from interfaces import ATSPI_REGISTRY_PATH, ATSPI_REGISTRY_INTERFACE
 from accessible import BoundingBox
 from exceptions import *
 import dbus as _dbus
@@ -337,9 +338,9 @@ class _ApplicationEventRegister (object):
                                 registered.append((new_type.name,
                                                    event_type_to_signal_reciever(self._bus, self._factory, client, new_type)))
                                 self._bus.call_async(ATSPI_REGISTRY_NAME,
-                                                     ATSPI_ROOT_PATH,
-                                                     interfaces.ATSPI_APPLICATION,
-                                                     'RegisterEventListener',
+                                                     ATSPI_REGISTRY_PATH,
+                                                     ATSPI_REGISTRY_INTERFACE,
+                                                     'RegisterEvent',
                                                      's', (name,), None, None)
 
                                 self.removeEvents (client, True, name)
@@ -367,9 +368,9 @@ class _ApplicationEventRegister (object):
                                 if remove_type.is_subtype(registered_type, excludeSelf):
                                         signal_match.remove()
                                         self._bus.call_async(ATSPI_REGISTRY_NAME,
-                                                             ATSPI_ROOT_PATH,
-                                                             interfaces.ATSPI_APPLICATION,
-                                                             'DeregisterEventListener',
+                                                             ATSPI_REGISTRY_PATH,
+                                                             ATSPI_REGISTRY_INTERFACE,
+                                                             'DeregisterEvent',
                                                              's', (type_name,),
                                                              None, None)
                                         del(registered[i])
diff --git a/pyatspi/cache.py b/pyatspi/cache.py
index 207a8d4..b0ce9d1 100644
--- a/pyatspi/cache.py
+++ b/pyatspi/cache.py
@@ -97,6 +97,12 @@ class DesktopCacheManager (object):
                                         sender_keyword="sender",
                                         path_keyword="path")
 
+                bus.call_async(ATSPI_REGISTRY_NAME,
+                               ATSPI_REGISTRY_PATH,
+                               ATSPI_REGISTRY_INTERFACE,
+                               'RegisterEvent',
+                               's', ('object:children-changed',), None, None)
+
                 self._property_change =  \
                         bus.add_signal_receiver(self._property_change_handler,
                                                 dbus_interface=_ATSPI_EVENT_OBJECT_INTERFACE,
@@ -106,6 +112,12 @@ class DesktopCacheManager (object):
                                                 sender_keyword="sender",
                                                 path_keyword="path")
 
+                bus.call_async(ATSPI_REGISTRY_NAME,
+                               ATSPI_REGISTRY_PATH,
+                               ATSPI_REGISTRY_INTERFACE,
+                               'RegisterEvent',
+                               's', ('object:property-change',), None, None)
+
                 self._state_changed = \
                         bus.add_signal_receiver(self._state_changed_handler,
                                                 dbus_interface=_ATSPI_EVENT_OBJECT_INTERFACE,
@@ -115,6 +127,12 @@ class DesktopCacheManager (object):
                                                 sender_keyword="sender",
                                                 path_keyword="path")
 
+                bus.call_async(ATSPI_REGISTRY_NAME,
+                               ATSPI_REGISTRY_PATH,
+                               ATSPI_REGISTRY_INTERFACE,
+                               'RegisterEvent',
+                               's', ('object:state-changed',), None, None)
+
                 self._cache_add = \
                         bus.add_signal_receiver(self._add_object,
                                                 path=_ATSPI_CACHE_PATH,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]