~ubuntu-branches/ubuntu/wily/gnome-orca/wily-proposed

« back to all changes in this revision

Viewing changes to src/orca/scripts/apps/pidgin/script.py

  • Committer: Package Import Robot
  • Author(s): Mario Lang, Emilio Pozuelo Monfort, Mario Lang
  • Date: 2014-03-26 09:02:03 UTC
  • mfrom: (1.1.19)
  • Revision ID: package-import@ubuntu.com-20140326090203-hklufxw4me5mq70b
Tags: 3.12.0-1
[ Emilio Pozuelo Monfort ]
* debian/control.in:
  + Depend on gsettings-desktop-schemas, needed for the a11y gsettings
    keys. Closes: #741211.

[ Mario Lang ]
* New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
import pyatspi
30
30
 
31
31
import orca.messages as messages
32
 
import orca.scripts.default as default
 
32
import orca.scripts.toolkits.GAIL as GAIL
33
33
import orca.speech as speech
34
34
 
35
35
from .chat import Chat
42
42
#                                                                      #
43
43
########################################################################
44
44
 
45
 
class Script(default.Script):
 
45
class Script(GAIL.Script):
46
46
 
47
47
    def __init__(self, app):
48
48
        """Creates a new script for the given application.
61
61
                                      pyatspi.ROLE_FILLER,
62
62
                                      pyatspi.ROLE_FRAME]]
63
63
 
64
 
        default.Script.__init__(self, app)
 
64
        GAIL.Script.__init__(self, app)
65
65
 
66
66
    def getChat(self):
67
67
        """Returns the 'chat' class for this script."""
84
84
        handlers for chat functionality.
85
85
        """
86
86
 
87
 
        default.Script.setupInputEventHandlers(self)
 
87
        GAIL.Script.setupInputEventHandlers(self)
88
88
        self.inputEventHandlers.update(self.chat.inputEventHandlers)
89
89
 
90
90
    def getAppKeyBindings(self):
153
153
        if self.chat.isInBuddyList(event.source):
154
154
            return
155
155
        else:
156
 
            default.Script.onNameChanged(self, event)
 
156
            GAIL.Script.onNameChanged(self, event)
157
157
 
158
158
    def onTextDeleted(self, event):
159
159
        """Called whenever text is deleted from an object.
165
165
        if self.chat.isInBuddyList(event.source):
166
166
            return
167
167
        else:
168
 
            default.Script.onTextDeleted(self, event)
 
168
            GAIL.Script.onTextDeleted(self, event)
169
169
 
170
170
    def onTextInserted(self, event):
171
171
        """Called whenever text is added to an object."""
173
173
        if self.chat.presentInsertedText(event):
174
174
            return
175
175
 
176
 
        default.Script.onTextInserted(self, event)
 
176
        GAIL.Script.onTextInserted(self, event)
177
177
 
178
178
    def onValueChanged(self, event):
179
179
        """Called whenever an object's value changes.  Currently, the
186
186
        if self.chat.isInBuddyList(event.source):
187
187
            return
188
188
        else:
189
 
            default.Script.onValueChanged(self, event)
 
189
            GAIL.Script.onValueChanged(self, event)
190
190
 
191
191
    def onWindowActivated(self, event):
192
192
        """Called whenever a toplevel window is activated."""
198
198
        allPageTabs = self.utilities.descendantsWithRole(
199
199
            event.source, pyatspi.ROLE_PAGE_TAB)
200
200
 
201
 
        default.Script.onWindowActivated(self, event)
202
 
 
203
 
    def visualAppearanceChanged(self, event, obj):
204
 
        """Called when the visual appearance of an object changes.
205
 
        Overridden here because we get object:state-changed:expanded
206
 
        events for the buddy list, but the obj is in a hidden column.
207
 
 
208
 
        Arguments:
209
 
        - event: if not None, the Event that caused this to happen
210
 
        - obj: the Accessible whose visual appearance changed.
211
 
        """
212
 
 
213
 
        if self.chat.isInBuddyList(obj) \
214
 
           and event.type.startswith("object:state-changed:expanded"):
215
 
 
216
 
            # The event is associated with the invisible cell. Set it
217
 
            # to the visible cell and then let the default script do
218
 
            # its thing.
219
 
            #
 
201
        GAIL.Script.onWindowActivated(self, event)
 
202
 
 
203
    def onExpandedChanged(self, event):
 
204
        """Callback for object:state-changed:expanded accessibility events."""
 
205
 
 
206
        # Overridden here because the event.source is in a hidden column.
 
207
        obj = event.source
 
208
        if self.chat.isInBuddyList(obj):
220
209
            obj = obj.parent[obj.getIndexInParent() + 1]
 
210
            self.updateBraille(obj)
 
211
            speech.speak(self.speechGenerator.generateSpeech(obj, alreadyFocused=True))
 
212
            return
221
213
            
222
 
        default.Script.visualAppearanceChanged(self, event, obj)
223
 
 
 
214
        GAIL.Script.onExpandedChanged(self, event)