~ubuntu-branches/ubuntu/hardy/gnome-orca/hardy

« back to all changes in this revision

Viewing changes to src/orca/braille.py

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-04-26 11:06:56 UTC
  • mfrom: (1.1.14 upstream)
  • Revision ID: james.westby@ubuntu.com-20070426110656-uwpmlvdkave5jwrg
Tags: 2.19.1-0ubuntu1
* Synchronized with Debian, remaining Ubuntu changes:
  - debian/control:
    - newer Depends/Build-Depends, add Packages python-orca-brlapi and
      python-orca-brlapi-dbg.
  - debian/patches/01_add_ubiquity-script.dpatch,
    debian/patches/01_libbrlapi_fix.dpatch,
    debian/patches/01_link_libbrlapi.dpatch,
    debian/patches/01_no_default_desktop_item.dpatch,
    debian/patches/02_libbrlapi_fix.dpatch: added patches.
  - debian/rules, debian/control:
    - use pycentral, build python packages.
  - debian/copyright, debian/README.Debian: give credit to Luke Yelavich.
  - debian/install: python2.4 -> python*, install *.so files to different
    package.
  - debian/watch: added.
* New upstream release.
* debian/control:
  - added python-gconf as Build-Depends and Depends.
  - set Maintainer: Ubuntu Accessibility Developers
    <ubuntu-accessibility-devel@lists.ubuntu.com>
* debian/patches/01_add_ubiquity-script.dpatch:
  - updated.
* debian/patches/01_no_default_desktop_item.dpatch:
  - removed .rej file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
moving the text caret.
26
26
"""
27
27
 
28
 
__id__        = "$Id: braille.py 1995 2007-02-11 16:40:57Z wwalker $"
29
 
__version__   = "$Revision: 1995 $"
30
 
__date__      = "$Date: 2007-02-11 11:40:57 -0500 (Sun, 11 Feb 2007) $"
 
28
__id__        = "$Id: braille.py 2223 2007-03-28 17:06:38Z wwalker $"
 
29
__version__   = "$Revision: 2223 $"
 
30
__date__      = "$Date: 2007-03-28 13:06:38 -0400 (Wed, 28 Mar 2007) $"
31
31
__copyright__ = "Copyright (c) 2005-2006 Sun Microsystems Inc."
32
32
__license__   = "LGPL"
33
33
 
63
63
    pass
64
64
import debug
65
65
import eventsynthesizer
 
66
import orca_state
66
67
import settings
67
 
import util
68
68
 
69
69
from orca_i18n import _                          # for gettext support
70
70
from rolenames import getShortBrailleForRoleName # localized role names
158
158
# ATM, the ones used in default.py are:
159
159
#
160
160
command_name = {}
 
161
 
 
162
# Translators: this is a command for a button on a refreshable braille
 
163
# display (an external hardware device used by people who are blind).
 
164
# When pressing the button, the display scrolls to the left.
 
165
#
161
166
command_name[CMD_FWINLT]   = _("Line Left")
 
167
 
 
168
# Translators: this is a command for a button on a refreshable braille
 
169
# display (an external hardware device used by people who are blind).
 
170
# When pressing the button, the display scrolls to the right.
 
171
#
162
172
command_name[CMD_FWINRT]   = _("Line Right")
 
173
 
 
174
# Translators: this is a command for a button on a refreshable braille
 
175
# display (an external hardware device used by people who are blind).
 
176
# When pressing the button, the display scrolls up.
 
177
#
163
178
command_name[CMD_LNUP]     = _("Line Up")
 
179
 
 
180
# Translators: this is a command for a button on a refreshable braille
 
181
# display (an external hardware device used by people who are blind).
 
182
# When pressing the button, the display scrolls down.
 
183
#
164
184
command_name[CMD_LNDN]     = _("Line Down")
 
185
 
 
186
# Translators: this is a command for a button on a refreshable braille
 
187
# display (an external hardware device used by people who are blind).
 
188
# When pressing the button, the display scrolls to the top left of the
 
189
# window.
 
190
#
165
191
command_name[CMD_TOP_LEFT] = _("Top Left")
 
192
 
 
193
# Translators: this is a command for a button on a refreshable braille
 
194
# display (an external hardware device used by people who are blind).
 
195
# When pressing the button, the display scrolls to the bottom right of
 
196
# the window.
 
197
#
166
198
command_name[CMD_BOT_LEFT] = _("Bottom Right")
 
199
 
 
200
# Translators: this is a command for a button on a refreshable braille
 
201
# display (an external hardware device used by people who are blind).
 
202
# When pressing the button, the display scrolls to position containing
 
203
# the cursor.
 
204
#
167
205
command_name[CMD_HOME]     = _("Cursor Position")
168
206
 
169
207
# The size of the physical display (width, height).  The coordinate system of
311
349
        """
312
350
 
313
351
        self.accessible = accessible
314
 
        [string, self.caretOffset, self.lineOffset] = \
315
 
                 util.getTextLineAtCaret(self.accessible)
 
352
        if orca_state.activeScript:
 
353
            [string, self.caretOffset, self.lineOffset] = \
 
354
                 orca_state.activeScript.getTextLineAtCaret(self.accessible)
316
355
 
317
356
        # Sometimes, gnome-terminal will give us very odd values when
318
357
        # the user is editing using 'vi' and has positioned the caret
345
384
        """
346
385
 
347
386
        [string, caretOffset, lineOffset] = \
348
 
                 util.getTextLineAtCaret(self.accessible)
 
387
                 orca_state.activeScript.getTextLineAtCaret(self.accessible)
349
388
        cursorOffset = caretOffset - lineOffset
350
389
        if self.label:
351
390
            cursorOffset += len(self.label.decode("UTF-8")) + 1
689
728
                # The name before BrlTTY v3.8 revision 2810
690
729
                #
691
730
                writeStruct = brlapi.Write()
692
 
            writeStruct.text = substring
693
731
            writeStruct.regionBegin = 1
694
732
            writeStruct.regionSize = len(substring.decode("UTF-8"))
695
733
            while writeStruct.regionSize < _displaySize[0]:
696
 
                writeStruct.text += " "
 
734
                substring += " "
697
735
                writeStruct.regionSize += 1
 
736
            writeStruct.text = substring
698
737
            writeStruct.cursor = cursorCell
699
738
            writeStruct.charset = "UTF-8"
700
739