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

« back to all changes in this revision

Viewing changes to src/orca/scripts/apps/ekiga/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:
28
28
import pyatspi
29
29
 
30
30
import orca.scripts.default as default
31
 
import orca.orca as orca
32
 
import orca.orca_state as orca_state
33
 
import orca.speech as speech
34
31
 
35
32
########################################################################
36
33
#                                                                      #
66
63
 
67
64
        return False
68
65
 
69
 
    def onActiveDescendantChanged(self, event):
70
 
        """Called when an object who manages its own descendants detects a
71
 
        change in one of its children.
72
 
 
73
 
        Arguments:
74
 
        - event: the Event
75
 
        """
76
 
 
77
 
        # The tree table on the left side of Ekiga's Preferences dialog
78
 
        # has STATE_FOCUSABLE, but not STATE_FOCUSED. The default script
79
 
        # will ignore these events as a result. See bug 574221.
80
 
        #
81
 
        window = self.utilities.topLevelObject(event.source)
82
 
        if not window or window.getRole() != pyatspi.ROLE_DIALOG:
83
 
            return default.Script.onActiveDescendantChanged(self, event)
84
 
 
85
 
        # There can be cases when the object that fires an
86
 
        # active-descendant-changed event has no children. In this case,
87
 
        # use the object that fired the event, otherwise, use the child.
88
 
        #
89
 
        child = event.any_data
90
 
        if child:
91
 
            speech.stop()
92
 
            orca.setLocusOfFocus(event, child)
93
 
        else:
94
 
            orca.setLocusOfFocus(event, event.source)
95
 
 
96
 
        # We'll tuck away the activeDescendant information for future
97
 
        # reference since the AT-SPI gives us little help in finding
98
 
        # this.
99
 
        #
100
 
        if orca_state.locusOfFocus \
101
 
           and (orca_state.locusOfFocus != event.source):
102
 
            self.pointOfReference['activeDescendantInfo'] = \
103
 
                [orca_state.locusOfFocus.parent,
104
 
                 orca_state.locusOfFocus.getIndexInParent()]
105
 
 
106
 
    def onFocus(self, event):
107
 
        """Called whenever an object gets focus.
108
 
 
109
 
        Arguments:
110
 
        - event: the Event
111
 
        """
112
 
 
113
 
        # Selecting items in Ekiga's Preferences dialog causes objects
114
 
        # of ROLE_PAGE_TAB to issue focus: events. These page tabs are
115
 
        # not showing or visible, but they claim to be both. As a result
116
 
        # Orca attempts to present them. Because these page tabs lack a
117
 
        # name as well as STATE_SENSTIVE, this causes us to present
118
 
        # "page grayed." We just want to ignore this creative use of a
119
 
        # Gtk+ widget. See bug 574221.
120
 
        #
121
 
        if event.source.getRole() == pyatspi.ROLE_PAGE_TAB \
122
 
           and not event.source.getState().contains(pyatspi.STATE_SENSITIVE) \
123
 
           and not event.source.name:
124
 
            return
125
 
 
126
 
        default.Script.onFocus(self, event)
127
 
 
128
66
    def onTextInserted(self, event):
129
67
        """Called whenever text is inserted into one of Ekiga's text objects.
130
68
        Overridden here so that we can present new messages to the user.
134
72
        """
135
73
 
136
74
        if self.isChatRoomMsg(event.source):
137
 
            speech.speak(event.any_data)
138
 
            self.displayBrailleMessage(event.any_data)
 
75
            self.presentMessage(event.any_data)
139
76
            return
140
77
 
141
78
        default.Script.onTextInserted(self, event)